zuplo 7.15.32 → 7.15.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/docs/ai-gateway/azure-ai.mdx +2 -6
  2. package/docs/ai-gateway/bedrock-mantle.mdx +2 -6
  3. package/docs/ai-gateway/cookbooks/data-residency.mdx +3 -7
  4. package/docs/ai-gateway/custom-pricing.mdx +54 -0
  5. package/docs/ai-gateway/guardrails.mdx +1 -3
  6. package/docs/ai-gateway/jev.mdx +35 -0
  7. package/docs/ai-gateway/managing-apps.mdx +17 -0
  8. package/docs/ai-gateway/managing-providers.mdx +11 -0
  9. package/docs/ai-gateway/observability/analytics.mdx +2 -2
  10. package/docs/ai-gateway/openrouter.mdx +20 -0
  11. package/docs/ai-gateway/routing.mdx +50 -15
  12. package/docs/ai-gateway/universal-api.mdx +50 -6
  13. package/docs/ai-gateway/user-apps.mdx +44 -2
  14. package/docs/ai-gateway/vertex-ai.mdx +5 -13
  15. package/docs/analytics/shared-controls.md +5 -0
  16. package/docs/analytics/tabs/consumers.md +36 -0
  17. package/docs/articles/api-key-api.mdx +16 -1
  18. package/docs/articles/api-key-buckets.mdx +1 -1
  19. package/docs/articles/api-key-consumer-bucket-portal-ui.mdx +1 -1
  20. package/docs/articles/api-key-self-serve-integration.mdx +1 -1
  21. package/docs/articles/api-lint-configuration.mdx +21 -0
  22. package/docs/articles/api-lint-custom-rules.mdx +6 -0
  23. package/docs/articles/branch-based-deployments.mdx +11 -3
  24. package/docs/articles/ci-cd-azure/multi-stage-deployment.mdx +2 -2
  25. package/docs/articles/ci-cd-azure/pr-preview-environments.mdx +23 -4
  26. package/docs/articles/ci-cd-azure/tag-based-releases.mdx +1 -1
  27. package/docs/articles/ci-cd-bitbucket/multi-stage-deployment.mdx +3 -4
  28. package/docs/articles/ci-cd-bitbucket/pr-preview-environments.mdx +6 -5
  29. package/docs/articles/ci-cd-bitbucket/tag-based-releases.mdx +1 -1
  30. package/docs/articles/ci-cd-circleci/multi-stage-deployment.mdx +2 -3
  31. package/docs/articles/ci-cd-circleci/pr-preview-environments.mdx +6 -5
  32. package/docs/articles/ci-cd-circleci/tag-based-releases.mdx +1 -3
  33. package/docs/articles/ci-cd-github/basic-deployment.mdx +6 -6
  34. package/docs/articles/ci-cd-github/cleanup-on-branch-delete.mdx +8 -20
  35. package/docs/articles/ci-cd-github/deploy-and-test.mdx +3 -3
  36. package/docs/articles/ci-cd-github/local-testing.mdx +1 -1
  37. package/docs/articles/ci-cd-github/multi-stage-deployment.mdx +2 -3
  38. package/docs/articles/ci-cd-github/pr-preview-environments.mdx +20 -31
  39. package/docs/articles/ci-cd-github/tag-based-releases.mdx +5 -3
  40. package/docs/articles/ci-cd-gitlab/mr-preview-environments.mdx +10 -4
  41. package/docs/articles/ci-cd-gitlab/multi-stage-deployment.mdx +3 -3
  42. package/docs/articles/ci-cd-gitlab/tag-based-releases.mdx +1 -1
  43. package/docs/articles/connect-to-aws-alb-with-mtls.mdx +2 -6
  44. package/docs/articles/custom-ci-cd-azure.mdx +2 -2
  45. package/docs/articles/custom-ci-cd-bitbucket.mdx +2 -2
  46. package/docs/articles/custom-ci-cd-circleci.mdx +2 -2
  47. package/docs/articles/custom-ci-cd-github.mdx +10 -11
  48. package/docs/articles/custom-ci-cd-gitlab.mdx +2 -2
  49. package/docs/articles/environment-variables.mdx +55 -0
  50. package/docs/articles/monetization/api-access.mdx +126 -9
  51. package/docs/articles/monetization/meters.mdx +49 -2
  52. package/docs/articles/monetization/subscription-lifecycle.md +117 -19
  53. package/docs/articles/monetization/usage.mdx +58 -0
  54. package/docs/articles/monorepo-deployment.mdx +10 -25
  55. package/docs/articles/openapi.mdx +14 -0
  56. package/docs/articles/proxy-openai-realtime-api.mdx +6 -2
  57. package/docs/articles/secure-tunnel.mdx +3 -7
  58. package/docs/articles/support.mdx +35 -0
  59. package/docs/articles/testing-preview-environments.mdx +1 -1
  60. package/docs/caching/custom-caching-policy.mdx +4 -4
  61. package/docs/caching/dynamic-cache-rules.mdx +3 -3
  62. package/docs/caching/overview.mdx +2 -6
  63. package/docs/cli/delete.mdx +50 -0
  64. package/docs/cli/delete.partial.mdx +52 -0
  65. package/docs/cli/deploy.mdx +35 -18
  66. package/docs/cli/deploy.partial.mdx +35 -18
  67. package/docs/cli/variable-delete.mdx +36 -0
  68. package/docs/cli/variable-delete.partial.mdx +37 -0
  69. package/docs/concepts/source-control-and-deployment.mdx +9 -17
  70. package/docs/concepts/where-zuplo-runs.mdx +4 -12
  71. package/docs/dedicated/akamai/ai-powered-applications.mdx +5 -15
  72. package/docs/dedicated/akamai/architecture.mdx +11 -33
  73. package/docs/dedicated/akamai/hostname-routing.mdx +4 -4
  74. package/docs/dedicated/architecture.mdx +1 -1
  75. package/docs/dedicated/source-control.mdx +1 -1
  76. package/docs/dev-portal/dev-portal-create-consumer-on-auth.mdx +1 -1
  77. package/docs/dev-portal/overview.mdx +23 -0
  78. package/docs/dev-portal/zudoku/components/alert.mdx +1 -1
  79. package/docs/dev-portal/zudoku/configuration/api-reference.md +52 -0
  80. package/docs/dev-portal/zudoku/configuration/authentication-auth0.md +25 -0
  81. package/docs/dev-portal/zudoku/configuration/authentication-azure-ad.md +7 -0
  82. package/docs/dev-portal/zudoku/configuration/authentication-openid.md +48 -2
  83. package/docs/dev-portal/zudoku/configuration/authentication.md +4 -0
  84. package/docs/dev-portal/zudoku/configuration/build-configuration.mdx +4 -0
  85. package/docs/dev-portal/zudoku/configuration/navigation.mdx +15 -1
  86. package/docs/dev-portal/zudoku/configuration/overview.md +3 -0
  87. package/docs/dev-portal/zudoku/custom-plugins.md +38 -1
  88. package/docs/dev-portal/zudoku/guides/server-side-content-protection.md +7 -7
  89. package/docs/dev-portal/zudoku/openapi-extensions/x-enum-descriptions.md +85 -0
  90. package/docs/dev-portal/zudoku-partials/configuration/authentication-auth0.partial.md +24 -0
  91. package/docs/errors/build-error.mdx +58 -0
  92. package/docs/guides/backend-failover.mdx +9 -8
  93. package/docs/mcp-gateway/auth/configuring-entra.mdx +59 -0
  94. package/docs/mcp-gateway/auth/configuring-okta.mdx +30 -6
  95. package/docs/mcp-gateway/auth/configuring-workos.mdx +26 -0
  96. package/docs/mcp-gateway/auth/overview.mdx +2 -2
  97. package/docs/mcp-gateway/auth/upstream-oauth.mdx +1 -1
  98. package/docs/mcp-gateway/overview.mdx +1 -1
  99. package/docs/mcp-server/authorize-tool-calls.mdx +6 -2
  100. package/docs/policies/mcp-entra-oauth-inbound/doc.md +24 -0
  101. package/docs/policies/mcp-entra-oauth-inbound/schema.json +13 -0
  102. package/docs/policies/mcp-okta-oauth-inbound/doc.md +9 -2
  103. package/docs/policies/mcp-okta-oauth-inbound/schema.json +2 -2
  104. package/docs/policies/mcp-workos-oauth-inbound/doc.md +8 -0
  105. package/docs/policies/mcp-workos-oauth-inbound/schema.json +7 -0
  106. package/docs/policies/request-validation-inbound/doc.md +54 -0
  107. package/docs/programmable-api/environment.mdx +10 -2
  108. package/package.json +5 -5
