Skip to content

Commit d9607d1

Browse files
authored
docs: point SPA production guidance at ADR 036 instead of @zitadel/edge-proxy (#561)
## Summary <!-- Briefly describe what changed and why. --> - W0 item of #560. ADR 036 (#552) decided against the `@zitadel/edge-proxy` package and #56 is closed — but main still documented that package as the SPA production path in three places: the six framework patcher docs/READMEs, the six SDK package READMEs (including `import { handleProxy } from '@zitadel/edge-proxy'` examples for a package that does not exist on npm), and the docs site. - All of it now points at the decided model: the same-origin `/__nextgen` path comes from a platform rewrite (`vercel.json` / `netlify.toml`) or a minimal Cloudflare worker, combined with the publishable key from ADR 036 — no secrets in platform env stores. Every touched passage links ADR 036 and the tracking issue #560, and states that until that work lands the dev proxy covers local development only. - `concepts/sdk-proxy.mdx` gains an "SPAs in production" section (the SDK pages' "how to run one in production" links previously pointed at a page that never said). - Patch changeset for the six SDK packages so the corrected READMEs actually reach npm on the next train. ## Validation <!-- List exact commands run. If validation was not run, say so explicitly. --> - `grep -rn "edge-proxy" apps/cli/src packages/sdk-*/README.md apps/docs/content` — zero matches after the change. - Prose-only change; no build or test commands run. ## Release notes / changeset - Changeset: `.changeset/sdk-readme-adr036-docs.md` — patch for the six SPA SDK packages (published README content changed; no shipped behavior changed). ## Notes <!-- Add reviewer context, follow-ups, risks, or "None". --> - Deliberately does **not** promise a working production path today — wording says "tracked in #560" because until the publishable-key work lands, a plain rewrite would still 401 on the handoff exchange. - The dev-proxy credential statements now reflect #719's interim hardening (secret attached only on `POST /sessions/exchange`, recorded as an implementation note in ADR 036); full removal from the SPA path remains W3c of #560.
1 parent 05336eb commit d9607d1

22 files changed

Lines changed: 103 additions & 130 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@zitadel/sdk-react": patch
3+
"@zitadel/sdk-vue": patch
4+
"@zitadel/sdk-angular": patch
5+
"@zitadel/sdk-solid": patch
6+
"@zitadel/sdk-svelte": patch
7+
"@zitadel/sdk-qwik": patch
8+
---
9+
10+
docs: replace `@zitadel/edge-proxy` production guidance in the package READMEs with the ADR 036 model — platform rewrites/minimal worker plus a publishable key, no secrets on the platform (scaffolding tracked in zitadel/nextgen#560)

apps/cli/src/lib/orca/patchers/rule/angular/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ Integrates Zitadel auth into an Angular app.
1515
The SDK widgets call `/__nextgen/*` same-origin. In dev, `proxy.conf.cjs`
1616
forwards those to the backend and attaches the project service-key secret (read
1717
from `ZITADEL_PROJECT_SECRET` in `.env.local`) only to `POST /sessions/exchange`.
18-
Production needs `@zitadel/edge-proxy` in front.
18+
The production story is a platform rewrite plus the publishable key from ADR 036
19+
(`docs/adrs/036-api-credential-planes.md`), tracked in issue #560.

apps/cli/src/lib/orca/patchers/rule/angular/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ function ensureDevScript(source: string | undefined): string {
4848
*
4949
* Unlike React/Vue (whose dev proxy lives in `vite.config.ts`), Angular owns its
5050
* Vite config, so the proxy is a separate `proxy.conf.cjs` referenced from the
51-
* `serve` target. Production still needs `@zitadel/edge-proxy`.
51+
* `serve` target. In production the same-origin path comes from a platform
52+
* rewrite or minimal worker (ADR 036); CLI scaffolding for it is tracked in
53+
* issue #560.
5254
*/
5355
export class AngularPatcher extends AbstractRulePatcher {
5456
canPatch(framework: string): boolean {

apps/cli/src/lib/orca/patchers/rule/qwik/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ Integrates Zitadel auth into a Vite + Qwik single-page app.
1919

2020
The SDK widgets call `/__nextgen/*` same-origin. In dev, the Vite proxy forwards
2121
those to the backend and attaches the project service-key secret (read from
22-
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. Production needs
23-
`@zitadel/edge-proxy` in front.
22+
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. The production
23+
story is a platform rewrite plus the publishable key from ADR 036
24+
(`docs/adrs/036-api-credential-planes.md`), tracked in issue #560.

apps/cli/src/lib/orca/patchers/rule/qwik/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ const SDK_DEPENDENCY = "@zitadel/sdk-qwik";
1818
* The create-vite Qwik template uses a lowercase `src/app.tsx` exporting a named
1919
* `App` (mounted by `main.tsx`), so this patcher writes that exact entry. Unlike
2020
* Next.js — whose middleware runs the proxy server-side — a SPA has no server,
21-
* so the dev proxy stands in for `@zitadel/edge-proxy` locally. Production
22-
* deployments still need that proxy.
21+
* so the dev proxy provides the same-origin `/__nextgen` path locally. In
22+
* production that path comes from a platform rewrite or minimal worker
23+
* (ADR 036); CLI scaffolding for it is tracked in issue #560.
2324
*/
2425
export class QwikPatcher extends AbstractRulePatcher implements ViteSupport {
2526
canPatch(framework: string): boolean {

apps/cli/src/lib/orca/patchers/rule/react/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Integrates Zitadel auth into a Vite + React single-page app.
1717

1818
The SDK widgets call `/__nextgen/*` same-origin. In dev, the Vite proxy forwards
1919
those to the backend and attaches the project service-key secret (read from
20-
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. Production needs
21-
`@zitadel/edge-proxy` in front.
20+
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. The production
21+
story is a platform rewrite plus the publishable key from ADR 036
22+
(`docs/adrs/036-api-credential-planes.md`), tracked in issue #560.

apps/cli/src/lib/orca/patchers/rule/react/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ const SDK_DEPENDENCY = "@zitadel/sdk-react";
1616
* project id, and the SDK dep.
1717
*
1818
* Unlike Next.js — whose middleware runs the proxy and token exchange
19-
* server-side — a SPA has no server, so the dev proxy stands in for
20-
* `@zitadel/edge-proxy` locally. Production deployments still need that proxy.
19+
* server-side — a SPA has no server, so the dev proxy provides the same-origin
20+
* `/__nextgen` path locally. In production that path comes from a platform
21+
* rewrite or minimal worker (ADR 036); CLI scaffolding for it is tracked in
22+
* issue #560.
2123
*/
2224
export class ReactPatcher extends AbstractRulePatcher implements ViteSupport {
2325
canPatch(framework: string): boolean {

apps/cli/src/lib/orca/patchers/rule/solid/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Integrates Zitadel auth into a Vite + Solid single-page app.
1717

1818
The SDK widgets call `/__nextgen/*` same-origin. In dev, the Vite proxy forwards
1919
those to the backend and attaches the project service-key secret (read from
20-
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. Production needs
21-
`@zitadel/edge-proxy` in front.
20+
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. The production
21+
story is a platform rewrite plus the publishable key from ADR 036
22+
(`docs/adrs/036-api-credential-planes.md`), tracked in issue #560.

apps/cli/src/lib/orca/patchers/rule/solid/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ const SDK_DEPENDENCY = "@zitadel/sdk-solid";
1616
* project id, and the SDK dep.
1717
*
1818
* Unlike Next.js — whose middleware runs the proxy and token exchange
19-
* server-side — a SPA has no server, so the dev proxy stands in for
20-
* `@zitadel/edge-proxy` locally. Production deployments still need that proxy.
19+
* server-side — a SPA has no server, so the dev proxy provides the same-origin
20+
* `/__nextgen` path locally. In production that path comes from a platform
21+
* rewrite or minimal worker (ADR 036); CLI scaffolding for it is tracked in
22+
* issue #560.
2123
*/
2224
export class SolidPatcher extends AbstractRulePatcher implements ViteSupport {
2325
canPatch(framework: string): boolean {

apps/cli/src/lib/orca/patchers/rule/svelte/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Integrates Zitadel auth into a Vite + Svelte single-page app.
1717

1818
The SDK widgets call `/__nextgen/*` same-origin. In dev, the Vite proxy forwards
1919
those to the backend and attaches the project service-key secret (read from
20-
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. Production needs
21-
`@zitadel/edge-proxy` in front.
20+
`ZITADEL_PROJECT_SECRET`) only to `POST /sessions/exchange`. The production
21+
story is a platform rewrite plus the publishable key from ADR 036
22+
(`docs/adrs/036-api-credential-planes.md`), tracked in issue #560.

0 commit comments

Comments
 (0)