@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
package/dist/mobile.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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/mobile.ts
|
|
11
|
+
var MobileIQAuthClient = class extends IQAuthClient {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super({ ...config, environment: "mobile" });
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function createMobileClient(config) {
|
|
17
|
+
return new MobileIQAuthClient(config);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
ErrorCodes,
|
|
21
|
+
IQAuthClient,
|
|
22
|
+
IQAuthError,
|
|
23
|
+
MobileIQAuthClient,
|
|
24
|
+
createMobileClient
|
|
25
|
+
};
|
package/dist/next.d.mts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IQAuthHelperConfig } from './server/handlers.mjs';
|
|
2
|
+
import { J as JwtClaims } from './types-Cxl3bQHt.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @iqauth/sdk/next — Next.js (App Router) adapter.
|
|
6
|
+
*
|
|
7
|
+
* // app/middleware.ts
|
|
8
|
+
* export { middleware } from "@iqauth/sdk/next";
|
|
9
|
+
* export const config = { matcher: ["/((?!api/iqauth|_next/static|_next/image|favicon.ico).*)"] };
|
|
10
|
+
*
|
|
11
|
+
* // app/api/iqauth/[action]/route.ts
|
|
12
|
+
* import { handler } from "@iqauth/sdk/next";
|
|
13
|
+
* export const POST = handler({ publishableKey: process.env.IQAUTH_PUBLISHABLE_KEY!, secretKey: process.env.IQAUTH_SECRET_KEY! });
|
|
14
|
+
*
|
|
15
|
+
* // server component
|
|
16
|
+
* import { getAuth } from "@iqauth/sdk/next";
|
|
17
|
+
* const claims = await getAuth();
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
interface IQAuthNextOptions extends IQAuthHelperConfig {
|
|
21
|
+
/** Path prefix where the helper routes live. */
|
|
22
|
+
mountPath?: string;
|
|
23
|
+
}
|
|
24
|
+
declare function handler(options: IQAuthNextOptions): (req: Request) => Promise<Response>;
|
|
25
|
+
/**
|
|
26
|
+
* Edge-compatible Next.js middleware factory. Returns a function suitable
|
|
27
|
+
* for `export const middleware = createMiddleware({ ... })`.
|
|
28
|
+
*/
|
|
29
|
+
declare function createMiddleware(options: IQAuthNextOptions): (req: Request) => Promise<Response | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Server-component helper. Reads the access token from the request cookies
|
|
32
|
+
* via `next/headers` (must be called in a request scope). Returns `null`
|
|
33
|
+
* for unauthenticated requests.
|
|
34
|
+
*/
|
|
35
|
+
declare function getAuth(options: IQAuthNextOptions): Promise<JwtClaims | null>;
|
|
36
|
+
|
|
37
|
+
export { type IQAuthNextOptions, createMiddleware, getAuth, handler };
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IQAuthHelperConfig } from './server/handlers.js';
|
|
2
|
+
import { J as JwtClaims } from './types-Cxl3bQHt.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @iqauth/sdk/next — Next.js (App Router) adapter.
|
|
6
|
+
*
|
|
7
|
+
* // app/middleware.ts
|
|
8
|
+
* export { middleware } from "@iqauth/sdk/next";
|
|
9
|
+
* export const config = { matcher: ["/((?!api/iqauth|_next/static|_next/image|favicon.ico).*)"] };
|
|
10
|
+
*
|
|
11
|
+
* // app/api/iqauth/[action]/route.ts
|
|
12
|
+
* import { handler } from "@iqauth/sdk/next";
|
|
13
|
+
* export const POST = handler({ publishableKey: process.env.IQAUTH_PUBLISHABLE_KEY!, secretKey: process.env.IQAUTH_SECRET_KEY! });
|
|
14
|
+
*
|
|
15
|
+
* // server component
|
|
16
|
+
* import { getAuth } from "@iqauth/sdk/next";
|
|
17
|
+
* const claims = await getAuth();
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
interface IQAuthNextOptions extends IQAuthHelperConfig {
|
|
21
|
+
/** Path prefix where the helper routes live. */
|
|
22
|
+
mountPath?: string;
|
|
23
|
+
}
|
|
24
|
+
declare function handler(options: IQAuthNextOptions): (req: Request) => Promise<Response>;
|
|
25
|
+
/**
|
|
26
|
+
* Edge-compatible Next.js middleware factory. Returns a function suitable
|
|
27
|
+
* for `export const middleware = createMiddleware({ ... })`.
|
|
28
|
+
*/
|
|
29
|
+
declare function createMiddleware(options: IQAuthNextOptions): (req: Request) => Promise<Response | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Server-component helper. Reads the access token from the request cookies
|
|
32
|
+
* via `next/headers` (must be called in a request scope). Returns `null`
|
|
33
|
+
* for unauthenticated requests.
|
|
34
|
+
*/
|
|
35
|
+
declare function getAuth(options: IQAuthNextOptions): Promise<JwtClaims | null>;
|
|
36
|
+
|
|
37
|
+
export { type IQAuthNextOptions, createMiddleware, getAuth, handler };
|