@@ -81,18 +81,10 @@ set of authentication, rate limits, and analytics.
81
81
  <DiagramNode id="zuplo" variant="zuplo">
82
82
  Zuplo Gateway
83
83
  </DiagramNode>
84
- <DiagramNode id="aws" variant="orange">
85
- AWS
86
- </DiagramNode>
87
- <DiagramNode id="gcp" variant="blue">
88
- Google Cloud
89
- </DiagramNode>
90
- <DiagramNode id="azure" variant="blue">
91
- Azure
92
- </DiagramNode>
93
- <DiagramNode id="onprem" variant="green">
94
- On-premises data center
95
- </DiagramNode>
84
+ <DiagramNode id="aws">AWS</DiagramNode>
85
+ <DiagramNode id="gcp">Google Cloud</DiagramNode>
86
+ <DiagramNode id="azure">Azure</DiagramNode>
87
+ <DiagramNode id="onprem">On-premises data center</DiagramNode>
96
88
  <DiagramEdge from="clients" to="zuplo" />
97
89
  <DiagramEdge from="zuplo" to="aws" />
98
90
  <DiagramEdge from="zuplo" to="gcp" />
@@ -42,15 +42,9 @@ The following diagram shows the complete architecture:
42
42
  <Diagram height="h-56" direction="horizontal">
