@ascendkit/nextjs 0.2.5 → 0.2.7

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.
@@ -8,6 +8,6 @@ export { AscendKitAuthCard } from "./auth-card";
8
8
  export { AuthModal } from "./auth-modal";
9
9
  export { SignInButton } from "./sign-in-button";
10
10
  export { SignUpButton } from "./sign-up-button";
11
- export { AscendKitUserButton } from "./user-button";
11
+ export { AscendKitUserButton, type AscendKitUserButtonProps } from "./user-button";
12
12
  export { BrandingBadge } from "./branding-badge";
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,11 +1,30 @@
1
1
  import { type UserButtonProps } from "@daveyplate/better-auth-ui";
2
+ export interface AscendKitUserButtonProps extends UserButtonProps {
3
+ /**
4
+ * When `true`, renders a compact avatar-only trigger suitable for collapsed
5
+ * sidebars. The dropdown opens to the right instead of above.
6
+ *
7
+ * @default false
8
+ * @example
9
+ * ```tsx
10
+ * <AscendKitUserButton collapsed={isSidebarCollapsed} />
11
+ * ```
12
+ */
13
+ collapsed?: boolean;
14
+ }
2
15
  /**
3
16
  * User avatar dropdown with sign-out, powered by Better Auth UI.
4
17
  *
5
- * Usage:
18
+ * Adapts to sidebar collapse state: when `collapsed` is true the trigger
19
+ * shrinks to a circular avatar with a chevron indicator and the dropdown
20
+ * opens to the right. When expanded (default) the full name, email and
21
+ * chevron are shown.
22
+ *
23
+ * @example
6
24
  * ```tsx
7
25
  * <AscendKitUserButton />
26
+ * <AscendKitUserButton collapsed />
8
27
  * ```
9
28
  */
