@zitadel/sdk-svelte 0.1.0-alpha.17 → 0.1.0-alpha.19

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.
package/README.md CHANGED
@@ -23,32 +23,21 @@ TypeScript ≥ 5.0 — the published type definitions re-export with `export typ
23
23
 
24
24
  `<ZitadelLogout {project} postSignOutUrl="/login" />` works the same way.
25
25
 
26
+ The signed-in session card is `<ZitadelSession {project} />` (exported as `ZitadelSession`).
27
+
26
28
  The widget's flow events are also surfaced as optional callbacks:
27
29
  `onFlowStep`, `onFlowInput`, `onFlowComplete`, and `onFlowError`.
28
30
 
29
31
  ## Proxying to the backend (deployment)
30
32
 
31
- The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`). A SPA has no
32
- server, so on Vercel use `@zitadel/edge-proxy` to forward those calls:
33
-
34
- ```ts
35
- // api/__nextgen/[...path].ts (Vercel Edge Function)
36
- import { handleProxy, resolveConfig } from '@zitadel/edge-proxy';
37
- export const config = { runtime: 'edge' };
38
- const proxyConfig = resolveConfig({
39
- apiUrl: process.env.NEXTGEN_API_URL ?? '',
40
- });
41
- export default (req: Request) => handleProxy(req, proxyConfig);
42
- ```
43
-
44
- ```json
45
- // vercel.json
46
- {
47
- "rewrites": [
48
- { "source": "/__nextgen/(.*)", "destination": "/api/__nextgen/$1" }
49
- ]
50
- }
51
- ```
52
-
53
- For local development you can skip the proxy and point `proxyPath` straight at the
54
- backend (cross-origin), e.g. `proxyPath: "http://localhost:4000"`.
33
+ The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`). In
34
+ production the same-origin path must come from your hosting platform — until
35
+ the CLI can scaffold those configs, **production SPA deployment is not yet
36
+ supported**; see
37
+ [ADR 036](https://github.com/zitadel/nextgen/blob/main/docs/adrs/036-api-credential-planes.md)
38
+ and [zitadel/nextgen#560](https://github.com/zitadel/nextgen/issues/560). The
39
+ CLI dev proxy covers local development.
40
+
41
+ For local development you can also skip the proxy and point `proxyPath`
42
+ straight at the backend (cross-origin), e.g. `proxyPath: "http://localhost:8080"`
43
+ (the `zitadel start` local runtime default port).
package/dist/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export { default as ZitadelSession } from "./ZitadelSession.svelte";
4
4
  export { configureZitadel, getApi, getZitadelConfig } from "@zitadel/api/config";
5
5
  export type { ZitadelConfig, ZitadelProject } from "@zitadel/api/config";
6
6
  export * from "./types";
7
+ export { businessLocales } from "@zitadel/components";
package/dist/index.js CHANGED
@@ -1,69 +1,70 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as e from "svelte/internal/client";
3
- import "@zitadel/components";
4
- import { configureZitadel as x, getApi as S, getZitadelConfig as y } from "@zitadel/api/config";
3
+ import { businessLocales as j } from "@zitadel/components";
4
+ import { configureZitadel as S, getApi as b, getZitadelConfig as y } from "@zitadel/api/config";
5
5
  var f = e.from_html("<zitadel-login></zitadel-login>", 2);
6
- function h(_, t) {
6
+ function h(i, t) {
7
7
  e.push(t, !0);
8
- let l = e.prop(t, "purpose", 3, "login"), i = e.state(void 0);
9
- function d() {
10
- return e.get(i);
8
+ let o = e.prop(t, "purpose", 3, "login"), _ = e.state(void 0);
9
+ function r() {
10
+ return e.get(_);
11
11
  }
12
12
  e.user_effect(() => {
13
- const a = e.get(i);
14
- if (!a)
13
+ const l = e.get(_);
14
+ if (!l)
15
15
  return;
16
- const s = (r) => t.onFlowStep?.(r.detail), m = (r) => t.onFlowInput?.(r.detail), u = (r) => t.onFlowComplete?.(r.detail), c = (r) => t.onFlowError?.(r.detail);
17
- return a.addEventListener("zitadel-flow-step", s), a.addEventListener("zitadel-flow-input", m), a.addEventListener("zitadel-flow-complete", u), a.addEventListener("zitadel-flow-error", c), () => {
18
- a.removeEventListener("zitadel-flow-step", s), a.removeEventListener("zitadel-flow-input", m), a.removeEventListener("zitadel-flow-complete", u), a.removeEventListener("zitadel-flow-error", c);
16
+ const m = (s) => t.onFlowStep?.(s.detail), d = (s) => t.onFlowInput?.(s.detail), c = (s) => t.onFlowComplete?.(s.detail), u = (s) => t.onFlowError?.(s.detail);
17
+ return l.addEventListener("zitadel-flow-step", m), l.addEventListener("zitadel-flow-input", d), l.addEventListener("zitadel-flow-complete", c), l.addEventListener("zitadel-flow-error", u), () => {
18
+ l.removeEventListener("zitadel-flow-step", m), l.removeEventListener("zitadel-flow-input", d), l.removeEventListener("zitadel-flow-complete", c), l.removeEventListener("zitadel-flow-error", u);
19
19
  };
20
20
  });
21
- var n = { getElement: d }, o = f();
22
- return e.template_effect(() => e.set_custom_element_data(o, "project", t.project)), e.template_effect(() => e.set_custom_element_data(o, "purpose", l())), e.template_effect(() => e.set_custom_element_data(o, "locales", t.locales)), e.template_effect(() => e.set_custom_element_data(o, "lang", t.lang)), e.template_effect(() => e.set_custom_element_data(o, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(o, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(o, "post-sign-in-url", t.postSignInUrl)), e.template_effect(() => e.set_custom_element_data(o, "flow-name", t.flowName)), e.bind_this(o, (a) => e.set(i, a), () => e.get(i)), e.append(_, o), e.pop(n);
21
+ var n = { getElement: r }, a = f();
22
+ return e.template_effect(() => e.set_custom_element_data(a, "project", t.project)), e.template_effect(() => e.set_custom_element_data(a, "purpose", o())), e.template_effect(() => e.set_custom_element_data(a, "locales", t.locales)), e.template_effect(() => e.set_custom_element_data(a, "lang", t.lang)), e.template_effect(() => e.set_custom_element_data(a, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(a, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(a, "post-sign-in-url", t.postSignInUrl)), e.template_effect(() => e.set_custom_element_data(a, "flow-name", t.flowName)), e.template_effect(() => e.set_custom_element_data(a, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(a, "theme", t.theme)), e.template_effect(() => e.set_custom_element_data(a, "suppressHeader", t.suppressHeader)), e.bind_this(a, (l) => e.set(_, l), () => e.get(_)), e.append(i, a), e.pop(n);
23
23
  }
24
24
  var g = e.from_html("<zitadel-logout></zitadel-logout>", 2);
25
- function E(_, t) {
25
+ function z(i, t) {
26
26
  e.push(t, !0);
27
- let l = e.state(void 0);
28
- function i() {
29
- return e.get(l);
27
+ let o = e.state(void 0);
28
+ function _() {
29
+ return e.get(o);
30
30
  }
31
31
  e.user_effect(() => {
32
- const o = e.get(l);
33
- if (!o)
32
+ const a = e.get(o);
33
+ if (!a)
34
34
  return;
35
- const a = (s) => t.onSignout?.(s.detail);
36
- return o.addEventListener("zitadel-signout", a), () => {
37
- o.removeEventListener("zitadel-signout", a);
35
+ const l = (m) => t.onSignout?.(m.detail);
36
+ return a.addEventListener("zitadel-signout", l), () => {
37
+ a.removeEventListener("zitadel-signout", l);
38
38
  };
39
39
  });
40
- var d = { getElement: i }, n = g();
41
- return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.bind_this(n, (o) => e.set(l, o), () => e.get(l)), e.append(_, n), e.pop(d);
40
+ var r = { getElement: _ }, n = g();
41
+ return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(o, a), () => e.get(o)), e.append(i, n), e.pop(r);
42
42
  }
43
43
  var p = e.from_html("<zitadel-session></zitadel-session>", 2);
44
- function L(_, t) {
44
+ function E(i, t) {
45
45
  e.push(t, !0);
46
- let l = e.state(void 0);
47
- function i() {
48
- return e.get(l);
46
+ let o = e.state(void 0);
47
+ function _() {
48
+ return e.get(o);
49
49
  }
50
50
  e.user_effect(() => {
51
- const o = e.get(l);
52
- if (!o)
51
+ const a = e.get(o);
52
+ if (!a)
53
53
  return;
54
- const a = (s) => t.onSignout?.(s.detail);
55
- return o.addEventListener("zitadel-signout", a), () => {
56
- o.removeEventListener("zitadel-signout", a);
54
+ const l = (m) => t.onSignout?.(m.detail);
55
+ return a.addEventListener("zitadel-signout", l), () => {
56
+ a.removeEventListener("zitadel-signout", l);
57
57
  };
58
58
  });
59
- var d = { getElement: i }, n = p();
60
- return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "heading", t.heading)), e.template_effect(() => e.set_custom_element_data(n, "logout-label", t.logoutLabel)), e.bind_this(n, (o) => e.set(l, o), () => e.get(l)), e.append(_, n), e.pop(d);
59
+ var r = { getElement: _ }, n = p();
60
+ return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "heading", t.heading)), e.template_effect(() => e.set_custom_element_data(n, "logout-label", t.logoutLabel)), e.template_effect(() => e.set_custom_element_data(n, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.template_effect(() => e.set_custom_element_data(n, "suppressHeader", t.suppressHeader)), e.bind_this(n, (a) => e.set(o, a), () => e.get(o)), e.append(i, n), e.pop(r);
61
61
  }
62
62
  export {
63
63
  h as ZitadelLogin,
64
- E as ZitadelLogout,
65
- L as ZitadelSession,
66
- x as configureZitadel,
67
- S as getApi,
64
+ z as ZitadelLogout,
65
+ E as ZitadelSession,
66
+ j as businessLocales,
67
+ S as configureZitadel,
68
+ b as getApi,
68
69
  y as getZitadelConfig
69
70
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zitadel/sdk-svelte",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.19",
4
4
  "description": "Svelte components for the Zitadel auth UI (client-side SPA).",
5
5
  "homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-svelte#readme",
6
6
  "bugs": {
@@ -29,9 +29,9 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@zitadel/components": "0.1.0-alpha.17",
33
- "@zitadel/api": "0.1.0-alpha.17",
34
- "@zitadel/sdk-core": "0.1.0-alpha.17"
32
+ "@zitadel/sdk-core": "0.1.0-alpha.19",
33
+ "@zitadel/api": "0.1.0-alpha.19",
34
+ "@zitadel/components": "0.1.0-alpha.19"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "svelte": "^5.0.0"