43
43
  <DiagramNode id="chat-app">AI Chat Application</DiagramNode>
44
44
  <DiagramGroup id="edge" label="Akamai Edge Platform">
45
- <DiagramNode id="waf" variant="blue">
46
- WAF + DDoS
47
- </DiagramNode>
48
- <DiagramNode id="cdn" variant="blue">
49
- Akamai CDN
50
- </DiagramNode>
51
- <DiagramNode id="ai-firewall" variant="orange">
52
- AI Firewall
53
- </DiagramNode>
45
+ <DiagramNode id="waf">WAF + DDoS</DiagramNode>
46
+ <DiagramNode id="cdn">Akamai CDN</DiagramNode>
47
+ <DiagramNode id="ai-firewall">AI Firewall</DiagramNode>
54
48
  </DiagramGroup>
55
49
  <DiagramGroup id="gateway" label="Zuplo Gateway">
56
50
  <DiagramNode id="ai-gateway" variant="zuplo">
@@ -61,12 +55,8 @@ The following diagram shows the complete architecture:
61
55
  </DiagramNode>
62
56
  </DiagramGroup>
63
57
  <DiagramGroup id="backend" label="Akamai Connected Cloud">
64
- <DiagramNode id="llm" variant="green">
65
- AI Model (LLM)
66
- </DiagramNode>
67
- <DiagramNode id="api" variant="green">
68
- Internal Data API
69
- </DiagramNode>
58
+ <DiagramNode id="llm">AI Model (LLM)</DiagramNode>
59
+ <DiagramNode id="api">Internal Data API</DiagramNode>
70
60
  </DiagramGroup>
71
61
  <DiagramEdge from="chat-app" to="waf" />
72
62
  <DiagramEdge from="waf" to="cdn" fromSide="bottom" toSide="top" />
@@ -42,12 +42,8 @@ to Zuplo and your backend services:
42
42
  <Diagram height="h-64">
43
43
  <DiagramNode id="client">Client</DiagramNode>
44
44
  <DiagramGroup id="akamai-edge" label="Akamai Edge Platform">
45
- <DiagramNode id="cdn" variant="blue">
46
- Akamai CDN
47
- </DiagramNode>
48
- <DiagramNode id="gtm" variant="blue">
49
- Global Traffic Manager
50
- </DiagramNode>
45
+ <DiagramNode id="cdn">Akamai CDN</DiagramNode>
46
+ <DiagramNode id="gtm">Global Traffic Manager</DiagramNode>
51
47
  </DiagramGroup>
52
48
  <DiagramGroup id="akamai-cloud" label="Akamai Connected Cloud">
53
49
  <DiagramNode id="gateway" variant="zuplo">
@@ -131,36 +127,26 @@ traffic to the closest healthy region.
131
127
  <Diagram height="h-[500px]" direction="vertical">
132
128
  <DiagramNode id="client">Client</DiagramNode>
133
129
  <DiagramGroup id="akamai-edge" label="Akamai Edge Platform">
134
- <DiagramNode id="cdn" variant="blue">
135
- Akamai CDN
136
- </DiagramNode>
137
- <DiagramNode id="gtm" variant="blue">
138
- Global Traffic Manager
139
- </DiagramNode>
130
+ <DiagramNode id="cdn">Akamai CDN</DiagramNode>
131
+ <DiagramNode id="gtm">Global Traffic Manager</DiagramNode>
140
132
  </DiagramGroup>
141
133
  <DiagramGroup id="region1" label="Akamai Cloud - Region 1">
142
134
  <DiagramNode id="gateway1" variant="zuplo">
143
135
  Zuplo Gateway
144
136
  </DiagramNode>
145
- <DiagramNode id="backend1" variant="green">
146
- Backend (Region 1)
147
- </DiagramNode>
137
+ <DiagramNode id="backend1">Backend (Region 1)</DiagramNode>
148
138
  </DiagramGroup>
149
139
  <DiagramGroup id="region2" label="Akamai Cloud - Region 2">
150
140
  <DiagramNode id="gateway2" variant="zuplo">
151
141
  Zuplo Gateway
152
142
  </DiagramNode>
153
- <DiagramNode id="backend2" variant="green">
154
- Backend (Region 2)
155
- </DiagramNode>
143
+ <DiagramNode id="backend2">Backend (Region 2)</DiagramNode>
156
144
  </DiagramGroup>
157
145
  <DiagramGroup id="region3" label="Akamai Cloud - Region 3">
158
146
  <DiagramNode id="gateway3" variant="zuplo">
159
147
  Zuplo Gateway
160
148
  </DiagramNode>
161
- <DiagramNode id="backend3" variant="green">
162
- Backend (Region 3)
163
- </DiagramNode>
149
+ <DiagramNode id="backend3">Backend (Region 3)</DiagramNode>
164
150
  </DiagramGroup>
165
151
  <DiagramEdge from="client" to="cdn" />