10
- export declare function AscendKitUserButton(props: UserButtonProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function AscendKitUserButton({ collapsed, ...props }: AscendKitUserButtonProps): import("react/jsx-runtime").JSX.Element;
11
30
  //# sourceMappingURL=user-button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-button.d.ts","sourceRoot":"","sources":["../../src/components/user-button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE9E;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,2CAEzD"}
1
+ {"version":3,"file":"user-button.d.ts","sourceRoot":"","sources":["../../src/components/user-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAe1B"}
@@ -1,14 +1,36 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { UserButton } from "@daveyplate/better-auth-ui";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, useContext } from "react";
4
+ import { ChevronsUpDown } from "lucide-react";
5
+ import { AuthUIContext, UserAvatar, UserButton, } from "@daveyplate/better-auth-ui";
4
6
  /**
5
7
  * User avatar dropdown with sign-out, powered by Better Auth UI.
6
8
  *
7
- * Usage:
9
+ * Adapts to sidebar collapse state: when `collapsed` is true the trigger
10
+ * shrinks to a circular avatar with a chevron indicator and the dropdown
11
+ * opens to the right. When expanded (default) the full name, email and
12
+ * chevron are shown.
13
+ *
14
+ * @example
8
15
  * ```tsx
9
16
  * <AscendKitUserButton />
17
+ * <AscendKitUserButton collapsed />
10
18
  * ```
11
19
  */
12
- export function AscendKitUserButton(props) {
20
+ export function AscendKitUserButton({ collapsed, ...props }) {
21
+ if (collapsed) {
22
+ return (_jsx(UserButton, { ...props, disableDefaultLinks: true, size: "icon", side: "right", align: "start", trigger: _jsx(CollapsedTrigger, {}) }));
23
+ }
13
24
  return _jsx(UserButton, { ...props, disableDefaultLinks: true });
14
25
  }
26
+ /**
27
+ * Compact trigger for collapsed sidebar: avatar circle + chevron arrows.
28
+ * Uses forwardRef so Radix's Slot (via DropdownMenuTrigger asChild) can
29
+ * attach its ref and event handlers (onClick, etc.) to the button.
30
+ */
31
+ const CollapsedTrigger = forwardRef(function CollapsedTrigger(props, ref) {
32
+ const { hooks: { useSession }, } = useContext(AuthUIContext);
33
+ const { data: sessionData, isPending } = useSession();
34
+ const user = sessionData?.user;
35
+ return (_jsxs("button", { ref: ref, type: "button", ...props, className: `flex items-center gap-1 rounded-md p-1.5 transition hover:bg-accent/50 ${props.className ?? ""}`, children: [_jsx(UserAvatar, { user: user, isPending: isPending, className: "size-8" }), _jsx(ChevronsUpDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })] }));
36
+ });
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { AscendKitAuth, createAscendKitAuthRuntime, createAscendKitAdapter, createAccessTokenHandler, Analytics, } from "./server";
2
2
  export type { AscendKitAuthOptions, AscendKitSession, AscendKitUser, BrandingConfig } from "./shared/types";
3
3
  export { AscendKitProvider, useAscendKitContext, useAscendKit, useAuthModal, useAccessToken, useSessions, useUser, useAnalytics, verifyEmail } from "./client";
4
- export { Login, SignUp, EmailVerification, ForgotPassword, ResetPassword, SocialButton, AscendKitAuthCard, AuthModal, SignInButton, SignUpButton, AscendKitUserButton, BrandingBadge, } from "./components";
4
+ export { Login, SignUp, EmailVerification, ForgotPassword, ResetPassword, SocialButton, AscendKitAuthCard, AuthModal, SignInButton, SignUpButton, AscendKitUserButton, type AscendKitUserButtonProps, BrandingBadge, } from "./components";
5
5
  export { SignedIn, SignedOut, AuthLoading } from "@daveyplate/better-auth-ui";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG5G,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG/J,OAAO,EACL,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG5G,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG/J,OAAO,EACL,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC"}
@@ -2,5 +2,5 @@
2
2
  * Creates a Better Auth database adapter that routes all CRUD operations
3
3
  * through the AscendKit backend API, scoped by public key.
4
4
  */
5
- export declare function createAscendKitAdapter(publicKey: string, apiUrl: string): import("better-auth/adapters").AdapterFactory<import("better-auth").BetterAuthOptions>;
5
+ export declare function createAscendKitAdapter(publicKey: string, apiUrl: string, secretKey?: string): import("better-auth/adapters").AdapterFactory<import("better-auth").BetterAuthOptions>;
6
6
  //# sourceMappingURL=adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/server/adapter.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,0FA+DvE"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/server/adapter.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,0FA+D3F"}
@@ -4,7 +4,7 @@ import { createHttpClient } from "../shared/http-client";
4
4
  * Creates a Better Auth database adapter that routes all CRUD operations
5
5
  * through the AscendKit backend API, scoped by public key.
6
6
  */
7
- export function createAscendKitAdapter(publicKey, apiUrl) {
7
+ export function createAscendKitAdapter(publicKey, apiUrl, secretKey) {
8
8
  return createAdapterFactory({
9
9
  config: {
10
10
  adapterId: "ascendkit",
@@ -14,7 +14,7 @@ export function createAscendKitAdapter(publicKey, apiUrl) {
14
14
  supportsBooleans: true,
15
15
  },
16
16
  adapter: () => {
17
- const http = createHttpClient({ publicKey, apiUrl });
17
+ const http = createHttpClient({ publicKey, apiUrl, secretKey });
18
18
  return {
19
19
  async create({ model, data, select }) {
20
20
  return await http.post("/api/auth/db/create", { model, data, select });
@@ -71,7 +71,7 @@ export declare function AscendKitAuth(options?: AscendKitAuthOptions): Promise<i
71
71
  enabled: boolean;
72
72
  };
73
73
  }>>;
74
- export declare function createDisabledAuth(publicKey: string, apiUrl: string): import("better-auth").Auth<{
74
+ export declare function createDisabledAuth(publicKey: string, apiUrl: string, secretKey?: string): import("better-auth").Auth<{
75
75
  database: import("better-auth/adapters").AdapterFactory<import("better-auth").BetterAuthOptions>;
76
76
  emailAndPassword: {
77
77
  enabled: false;
@@ -79,6 +79,7 @@ export declare function createDisabledAuth(publicKey: string, apiUrl: string): i
79
79
  }>;
80
80
  export declare function buildAscendKitAuthFromConfig(args: {
81
81
  publicKey: string;
82
+ secretKey?: string;
82
83
  apiUrl: string;
83
84
  config: AuthConfig;
84
85
  waitlistRedirectPath?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ascendkit-auth.d.ts","sourceRoot":"","sources":["../../src/server/ascendkit-auth.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,oBAAyB;;;;;;;;;;;;;;;;;;;sCAuG1B;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;;oCARxD;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;IA1E/F;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;GAMnE;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;;;;;;;;;;;;;;sCAkE2C;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;;oCARxD;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;IAwB/F"}
1
+ {"version":3,"file":"ascendkit-auth.d.ts","sourceRoot":"","sources":["../../src/server/ascendkit-auth.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,oBAAyB;;;;;;;;;;;;;;;;;;;sCA0G1B;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;;oCARxD;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;IA5E/F;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;;GAMvF;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;;;;;;;;;;;;;;sCAmE2C;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;;oCARxD;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE;;;;IAwB/F"}
@@ -46,26 +46,27 @@ export async function AscendKitAuth(options = {}) {
46
46
  catch (err) {
47
47
  console.error("[AscendKit] Failed to fetch auth config:", err instanceof Error ? err.message : err);
48
48
  console.error("[AscendKit] Auth routes will operate with no providers until config is available.");
49
- return createDisabledAuth(publicKey, apiUrl);
49
+ return createDisabledAuth(publicKey, apiUrl, secretKey);
50
50
  }
51
51
  return buildAscendKitAuthFromConfig({
52
52
  publicKey,
53
+ secretKey,
53
54
  apiUrl,
54
55
  config,
55
56
  waitlistRedirectPath: options.waitlistRedirectPath,
56
57
  rejectedRedirectPath: options.rejectedRedirectPath,
57
58
  });
58
59
  }
59
- export function createDisabledAuth(publicKey, apiUrl) {
60
- const adapter = createAscendKitAdapter(publicKey, apiUrl);
60
+ export function createDisabledAuth(publicKey, apiUrl, secretKey) {
61
+ const adapter = createAscendKitAdapter(publicKey, apiUrl, secretKey);
61
62
  return betterAuth({
62
63
  database: adapter,
63
64
  emailAndPassword: { enabled: false },
64
65
  });
65
66
  }
66
67
  export async function buildAscendKitAuthFromConfig(args) {
67
- const { publicKey, apiUrl, config, waitlistRedirectPath, rejectedRedirectPath, } = args;
68
- const adapter = createAscendKitAdapter(publicKey, apiUrl);
68
+ const { publicKey, secretKey, apiUrl, config, waitlistRedirectPath, rejectedRedirectPath, } = args;
69
+ const adapter = createAscendKitAdapter(publicKey, apiUrl, secretKey);
69
70
  const proxyProviders = Object.entries(config.oauth)
70
71
  .filter(([, creds]) => creds.flowType === "proxy")
71
72
  .map(([provider]) => provider);
@@ -1 +1 @@
1
- {"version":3,"file":"auth-runtime.d.ts","sourceRoot":"","sources":["../../src/server/auth-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAM5D,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,KAAK,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAOlF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,OAAO,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC5C;AA8BD,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,oBAAyB,GAAG,oBAAoB,CA0HnG"}
1
+ {"version":3,"file":"auth-runtime.d.ts","sourceRoot":"","sources":["../../src/server/auth-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAM5D,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,KAAK,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAOlF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,OAAO,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC5C;AA8BD,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,oBAAyB,GAAG,oBAAoB,CA2HnG"}
@@ -52,19 +52,20 @@ export function createAscendKitAuthRuntime(options = {}) {
52
52
  }
53
53
  console.info("[AscendKit runtime] config_refresh_outcome=hit_304");
54
54
  if (!currentAuth) {
55
- currentAuth = createDisabledAuth(publicKey, apiUrl);
55
+ currentAuth = createDisabledAuth(publicKey, apiUrl, secretKey);
56
56
  }
57
57
  return;
58
58
  }
59
59
  if (!result.config) {
60
60
  console.warn("[AscendKit runtime] config_refresh_outcome=cold_fail reason=missing_config");
61
61
  if (!currentAuth) {
62
- currentAuth = createDisabledAuth(publicKey, apiUrl);
62
+ currentAuth = createDisabledAuth(publicKey, apiUrl, secretKey);
63
63
  }
64
64
  return;
65
65
  }
66
66
  const nextAuth = await buildAscendKitAuthFromConfig({
67
67
  publicKey,
68
+ secretKey,
68
69
  apiUrl,
69
70
  config: result.config,
70
71
  waitlistRedirectPath: options.waitlistRedirectPath,
@@ -83,7 +84,7 @@ export function createAscendKitAuthRuntime(options = {}) {
83
84
  catch (err) {
84
85
  console.warn("[AscendKit runtime] config_refresh_outcome=fallback_last_known_good", err instanceof Error ? err.message : err);
85
86
  if (!currentAuth) {
86
- currentAuth = createDisabledAuth(publicKey, apiUrl);
87
+ currentAuth = createDisabledAuth(publicKey, apiUrl, secretKey);
87
88
  }
88
89
  }
89
90
  })();
@@ -96,7 +97,7 @@ export function createAscendKitAuthRuntime(options = {}) {
96
97
  async function getAuth() {
97
98
  await refreshAuth();
98
99
  if (!currentAuth) {
99
- currentAuth = createDisabledAuth(publicKey, apiUrl);
100
+ currentAuth = createDisabledAuth(publicKey, apiUrl, secretKey);
100
101
  }
101
102
  return currentAuth;
102
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascendkit/nextjs",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "AscendKit SDK for Next.js and React",
5
5
  "author": "ascendkit.dev",
6
6
  "license": "MIT",