@zitadel/sdk-svelte 0.1.0-alpha.16 → 0.1.0-alpha.18

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
@@ -29,26 +29,14 @@ The widget's flow events are also surfaced as optional callbacks:
29
29
  ## Proxying to the backend (deployment)
30
30
 
31
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
- ```
32
+ server, so in production the path comes from your hosting platform — a
33
+ `vercel.json` rewrite, a `netlify.toml` redirect, or a minimal Cloudflare
34
+ worker — with no secrets on the platform, per
35
+ [ADR 036](https://github.com/zitadel/nextgen/blob/main/docs/adrs/036-api-credential-planes.md).
36
+ CLI scaffolding for these configs is tracked in
37
+ [zitadel/nextgen#560](https://github.com/zitadel/nextgen/issues/560). **Until
38
+ that work lands, production SPA deployment is not yet supported** — the CLI dev
39
+ proxy covers local development.
52
40
 
53
41
  For local development you can skip the proxy and point `proxyPath` straight at the
54
42
  backend (cross-origin), e.g. `proxyPath: "http://localhost:4000"`.
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(s, t) {
7
7
  e.push(t, !0);
8
8
  let l = e.prop(t, "purpose", 3, "login"), i = e.state(void 0);
9
- function d() {
9
+ function r() {
10
10
  return e.get(i);
11
11
  }
12
12
  e.user_effect(() => {
13
- const a = e.get(i);
14
- if (!a)
13
+ const o = e.get(i);
14
+ if (!o)
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 = (_) => t.onFlowStep?.(_.detail), d = (_) => t.onFlowInput?.(_.detail), c = (_) => t.onFlowComplete?.(_.detail), u = (_) => t.onFlowError?.(_.detail);
17
+ return o.addEventListener("zitadel-flow-step", m), o.addEventListener("zitadel-flow-input", d), o.addEventListener("zitadel-flow-complete", c), o.addEventListener("zitadel-flow-error", u), () => {
18
+ o.removeEventListener("zitadel-flow-step", m), o.removeEventListener("zitadel-flow-input", d), o.removeEventListener("zitadel-flow-complete", c), o.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", l())), 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.bind_this(a, (o) => e.set(i, o), () => e.get(i)), e.append(s, 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(s, t) {
26
26
  e.push(t, !0);
27
27
  let l = e.state(void 0);
28
28
  function i() {
29
29
  return e.get(l);
30
30
  }
31
31
  e.user_effect(() => {
32
- const o = e.get(l);
33
- if (!o)
32
+ const a = e.get(l);
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 o = (m) => t.onSignout?.(m.detail);
36
+ return a.addEventListener("zitadel-signout", o), () => {
37
+ a.removeEventListener("zitadel-signout", o);
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: 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.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(l, a), () => e.get(l)), e.append(s, 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(s, t) {
45
45
  e.push(t, !0);
46
46
  let l = e.state(void 0);
47
47
  function i() {
48
48
  return e.get(l);
49
49
  }
50
50
  e.user_effect(() => {
51
- const o = e.get(l);
52
- if (!o)
51
+ const a = e.get(l);
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 o = (m) => t.onSignout?.(m.detail);
55
+ return a.addEventListener("zitadel-signout", o), () => {
56
+ a.removeEventListener("zitadel-signout", o);
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: 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.template_effect(() => e.set_custom_element_data(n, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(l, a), () => e.get(l)), e.append(s, 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.16",
3
+ "version": "0.1.0-alpha.18",
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/api": "0.1.0-alpha.16",
33
- "@zitadel/components": "0.1.0-alpha.16",
34
- "@zitadel/sdk-core": "0.1.0-alpha.16"
32
+ "@zitadel/components": "0.1.0-alpha.18",
33
+ "@zitadel/api": "0.1.0-alpha.18",
34
+ "@zitadel/sdk-core": "0.1.0-alpha.18"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "svelte": "^5.0.0"