166
152
  <DiagramEdge from="cdn" to="gtm" fromSide="bottom" toSide="top" />
@@ -205,24 +191,16 @@ security requirements.
205
191
  </DiagramNode>
206
192
  </DiagramGroup>
207
193
  <DiagramGroup id="akamai-compute" label="Akamai Compute">
208
- <DiagramNode id="akamai-backend" variant="blue">
209
- Akamai Services
210
- </DiagramNode>
194
+ <DiagramNode id="akamai-backend">Akamai Services</DiagramNode>
211
195
  </DiagramGroup>
212
196
  <DiagramGroup id="customer-vpc" label="Customer VPC">
213
- <DiagramNode id="vpc-backend" variant="green">
214
- Private Cloud Backend
215
- </DiagramNode>
197
+ <DiagramNode id="vpc-backend">Private Cloud Backend</DiagramNode>
216
198
  </DiagramGroup>
217
199
  <DiagramGroup id="on-premise" label="On-Premise">
218
- <DiagramNode id="datacenter" variant="orange">
219
- Data Center Backend
220
- </DiagramNode>
200
+ <DiagramNode id="datacenter">Data Center Backend</DiagramNode>
221
201
  </DiagramGroup>
222
202
  <DiagramGroup id="public-cloud" label="Public Cloud">
223
- <DiagramNode id="aws" variant="yellow">
224
- AWS / GCP / Azure
225
- </DiagramNode>
203
+ <DiagramNode id="aws">AWS / GCP / Azure</DiagramNode>
226
204
  </DiagramGroup>
227
205
  <DiagramEdge from="gateway" to="akamai-backend" label="mTLS" />
228
206
  <DiagramEdge from="gateway" to="vpc-backend" label="Private Link" />
@@ -21,7 +21,7 @@ nothing except the hostname they call.
21
21
  <DiagramNode id="prod-client">Production clients</DiagramNode>
22
22
  <DiagramNode id="test-client">Test clients</DiagramNode>
23
23
  <DiagramGroup id="akamai-edge" label="Akamai property">
24
- <DiagramNode id="cdn" variant="blue">
24
+ <DiagramNode id="cdn">
25
25
  api.example.com
26
26
  <br />
27
27
  api-test.example.com
@@ -34,9 +34,9 @@ nothing except the hostname they call.
34
34
  <DiagramNode id="prod-backend">Production backend</DiagramNode>
35
35
  <DiagramNode id="test-backend">Test backend</DiagramNode>
36
36
  </DiagramGroup>
37
- <DiagramEdge from="prod-client" to="cdn" label="api.example.com" />
38
- <DiagramEdge from="test-client" to="cdn" label="api-test.example.com" />
39
- <DiagramEdge from="cdn" to="gateway" label="x-zuplo-route header" />
37
+ <DiagramEdge from="prod-client" to="cdn" label="`api.example.com`" />
38
+ <DiagramEdge from="test-client" to="cdn" label="`api-test.example.com`" />
39
+ <DiagramEdge from="cdn" to="gateway" label="`x-zuplo-route` header" />
40
40
  <DiagramEdge from="gateway" to="prod-backend" label="prod" />
41
41
  <DiagramEdge from="gateway" to="test-backend" label="test" />
42
42
  </Diagram>
@@ -105,7 +105,7 @@ instance of Zuplo and how the components interact with each other.
105
105
  </DiagramNode>
106
106
  <DiagramEdge from="client" to="gateway" />
107
107
  <DiagramEdge from="gateway" to="backend" />
108
- <DiagramEdge from="gateway" to="services" fromSide="bottom" toSide="top" />
108
+ <DiagramEdge from="gateway" to="services" />
109
109
  <DiagramEdge from="control" to="gateway" />
110
110
  </Diagram>
111
111
 
@@ -59,7 +59,7 @@ If you aren't using GitHub, or would like to set up a custom CI/CD pipeline, you
59
59
  can use the Zuplo CLI to deploy your Zuplo Gateway.
60
60
 
61
61
  ```bash
62
- npx zuplo deploy --api-key $ZUPLO_API_KEY --project your-project-name --environment my-env
62
+ npx zuplo deploy --api-key $ZUPLO_API_KEY --project your-project-name --branch my-branch
63
63
  ```
64
64
 
65
65
  For more information on setting up a CI/CD pipeline, see
@@ -79,7 +79,7 @@ const { fetch } = require("undici");
79
79
  const { randomUUID } = require("crypto");
80
80
 
81
81
  const ZUPLO_ACCOUNT = "my-zuplo-account";
82
- const API_KEY_BUCKET_ID = "bckt_2HaK3odRyJle6NJSu8mzNKBC30BYxllxL";
82
+ const API_KEY_BUCKET_ID = "bckt_YOUR_BUCKET_ID";
83
83
 
