@iqauth/sdk 2.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 +21 -0
- package/README.md +287 -0
- package/dist/browser-session.d.mts +12 -0
- package/dist/browser-session.d.ts +12 -0
- package/dist/browser-session.js +1812 -0
- package/dist/browser-session.mjs +28 -0
- package/dist/browser.d.mts +46 -0
- package/dist/browser.d.ts +46 -0
- package/dist/browser.js +768 -0
- package/dist/browser.mjs +47 -0
- package/dist/chunk-5HF3OBNO.mjs +189 -0
- package/dist/chunk-5WFR6Y33.mjs +59 -0
- package/dist/chunk-6I6RM4MN.mjs +51 -0
- package/dist/chunk-73R6BEGO.mjs +176 -0
- package/dist/chunk-E46DKOVI.mjs +632 -0
- package/dist/chunk-JQWYIIIS.mjs +1740 -0
- package/dist/chunk-X3K3WOBR.mjs +64 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +581 -0
- package/dist/cli/index.mjs +57 -0
- package/dist/client-C1DXfB8Z.d.mts +911 -0
- package/dist/client-CggvJmmm.d.ts +911 -0
- package/dist/dev-FUTJZSWN.mjs +56 -0
- package/dist/doctor-OHJRZBBT.mjs +89 -0
- package/dist/errors-CDdl24MP.d.mts +52 -0
- package/dist/errors-CDdl24MP.d.ts +52 -0
- package/dist/express-BKAXB5Nl.d.ts +61 -0
- package/dist/express-CpfyYTmw.d.mts +61 -0
- package/dist/express.d.mts +45 -0
- package/dist/express.d.ts +45 -0
- package/dist/express.js +2252 -0
- package/dist/express.mjs +122 -0
- package/dist/fastify.d.mts +23 -0
- package/dist/fastify.d.ts +23 -0
- package/dist/fastify.js +2062 -0
- package/dist/fastify.mjs +118 -0
- package/dist/hono.d.mts +22 -0
- package/dist/hono.d.ts +22 -0
- package/dist/hono.js +2051 -0
- package/dist/hono.mjs +107 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2070 -0
- package/dist/index.mjs +83 -0
- package/dist/init-LLCSQGNL.mjs +198 -0
- package/dist/keys-NLWFAOEM.mjs +63 -0
- package/dist/mobile.d.mts +11 -0
- package/dist/mobile.d.ts +11 -0
- package/dist/mobile.js +1809 -0
- package/dist/mobile.mjs +25 -0
- package/dist/next.d.mts +37 -0
- package/dist/next.d.ts +37 -0
- package/dist/next.js +2078 -0
- package/dist/next.mjs +130 -0
- package/dist/publishableKey-B5DIK81A.d.mts +24 -0
- package/dist/publishableKey-B5DIK81A.d.ts +24 -0
- package/dist/react.d.mts +196 -0
- package/dist/react.d.ts +196 -0
- package/dist/react.js +1457 -0
- package/dist/react.mjs +787 -0
- package/dist/server/handlers.d.mts +96 -0
- package/dist/server/handlers.d.ts +96 -0
- package/dist/server/handlers.js +243 -0
- package/dist/server/handlers.mjs +14 -0
- package/dist/server.d.mts +14 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.js +2195 -0
- package/dist/server.mjs +47 -0
- package/dist/service.d.mts +11 -0
- package/dist/service.d.ts +11 -0
- package/dist/service.js +1809 -0
- package/dist/service.mjs +25 -0
- package/dist/signIn-C8f6qVjD.d.mts +238 -0
- package/dist/signIn-Cy2lbEXb.d.ts +238 -0
- package/dist/types-Cxl3bQHt.d.mts +900 -0
- package/dist/types-Cxl3bQHt.d.ts +900 -0
- package/docs/APP_INTEGRATION_MATRIX.md +59 -0
- package/docs/BROWSER_SESSION_MIGRATION.md +69 -0
- package/docs/FRESH_IMPLEMENTATION_GUIDE.md +188 -0
- package/docs/TARBALL_RELEASE_WORKFLOW.md +98 -0
- package/docs/V1_TO_V2_UPGRADE_GUIDE.md +318 -0
- package/docs/guides/api-keys.md +130 -0
- package/docs/guides/app-registration.md +149 -0
- package/docs/guides/auth-flows.md +168 -0
- package/docs/guides/branding.md +160 -0
- package/docs/guides/entitlements.md +115 -0
- package/docs/guides/entity-hierarchy.md +200 -0
- package/docs/guides/error-handling.md +251 -0
- package/docs/guides/gdpr-compliance.md +123 -0
- package/docs/guides/invitations.md +143 -0
- package/docs/guides/mfa-enrollment.md +170 -0
- package/docs/guides/middleware-reference.md +205 -0
- package/docs/guides/mobile-native.md +110 -0
- package/docs/guides/roles-and-permissions.md +220 -0
- package/docs/guides/scoped-authorization.md +247 -0
- package/docs/guides/server-platform-integration.md +52 -0
- package/docs/guides/service-automation-integration.md +36 -0
- package/docs/guides/session-management.md +97 -0
- package/docs/guides/tenant-management.md +216 -0
- package/docs/guides/token-verification.md +178 -0
- package/docs/guides/user-management.md +184 -0
- package/docs/guides/webhooks.md +136 -0
- package/docs/integration-prompts/README.md +20 -0
- package/docs/integration-prompts/first-party-browser-app.md +29 -0
- package/docs/integration-prompts/install-from-tarball.md +41 -0
- package/docs/integration-prompts/migrate-from-local-packages-source.md +57 -0
- package/docs/integration-prompts/native-mobile-app.md +24 -0
- package/docs/integration-prompts/server-platform-app.md +20 -0
- package/docs/integration-prompts/service-automation-app.md +20 -0
- package/package.json +115 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IQAuthClient
|
|
3
|
+
} from "./chunk-JQWYIIIS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ErrorCodes,
|
|
6
|
+
IQAuthError
|
|
7
|
+
} from "./chunk-6I6RM4MN.mjs";
|
|
8
|
+
import "./chunk-Y6FXYEAI.mjs";
|
|
9
|
+
|
|
10
|
+
// src/browser-session.ts
|
|
11
|
+
var BrowserSessionIQAuthClient = class extends IQAuthClient {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super({ ...config, environment: "browser_session" });
|
|
14
|
+
}
|
|
15
|
+
async getSessionUser() {
|
|
16
|
+
return this.auth.getSessionUser();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function createBrowserSessionClient(config) {
|
|
20
|
+
return new BrowserSessionIQAuthClient(config);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
BrowserSessionIQAuthClient,
|
|
24
|
+
ErrorCodes,
|
|
25
|
+
IQAuthClient,
|
|
26
|
+
IQAuthError,
|
|
27
|
+
createBrowserSessionClient
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { C as CallbackResult, S as SessionManager, d as SessionManagerOptions, a as SessionSnapshot, e as SessionStatus, b as SignInOptions, c as SignOutOptions, f as buildSignInUrl, h as handleAuthCallback, r as redirectToSignIn, s as signIn, g as signOut } from './signIn-C8f6qVjD.mjs';
|
|
2
|
+
export { K as KeyMode, b as ParsedPublishableKey, P as PublishableKeyPayload, e as encodePublishableKey, i as isPublishableKey, a as isSecretKey, p as parsePublishableKey } from './publishableKey-B5DIK81A.mjs';
|
|
3
|
+
export { a as ErrorCode, E as ErrorCodes, I as IQAuthError } from './errors-CDdl24MP.mjs';
|
|
4
|
+
import './types-Cxl3bQHt.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Browser-only storage helpers used by the SessionManager.
|
|
8
|
+
*
|
|
9
|
+
* Storage strategy (Phase B):
|
|
10
|
+
* - Access token: in memory only (held by SessionManager).
|
|
11
|
+
* - Refresh token: first-party cookie on the app's own domain. The cookie
|
|
12
|
+
* is set by the SDK callback handler and cleared on signOut.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: Cookies set from JS cannot be httpOnly. Phase D (cookie-aware
|
|
15
|
+
* middleware) will move refresh-token cookie management into the app's
|
|
16
|
+
* backend so it can be httpOnly. Until then, the SDK uses a `Secure`,
|
|
17
|
+
* `SameSite=Lax` first-party cookie as a pragmatic stopgap. Nothing
|
|
18
|
+
* privileged ever lives in localStorage.
|
|
19
|
+
*/
|
|
20
|
+
declare const REFRESH_COOKIE = "iqauth_rt";
|
|
21
|
+
interface CookieOptions {
|
|
22
|
+
maxAgeSeconds?: number;
|
|
23
|
+
path?: string;
|
|
24
|
+
domain?: string;
|
|
25
|
+
secure?: boolean;
|
|
26
|
+
sameSite?: "lax" | "strict" | "none";
|
|
27
|
+
}
|
|
28
|
+
declare function setCookie(name: string, value: string, opts?: CookieOptions): void;
|
|
29
|
+
declare function getCookie(name: string): string | null;
|
|
30
|
+
declare function clearCookie(name: string, opts?: CookieOptions): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Browser-safe PKCE + state/nonce generation using WebCrypto.
|
|
34
|
+
* Falls back to Node's crypto.webcrypto for tests.
|
|
35
|
+
*/
|
|
36
|
+
declare function randomUrlSafe(byteLength?: number): string;
|
|
37
|
+
declare function s256Challenge(verifier: string): Promise<string>;
|
|
38
|
+
interface PkcePair {
|
|
39
|
+
codeVerifier: string;
|
|
40
|
+
codeChallenge: string;
|
|
41
|
+
state: string;
|
|
42
|
+
nonce: string;
|
|
43
|
+
}
|
|
44
|
+
declare function createPkcePair(): Promise<PkcePair>;
|
|
45
|
+
|
|
46
|
+
export { REFRESH_COOKIE, clearCookie, createPkcePair, getCookie, randomUrlSafe, s256Challenge, setCookie };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { C as CallbackResult, S as SessionManager, d as SessionManagerOptions, a as SessionSnapshot, e as SessionStatus, b as SignInOptions, c as SignOutOptions, f as buildSignInUrl, h as handleAuthCallback, r as redirectToSignIn, s as signIn, g as signOut } from './signIn-Cy2lbEXb.js';
|
|
2
|
+
export { K as KeyMode, b as ParsedPublishableKey, P as PublishableKeyPayload, e as encodePublishableKey, i as isPublishableKey, a as isSecretKey, p as parsePublishableKey } from './publishableKey-B5DIK81A.js';
|
|
3
|
+
export { a as ErrorCode, E as ErrorCodes, I as IQAuthError } from './errors-CDdl24MP.js';
|
|
4
|
+
import './types-Cxl3bQHt.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Browser-only storage helpers used by the SessionManager.
|
|
8
|
+
*
|
|
9
|
+
* Storage strategy (Phase B):
|
|
10
|
+
* - Access token: in memory only (held by SessionManager).
|
|
11
|
+
* - Refresh token: first-party cookie on the app's own domain. The cookie
|
|
12
|
+
* is set by the SDK callback handler and cleared on signOut.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: Cookies set from JS cannot be httpOnly. Phase D (cookie-aware
|
|
15
|
+
* middleware) will move refresh-token cookie management into the app's
|
|
16
|
+
* backend so it can be httpOnly. Until then, the SDK uses a `Secure`,
|
|
17
|
+
* `SameSite=Lax` first-party cookie as a pragmatic stopgap. Nothing
|
|
18
|
+
* privileged ever lives in localStorage.
|
|
19
|
+
*/
|
|
20
|
+
declare const REFRESH_COOKIE = "iqauth_rt";
|
|
21
|
+
interface CookieOptions {
|
|
22
|
+
maxAgeSeconds?: number;
|
|
23
|
+
path?: string;
|
|
24
|
+
domain?: string;
|
|
25
|
+
secure?: boolean;
|
|
26
|
+
sameSite?: "lax" | "strict" | "none";
|
|
27
|
+
}
|
|
28
|
+
declare function setCookie(name: string, value: string, opts?: CookieOptions): void;
|
|
29
|
+
declare function getCookie(name: string): string | null;
|
|
30
|
+
declare function clearCookie(name: string, opts?: CookieOptions): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Browser-safe PKCE + state/nonce generation using WebCrypto.
|
|
34
|
+
* Falls back to Node's crypto.webcrypto for tests.
|
|
35
|
+
*/
|
|
36
|
+
declare function randomUrlSafe(byteLength?: number): string;
|
|
37
|
+
declare function s256Challenge(verifier: string): Promise<string>;
|
|
38
|
+
interface PkcePair {
|
|
39
|
+
codeVerifier: string;
|
|
40
|
+
codeChallenge: string;
|
|
41
|
+
state: string;
|
|
42
|
+
nonce: string;
|
|
43
|
+
}
|
|
44
|
+
declare function createPkcePair(): Promise<PkcePair>;
|
|
45
|
+
|
|
46
|
+
export { REFRESH_COOKIE, clearCookie, createPkcePair, getCookie, randomUrlSafe, s256Challenge, setCookie };
|