@zitadel/sdk-angular 0.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ZITADEL
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @zitadel/sdk-angular
2
+
3
+ Angular components for the Zitadel auth UI, for client-side SPAs.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import { Component } from '@angular/core';
9
+ import { ZitadelLoginComponent, configureZitadel } from '@zitadel/sdk-angular';
10
+
11
+ const project = configureZitadel({ projectId: '…', proxyPath: '/__nextgen' });
12
+
13
+ @Component({
14
+ standalone: true,
15
+ imports: [ZitadelLoginComponent],
16
+ template: `<zitadel-auth-login
17
+ [project]="project"
18
+ purpose="login"
19
+ postSignInUrl="/"
20
+ />`,
21
+ })
22
+ export class LoginPage {
23
+ project = project;
24
+ }
25
+ ```
26
+
27
+ `<zitadel-auth-logout [project]="project" postSignOutUrl="/login" />` works the same way.
28
+
29
+ > The wrapper uses the selector `zitadel-auth-login` (not `zitadel-login`) because
30
+ > the latter is the underlying custom element the component renders internally.
31
+
32
+ ## Proxying to the backend (deployment)
33
+
34
+ The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`). On Vercel use
35
+ `@zitadel/edge-proxy` to forward those calls (see the React/Vue READMEs for the
36
+ `vercel.json` rewrite + edge function). Locally you can point `proxyPath` straight at
37
+ the backend (cross-origin), e.g. `proxyPath: "http://localhost:4000"`.
@@ -0,0 +1,112 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
3
+ import '@zitadel/components';
4
+
5
+ /**
6
+ * Angular wrapper for the `<zitadel-login>` Lit web component.
7
+ *
8
+ * Uses a distinct selector (`zitadel-auth-login`) and renders the real custom
9
+ * element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle
10
+ * (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`;
11
+ * `purpose` / `post-sign-in-url` are bound as attributes the Lit element reads.
12
+ *
13
+ * ```html
14
+ * <zitadel-auth-login [project]="project" purpose="login" postSignInUrl="/" />
15
+ * ```
16
+ */
17
+ class ZitadelLoginComponent {
18
+ project;
19
+ purpose = 'login';
20
+ postSignInUrl;
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: ZitadelLoginComponent, isStandalone: true, selector: "zitadel-auth-login", inputs: { project: "project", purpose: "purpose", postSignInUrl: "postSignInUrl" }, ngImport: i0, template: `<zitadel-login
23
+ [project]="project"
24
+ [attr.purpose]="purpose"
25
+ [attr.post-sign-in-url]="postSignInUrl"
26
+ ></zitadel-login>`, isInline: true });
27
+ }
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLoginComponent, decorators: [{
29
+ type: Component,
30
+ args: [{
31
+ selector: 'zitadel-auth-login',
32
+ standalone: true,
33
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
34
+ template: `<zitadel-login
35
+ [project]="project"
36
+ [attr.purpose]="purpose"
37
+ [attr.post-sign-in-url]="postSignInUrl"
38
+ ></zitadel-login>`,
39
+ }]
40
+ }], propDecorators: { project: [{
41
+ type: Input
42
+ }], purpose: [{
43
+ type: Input
44
+ }], postSignInUrl: [{
45
+ type: Input
46
+ }] } });
47
+
48
+ /**
49
+ * Angular wrapper for the `<zitadel-logout>` Lit web component. See
50
+ * {@link ZitadelLoginComponent} for the strategy.
51
+ *
52
+ * ```html
53
+ * <zitadel-auth-logout [project]="project" postSignOutUrl="/login" />
54
+ * ```
55
+ */
56
+ class ZitadelLogoutComponent {
57
+ project;
58
+ postSignOutUrl;
59
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLogoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
60
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: ZitadelLogoutComponent, isStandalone: true, selector: "zitadel-auth-logout", inputs: { project: "project", postSignOutUrl: "postSignOutUrl" }, ngImport: i0, template: `<zitadel-logout
61
+ [project]="project"
62
+ [attr.post-sign-out-url]="postSignOutUrl"
63
+ ></zitadel-logout>`, isInline: true });
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLogoutComponent, decorators: [{
66
+ type: Component,
67
+ args: [{
68
+ selector: 'zitadel-auth-logout',
69
+ standalone: true,
70
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
71
+ template: `<zitadel-logout
72
+ [project]="project"
73
+ [attr.post-sign-out-url]="postSignOutUrl"
74
+ ></zitadel-logout>`,
75
+ }]
76
+ }], propDecorators: { project: [{
77
+ type: Input
78
+ }], postSignOutUrl: [{
79
+ type: Input
80
+ }] } });
81
+
82
+ /**
83
+ * SDK configuration for the Angular wrapper.
84
+ *
85
+ * `@zitadel/api` is published with subpath-only `exports` and no main entry,
86
+ * which ng-packagr's module resolution cannot follow. For the client-side SPA
87
+ * (prop-based) flow the widget only needs a plain handle — `{ projectId,
88
+ * proxyPath }` — which it reads directly. So this package builds that handle
89
+ * locally rather than importing `configureZitadel` from `@zitadel/api`, keeping
90
+ * the Angular library self-contained.
91
+ */
92
+ /**
93
+ * Builds the project handle to pass to `<zitadel-auth-login [project]>`.
94
+ *
95
+ * ```ts
96
+ * const project = configureZitadel({ projectId: "…", proxyPath: "/__nextgen" });
97
+ * ```
98
+ */
99
+ function configureZitadel(config) {
100
+ return Object.freeze({
101
+ proxyPath: config.proxyPath ?? '/__nextgen',
102
+ projectId: config.projectId,
103
+ url: config.url,
104
+ });
105
+ }
106
+
107
+ /**
108
+ * Generated bundle index. Do not edit.
109
+ */
110
+
111
+ export { ZitadelLoginComponent, ZitadelLogoutComponent, configureZitadel };
112
+ //# sourceMappingURL=zitadel-sdk-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zitadel-sdk-angular.mjs","sources":["../../src/lib/zitadel-login.component.ts","../../src/lib/zitadel-logout.component.ts","../../src/lib/config.ts","../../src/zitadel-sdk-angular.ts"],"sourcesContent":["import { Component, Input, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n\nimport type { ZitadelProject } from './config';\n\n// Registers <zitadel-login> / <zitadel-logout> with the browser.\nimport '@zitadel/components';\n\n/**\n * Angular wrapper for the `<zitadel-login>` Lit web component.\n *\n * Uses a distinct selector (`zitadel-auth-login`) and renders the real custom\n * element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle\n * (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`;\n * `purpose` / `post-sign-in-url` are bound as attributes the Lit element reads.\n *\n * ```html\n * <zitadel-auth-login [project]=\"project\" purpose=\"login\" postSignInUrl=\"/\" />\n * ```\n */\n@Component({\n selector: 'zitadel-auth-login',\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `<zitadel-login\n [project]=\"project\"\n [attr.purpose]=\"purpose\"\n [attr.post-sign-in-url]=\"postSignInUrl\"\n ></zitadel-login>`,\n})\nexport class ZitadelLoginComponent {\n @Input() project?: ZitadelProject;\n @Input() purpose = 'login';\n @Input() postSignInUrl?: string;\n}\n","import { Component, Input, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n\nimport type { ZitadelProject } from './config';\n\nimport '@zitadel/components';\n\n/**\n * Angular wrapper for the `<zitadel-logout>` Lit web component. See\n * {@link ZitadelLoginComponent} for the strategy.\n *\n * ```html\n * <zitadel-auth-logout [project]=\"project\" postSignOutUrl=\"/login\" />\n * ```\n */\n@Component({\n selector: 'zitadel-auth-logout',\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `<zitadel-logout\n [project]=\"project\"\n [attr.post-sign-out-url]=\"postSignOutUrl\"\n ></zitadel-logout>`,\n})\nexport class ZitadelLogoutComponent {\n @Input() project?: ZitadelProject;\n @Input() postSignOutUrl?: string;\n}\n","/**\n * SDK configuration for the Angular wrapper.\n *\n * `@zitadel/api` is published with subpath-only `exports` and no main entry,\n * which ng-packagr's module resolution cannot follow. For the client-side SPA\n * (prop-based) flow the widget only needs a plain handle — `{ projectId,\n * proxyPath }` — which it reads directly. So this package builds that handle\n * locally rather than importing `configureZitadel` from `@zitadel/api`, keeping\n * the Angular library self-contained.\n */\n\n/** Frozen project handle passed to the widgets via the `project` input. */\nexport interface ZitadelProject {\n readonly proxyPath: string;\n readonly projectId: string;\n readonly url?: string;\n}\n\n/** Input options for {@link configureZitadel}. */\nexport interface ZitadelConfig {\n /** Proxy path for API requests. Defaults to `\"/__nextgen\"`. */\n proxyPath?: string;\n /** Project id passed to flow creation. */\n projectId: string;\n /** Full backend URL (server-side only; optional for client SPAs). */\n url?: string;\n}\n\n/**\n * Builds the project handle to pass to `<zitadel-auth-login [project]>`.\n *\n * ```ts\n * const project = configureZitadel({ projectId: \"…\", proxyPath: \"/__nextgen\" });\n * ```\n */\nexport function configureZitadel(config: ZitadelConfig): ZitadelProject {\n return Object.freeze({\n proxyPath: config.proxyPath ?? '/__nextgen',\n projectId: config.projectId,\n url: config.url,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAOA;;;;;;;;;;;AAWG;MAWU,qBAAqB,CAAA;AACvB,IAAA,OAAO;IACP,OAAO,GAAG,OAAO;AACjB,IAAA,aAAa;uGAHX,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EANtB,CAAA;;;;AAIQ,mBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAVjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE,CAAA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
+ "version": "0.0.0",
4
+ "description": "Angular components for the Zitadel auth UI (client-side SPA).",
5
+ "homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-angular#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/zitadel/nextgen/issues"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/zitadel/nextgen.git",
13
+ "directory": "packages/sdk-angular"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "directory": "dist"
18
+ },
19
+ "dependencies": {
20
+ "tslib": "^2.6.0",
21
+ "@zitadel/api": "0.1.0-alpha.0",
22
+ "@zitadel/components": "0.1.0-alpha.0"
23
+ },
24
+ "peerDependencies": {
25
+ "@angular/common": ">=17",
26
+ "@angular/core": ">=17"
27
+ },
28
+ "module": "fesm2022/zitadel-sdk-angular.mjs",
29
+ "typings": "types/zitadel-sdk-angular.d.ts",
30
+ "exports": {
31
+ "./package.json": {
32
+ "default": "./package.json"
33
+ },
34
+ ".": {
35
+ "types": "./types/zitadel-sdk-angular.d.ts",
36
+ "default": "./fesm2022/zitadel-sdk-angular.mjs"
37
+ }
38
+ },
39
+ "sideEffects": false,
40
+ "type": "module"
41
+ }
@@ -0,0 +1,73 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ /**
4
+ * SDK configuration for the Angular wrapper.
5
+ *
6
+ * `@zitadel/api` is published with subpath-only `exports` and no main entry,
7
+ * which ng-packagr's module resolution cannot follow. For the client-side SPA
8
+ * (prop-based) flow the widget only needs a plain handle — `{ projectId,
9
+ * proxyPath }` — which it reads directly. So this package builds that handle
10
+ * locally rather than importing `configureZitadel` from `@zitadel/api`, keeping
11
+ * the Angular library self-contained.
12
+ */
13
+ /** Frozen project handle passed to the widgets via the `project` input. */
14
+ interface ZitadelProject {
15
+ readonly proxyPath: string;
16
+ readonly projectId: string;
17
+ readonly url?: string;
18
+ }
19
+ /** Input options for {@link configureZitadel}. */
20
+ interface ZitadelConfig {
21
+ /** Proxy path for API requests. Defaults to `"/__nextgen"`. */
22
+ proxyPath?: string;
23
+ /** Project id passed to flow creation. */
24
+ projectId: string;
25
+ /** Full backend URL (server-side only; optional for client SPAs). */
26
+ url?: string;
27
+ }
28
+ /**
29
+ * Builds the project handle to pass to `<zitadel-auth-login [project]>`.
30
+ *
31
+ * ```ts
32
+ * const project = configureZitadel({ projectId: "…", proxyPath: "/__nextgen" });
33
+ * ```
34
+ */
35
+ declare function configureZitadel(config: ZitadelConfig): ZitadelProject;
36
+
37
+ /**
38
+ * Angular wrapper for the `<zitadel-login>` Lit web component.
39
+ *
40
+ * Uses a distinct selector (`zitadel-auth-login`) and renders the real custom
41
+ * element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle
42
+ * (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`;
43
+ * `purpose` / `post-sign-in-url` are bound as attributes the Lit element reads.
44
+ *
45
+ * ```html
46
+ * <zitadel-auth-login [project]="project" purpose="login" postSignInUrl="/" />
47
+ * ```
48
+ */
49
+ declare class ZitadelLoginComponent {
50
+ project?: ZitadelProject;
51
+ purpose: string;
52
+ postSignInUrl?: string;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLoginComponent, never>;
54
+ static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelLoginComponent, "zitadel-auth-login", never, { "project": { "alias": "project"; "required": false; }; "purpose": { "alias": "purpose"; "required": false; }; "postSignInUrl": { "alias": "postSignInUrl"; "required": false; }; }, {}, never, never, true, never>;
55
+ }
56
+
57
+ /**
58
+ * Angular wrapper for the `<zitadel-logout>` Lit web component. See
59
+ * {@link ZitadelLoginComponent} for the strategy.
60
+ *
61
+ * ```html
62
+ * <zitadel-auth-logout [project]="project" postSignOutUrl="/login" />
63
+ * ```
64
+ */
65
+ declare class ZitadelLogoutComponent {
66
+ project?: ZitadelProject;
67
+ postSignOutUrl?: string;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLogoutComponent, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelLogoutComponent, "zitadel-auth-logout", never, { "project": { "alias": "project"; "required": false; }; "postSignOutUrl": { "alias": "postSignOutUrl"; "required": false; }; }, {}, never, never, true, never>;
70
+ }
71
+
72
+ export { ZitadelLoginComponent, ZitadelLogoutComponent, configureZitadel };
73
+ export type { ZitadelConfig, ZitadelProject };