84
84
  /**
85
85
  * Handler that will be called during the execution of a PostLogin flow.
@@ -65,6 +65,29 @@ preview content and configuration changes before deployment. Zuplo manages
65
65
  hosting, and you can assign a [custom domain](../articles/custom-domains.mdx)
66
66
  such as `docs.example.com`.
67
67
 
68
+ ## Take the portal offline
69
+
70
+ To take a published portal offline, deploy the environment without a portal
71
+ configuration file. Delete the `docs/zudoku.config.*` file (for example
72
+ `docs/zudoku.config.tsx`) from the project and deploy it again.
73
+
74
+ When a deploy has no portal configuration and a previous deploy published a
75
+ portal, Zuplo unpublishes the old portal:
76
+
77
+ - Your API gateway keeps running. Only the portal goes offline.
78
+ - The portal's hostnames, including any
79
+ [custom domain](../articles/custom-domains.mdx) assigned to the portal, return
80
+ a `404`.
81
+ - The build output lists the hostnames that it unpublished, for example
82
+ `Unpublished the previous developer portal from https://my-project-main-abc123.zuplo.site`.
83
+
84
+ If Zuplo can't unpublish the portal, the build output shows a warning and the
85
+ gateway deploy still succeeds. Deploy again to retry.
86
+
87
+ Each environment has its own portal, so deploy the change to every environment
88
+ whose portal you want to take offline. To bring the portal back, add the
89
+ `docs/zudoku.config.*` file again and deploy.
90
+
68
91
  <span id="how-to-get-started" />
69
92
 
70
93
  ## Next steps
@@ -128,6 +128,6 @@ The Alert component consists of several sub-components:
128
128
  </Alert>
129
129
  ```
130
130
 
131
- # Props
131
+ ## Props
132
132
 
133
133
  <ReactComponentDoc component={Alert} />
@@ -236,6 +236,58 @@ Each URL version object requires:
236
236
  - `input`: URL to the OpenAPI document
237
237
  - `label`: Optional display name for the version selector (defaults to `path` if not provided)
238
238
 
239
+ ::if{mode=opensource}
240
+
241
+ ## Server variables
242
+
243
+ If your OpenAPI document declares
244
+ [server variables](https://spec.openapis.org/oas/v3.1.0#server-variable-object) in a server URL,
245
+ Dev Portal lets readers pick the values themselves. The API reference shows a **Server** row above the
246
+ operations. When the selected server has variables, an **Edit server variables** button appears
247
+ beside its URL. Selecting it opens a panel with the resolved URL and one field per variable, with
248
+ the variable's `description` under each field.
249
+
250
+ ```json title="openapi.json"
251
+ {
252
+ "servers": [
253
+ {
254
+ "url": "https://{sector}.relay.example.com:{port}/{basePath}",
255
+ "variables": {
256
+ "sector": {
257
+ "default": "sol",
258
+ "enum": ["sol", "alpha-centauri", "proxima"],
259
+ "description": "Star sector of the relay node"
260
+ },
261
+ "port": {
262
+ "default": "8443",
263
+ "description": "Relay port"
264
+ },
265
+ "basePath": {
266
+ "default": "v1"
267
+ }
268
+ }
269
+ }
270
+ ]
271
+ }
272
+ ```
273
+
274
+ - **Enum values:** a variable with an `enum` renders as a dropdown that offers only the listed
275
+ values.
276
+ - **Free text:** a variable without an `enum` renders as a text field that shows the `default` as
277
+ its placeholder. Clearing the field returns the variable to its `default`.
278
+ - **Remembered values:** Dev Portal stores the values in the reader's browser, so they are still there
279
+ on the next visit. Values are stored per server URL template. A stored value that is no longer in
280
+ a variable's `enum` is ignored, and the `default` applies instead.
281
+ - **Shared by server URL template:** the playground sends requests to the resolved URL, and the code
282
+ samples Dev Portal generates in the sidecar use the same values for the same server, so a generated
283
+ sample matches what the playground calls. Values are tied to the exact server URL template, not to
284
+ the variable name. An operation or path that declares a server with a different URL template keeps
285
+ its own values, and the **Server** row edits only the document's root servers.
286
+ - **Author-supplied samples:** samples you provide with `x-code-samples` are shown exactly as
287
+ written. Changing a server variable doesn't update a URL inside them.
288
+
289
+ ::
290
+
239
291
  ## Options
240
292
 
241
293
  The `options` field allows you to customize the API reference behavior:
@@ -214,3 +214,28 @@ authentication: {
214
214
  - Learn about [protecting routes](./authentication.md#protected-routes) in your documentation
215
215
  - Explore other [authentication providers](./authentication.md#authentication-providers) supported
216
216
  by Dev Portal - Configure [user permissions](./authentication.md#user-data) based on Auth0 roles
217
+
218
+ ## Auth0 with Zuplo API key management
219
+
220
+ If your Developer Portal uses
221
+ [Zuplo API key management](/docs/articles/api-key-management) so consumers can
222
+ create and manage their own keys, set `audience` in your Auth0 configuration.
223
+ Zuplo API key management requires a JWT access token. Without an `audience`,
224
+ Auth0 issues an opaque access token, and the portal can't use it to manage API
225
+ keys. When this happens, the portal shows a "Configuration Error" explaining
226
+ that the authentication provider issued an opaque token.
227
+
228
+ Create an API in Auth0 as described in the optional audience step earlier on
229
+ this page, then set `audience` to that API's identifier:
230
+
231
+ ```typescript title="docs/zudoku.config.tsx"
232
+ authentication: {
233
+ type: "auth0",
234
+ domain: "your-domain.us.auth0.com",
235
+ clientId: "<your-auth0-client-id>",
236
+ audience: "https://your-domain.com/api", // Your Auth0 API identifier
237
+ }
238
+ ```
239
+
240
+ Use the RS256 signing algorithm for the Auth0 API. If your portal doesn't use
241
+ API key management, you can still leave `audience` unset.
@@ -211,6 +211,13 @@ Azure AD provides rich user profile data through OpenID Connect:
211
211
  - `preferred_username` - User's UPN (User Principal Name)
212
212
  - Additional claims based on your API permissions
213
213
 
214
+ Entra's UserInfo endpoint is part of Microsoft Graph and only accepts access tokens issued for
215
+ Graph. If your `scopes` request a token for your own API instead, set `disableUserInfo: true` so the
216
+ profile comes from the ID token. In SSR mode the server then verifies the access token itself, so it
217
+ must be a v2.0 token for your API (`"accessTokenAcceptedVersion": 2` in the app manifest): tokens
218
+ for Graph can't be verified outside Graph. See
219
+ [Without the UserInfo Endpoint](./authentication-openid.md#without-the-userinfo-endpoint).
220
+
214
221
  ## Troubleshooting
215
222
 
216
223
  ### Common Issues
@@ -37,6 +37,7 @@ Add the `authentication` property to your [Dev Portal configuration](./overview.
37
37
  | `issuer` | Yes | The issuer URL. Dev Portal discovers endpoints from `<issuer>/.well-known/openid-configuration`. |
38
38
  | `scopes` | No | Scopes to request. Defaults to `["openid", "profile", "email"]`. |
39
39
  | `allowInsecureRequests` | No | Allow discovery and token requests against an `http://` issuer. Defaults to `false`. Intended only for local development — never enable this in production. |
40
+ | `disableUserInfo` | No | Don't call the UserInfo endpoint and build the user profile from the ID token's claims instead. Defaults to `false`. See [User Profile](#user-profile). |
40
41
 
41
42
  ## Provider Setup
42
43
 
@@ -130,6 +131,48 @@ After sign-in Dev Portal calls the provider's
130
131
  `name`, `email`, `picture`, and `email_verified` from the response. Map these claims in your
131
132
  provider if they are not emitted by default.
132
133
 
134
+ ### Without the UserInfo Endpoint
135
+
136
+ Some providers don't let a browser call the UserInfo endpoint, for example because it doesn't allow
137
+ cross-origin requests from your site. Set `disableUserInfo` to `true` and Dev Portal never calls it:
138
+
139
+ ```typescript title="zudoku.config.ts"
140
+ {
141
+ authentication: {
142
+ type: "openid",
143
+ clientId: "<your-client-id>",
144
+ issuer: "<the-issuer-url>",
145
+ disableUserInfo: true,
146
+ },
147
+ }
148
+ ```
149
+
150
+ Dev Portal also skips UserInfo when the discovery document doesn't advertise a `userinfo_endpoint`. The
151
+ option works the same way for the `entra` and `auth0` providers.
152
+
153
+ Without UserInfo, the profile is built from the claims of the ID token that the token endpoint
154
+ returns at sign-in:
155
+
156
+ - The ID token must contain `name`, `email`, `picture`, and `email_verified`. Most providers add
157
+ them for the `profile` and `email` scopes, but some only put them in the UserInfo response unless
158
+ you configure them for the ID token.
159
+ - Custom claims in the ID token, such as roles or groups, are part of the profile. Claims that
160
+ describe the token itself (`iss`, `aud`, `exp`, `nonce` and the like) are not.
161
+ - Sign-in fails if the token response contains no ID token, so keep the `openid` scope.
162
+
163
+ In [SSR mode](./protected-routes.md#server-side-protection-ssr-mode) the server checks the access
164
+ token on every request. Without UserInfo, the access token must be a JWT signed by your provider.
165
+ Dev Portal verifies it against the provider's `jwks_uri` and requires:
166
+
167
+ - the issuer's `iss` and an `exp`;
168
+ - that it was issued to your app: with `audience` set, its `aud` must match `audience`; without it,
169
+ your `clientId` must appear in `aud`, `azp`, `client_id` or `cid` (Okta). Set `audience` if your
170
+ provider puts none of these in its access tokens.
171
+
172
+ The server-side profile then comes from the access token's claims, so add `name` and `email` to it
173
+ if you show them. Opaque access tokens can't be verified this way, so the server rejects them and
174
+ the user is signed out on the next page load.
175
+
133
176
  ## Local Development with an HTTP Issuer
134
177
 
135
178
  `oauth4webapi` (the library Dev Portal uses under the hood) rejects issuers that don't use `https://` by
@@ -155,8 +198,11 @@ production issuer.
155
198
 
156
199
  - **Discovery fails**: verify `<issuer>/.well-known/openid-configuration` resolves and matches the
157
200
  `issuer` value in the document.
158
- - **CORS errors on token / userinfo**: add your site origin to the provider's allowed origins.
201
+ - **CORS errors on token / userinfo**: add your site origin to the provider's allowed origins. If
202
+ your provider can't allow browser calls to the UserInfo endpoint, set `disableUserInfo` to `true`
203
+ (see [Without the UserInfo Endpoint](#without-the-userinfo-endpoint)).
159
204
  - **Redirect URI mismatch**: the URI registered with the provider must match the Dev Portal origin
160
205
  exactly, including protocol and port.
161
206
  - **Missing profile fields**: ensure `profile` and `email` scopes are granted and that the provider
162
- includes `name`, `email`, and `picture` claims in the UserInfo response.
207
+ includes `name`, `email`, and `picture` claims in the UserInfo response, or in the ID token when
208
+ `disableUserInfo` is `true`.
@@ -217,6 +217,10 @@ fields are used to display the user profile:
217
217
 
218
218
  If the provider does not return a field, it will be left blank.
219
219
 
220
+ For the `openid`, `entra`, and `auth0` providers you can set `disableUserInfo: true` to read these
221
+ fields from the ID token instead of calling the User Info endpoint. See
222
+ [Without the UserInfo Endpoint](./authentication-openid.md#without-the-userinfo-endpoint).
223
+
220
224
  ## Redirects after sign-in
221
225
 
222
226
  By default, users return to the page they started from after signing in. For
@@ -138,6 +138,9 @@ Configuration for the prerendering process that generates static HTML pages duri
138
138
 
139
139
  - `workers`: Number of parallel workers to use for prerendering. Defaults to 80% of available CPU
140
140
  cores.
141
+ - `criticalCss`: Inline the CSS needed for each statically generated page and defer the full
142
+ stylesheet. This is opt-in because the generated inline styles require an appropriate Content
143
+ Security Policy.
141
144
 
142
145
  ```ts
143
146
  import os from "node:os";
@@ -145,6 +148,7 @@ import os from "node:os";
145
148
  export default {
146
149
  prerender: {
147
150
  workers: 4, // Fixed number of workers
151
+ criticalCss: true,
148
152
  },
149
153
  };
150
154
 
@@ -360,7 +360,7 @@ type NavigationCustomPage = {
360
360
  type: "custom-page";
361
361
  path: string;
362
362
  label?: string;
363
- element: any;
363
+ element: React.ReactNode | (() => Promise<{ default: React.ComponentType }>);
364
364
  icon?: string; // Lucide icon name
365
365
  layout?: "default" | "none";
366
366
  badge?: {
@@ -382,6 +382,20 @@ type NavigationCustomPage = {
382
382
  Set `layout: "none"` to render the page without the default Dev Portal layout (header, sidebar, footer).
383
383
  This is useful for fully custom landing pages.
384
384
 
385
+ To load the page in its own chunk, pass a function that imports a module whose default export is the
386
+ page component:
387
+
388
+ ```tsx
389
+ {
390
+ type: "custom-page",
391
+ path: "/a-custom-page",
392
+ element: () => import("./src/MyCustomPage"),
393
+ }
394
+ ```
395
+
396
+ Lazy-load pages behind [protected routes](../guides/server-side-content-protection.md) so their code
397
+ stays out of the public bundle.
398
+
385
399
  ### `type: separator`
386
400
 
387
401
  A visual divider line in the sidebar. Use separators to create visual breaks between groups of
@@ -297,6 +297,9 @@ URL.
297
297
  `from` paths can contain `:param` segments and a trailing `*` wildcard. See
298
298
  [Redirects](/dev-portal/zudoku/guides/redirects#path-parameters-and-wildcards) for details.
299
299
 
300
+ A `from` or `to` path that starts or ends with whitespace, including a non-breaking space, fails
301
+ `zudoku build`. The dev server shows a warning instead.
302
+
300
303
  ### `port`
301
304
 
302
305
  The port on which the development server will run. Defaults to `3000`. This option can also be
@@ -14,7 +14,8 @@ documentation site. This guide will show you how to create and use plugins in yo
14
14
  All plugins in Dev Portal must implement the `ZudokuPlugin` type, which is a union of these plugin
15
15
  interfaces:
16
16
 
17
- - **CommonPlugin**: Basic plugin with initialization, head elements, and MDX component customization
17
+ - **CommonPlugin**: Basic plugin with initialization, head elements, MDX component customization,
18
+ and a React provider that wraps the app
18
19
  - **ProfileMenuPlugin**: Add custom items to the profile menu
19
20
  - **NavigationPlugin**: Define custom routes and sidebar items
20
21
  - **ApiIdentityPlugin**: Provide API identities for testing
@@ -145,6 +146,42 @@ declare global {
145
146
  }
146
147
  ```
147
148
 
149
+ ### React Providers
150
+
151
+ Some libraries are set up by wrapping your app in a React context provider. Use the `Provider`
152
+ option to wrap the whole Dev Portal app with one. For example, to use
153
+ [`posthog-js`](https://posthog.com/docs/libraries/react) instead of adding a snippet with `getHead`:
154
+
155
+ ```tsx
156
+ import { PostHogProvider } from "posthog-js/react";
157
+ import type { ZudokuPlugin } from "zudoku";
158
+
159
+ const posthogPlugin: ZudokuPlugin = {
160
+ Provider: ({ children }) => (
161
+ <PostHogProvider
162
+ apiKey={import.meta.env.ZUDOKU_PUBLIC_POSTHOG_KEY}
163
+ options={{ api_host: "https://us.i.posthog.com" }}
164
+ >
165
+ {children}
166
+ </PostHogProvider>
167
+ ),
168
+ };
169
+ ```
170
+
171
+ `Provider` is a regular React component:
172
+
173
+ - It renders inside Zudoku's own providers, so it can use hooks like `useZudoku` or `useAuth` from
174
+ `zudoku/hooks`. It mounts once all plugins have finished `initialize`.
175
+ - It stays mounted when the user navigates between pages.
176
+ - If several plugins define a `Provider`, they are nested in the order of the `plugins` array, so
177
+ the first plugin's provider is the outermost one.
178
+ - It also renders during prerendering and server-side rendering. Keep browser-only code, like
179
+ accessing `window`, inside effects. Keep per-user data in component state instead of module scope,
180
+ where the server would share it between requests.
181
+
182
+ To wrap only your plugin's own routes, see
183
+ [Wrapping Routes with Context or Layout](#wrapping-routes-with-context-or-layout).
184
+
148
185
  ### Navigation Plugin
149
186
 
150
187
  ```tsx
@@ -86,8 +86,8 @@ dicts.
86
86
  | -------------------------------- | ----------------------------- | -------------- |
87
87
  | MDX docs (`plugin-docs`) | Shape B (route dict) | ✅ |
88
88
  | File OpenAPI (`plugin-api`) | Shape A (via `openApiPlugin`) | ✅ |
89
- | User custom pages with `lazy` | Shape A (`{path, lazy}`) | ✅ |
90
- | User custom pages with `element` | Not code-split | ❌ (see below) |
89
+ | Lazy custom pages | Shape A (`{path, element}`) | ✅ |
90
+ | Inline JSX custom pages | Not code-split | ❌ (see below) |
91
91
  | URL-based OpenAPI (`type: url`) | Fetched at runtime | ❌ (see below) |
92
92
  | Raw inline OpenAPI (`type: raw`) | Inlined in main bundle | ❌ (see below) |
93
93
 
@@ -103,7 +103,7 @@ not detected:
103
103
  navigation: items.map((i) => ({
104
104
  type: "custom-page",
105
105
  path: `/foo/${i.slug}`,
106
- lazy: () => import(`./Foo-${i.slug}`),
106
+ element: () => import(`./Foo-${i.slug}`),
107
107
  }));
108
108
  ```
109
109
 
@@ -117,7 +117,7 @@ them:
117
117
  items: items.map((i) => ({
118
118
  type: "custom-page",
119
119
  path: i.slug,
120
- lazy: () => import(`./Foo-${i.slug}`),
120
+ element: () => import(`./Foo-${i.slug}`),
121
121
  })),
122
122
  }
123
123
  ```
@@ -137,10 +137,10 @@ Writing
137
137
  ships `<Secret />` directly in the main bundle. There's no chunk to gate and no URL to block; the
138
138
  runtime `RouteGuard` prevents rendering but the JavaScript is already on the user's machine.
139
139
 
140
- **Fix:** switch to `lazy`:
140
+ **Fix:** lazy-load it:
141
141
 
142
142
  ```ts
143
- { type: "custom-page", path: "/secret", lazy: () => import("./Secret") }
143
+ { type: "custom-page", path: "/secret", element: () => import("./Secret") }
144
144
  ```
145
145
 
146
146
  ### URL-based OpenAPI specs
@@ -197,7 +197,7 @@ server-side, use an SSR adapter.
197
197
  ## Pre-ship checklist
198
198
 
199
199
  - [ ] Build passes (any unmatched `protectedRoutes` pattern fails the build).
200
- - [ ] Any custom pages meant to be protected use `lazy: () => import(...)`, not `element`.
200
+ - [ ] Any custom pages meant to be protected use `element: () => import(...)`, not inline JSX.
201
201
  - [ ] Any dynamically-generated protected routes are nested under a static-path ancestor.
202
202
  - [ ] URL-based and raw inline OpenAPI specs have their own access control at their origin.
203
203
  - [ ] Visit a protected chunk URL directly in an unauthenticated browser (grab one from DevTools)