@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 +13 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -39
- package/package.json +4 -4
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`).
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
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(
|
|
6
|
+
function h(i, t) {
|
|
7
7
|
e.push(t, !0);
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
return e.get(
|
|
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
|
|
14
|
-
if (!
|
|
13
|
+
const l = e.get(_);
|
|
14
|
+
if (!l)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
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:
|
|
22
|
-
return e.template_effect(() => e.set_custom_element_data(
|
|
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
|
|
25
|
+
function z(i, t) {
|
|
26
26
|
e.push(t, !0);
|
|
27
|
-
let
|
|
28
|
-
function
|
|
29
|
-
return e.get(
|
|
27
|
+
let o = e.state(void 0);
|
|
28
|
+
function _() {
|
|
29
|
+
return e.get(o);
|
|
30
30
|
}
|
|
31
31
|
e.user_effect(() => {
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
32
|
+
const a = e.get(o);
|
|
33
|
+
if (!a)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
|
|
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
|
|
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, (
|
|
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
|
|
44
|
+
function E(i, t) {
|
|
45
45
|
e.push(t, !0);
|
|
46
|
-
let
|
|
47
|
-
function
|
|
48
|
-
return e.get(
|
|
46
|
+
let o = e.state(void 0);
|
|
47
|
+
function _() {
|
|
48
|
+
return e.get(o);
|
|
49
49
|
}
|
|
50
50
|
e.user_effect(() => {
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
const a = e.get(o);
|
|
52
|
+
if (!a)
|
|
53
53
|
return;
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
|
|
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
|
|
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, (
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
S as
|
|
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.
|
|
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/
|
|
33
|
-
"@zitadel/api": "0.1.0-alpha.
|
|
34
|
-
"@zitadel/
|
|
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"
|