@feelflow/ffid-sdk 3.0.0 → 3.1.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.
@@ -808,7 +808,7 @@ function createProfileMethods(deps) {
808
808
  }
809
809
 
810
810
  // src/client/version-check.ts
811
- var SDK_VERSION = "3.0.0";
811
+ var SDK_VERSION = "3.1.0";
812
812
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
813
813
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
814
814
  function sdkHeaders() {
@@ -1369,6 +1369,8 @@ function base64UrlEncode(buffer) {
1369
1369
  // src/client/redirect.ts
1370
1370
  var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
1371
1371
  var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
1372
+ var SCREEN_HINT_SIGNUP = "signup";
1373
+ var SCREEN_HINT_PARAM = "screen_hint";
1372
1374
  var STATE_RANDOM_BYTES = 16;
1373
1375
  var HEX_BASE2 = 16;
1374
1376
  var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
@@ -1536,6 +1538,9 @@ function createRedirectMethods(deps) {
1536
1538
  }
1537
1539
  params.set("organization_id", trimmedOrgId);
1538
1540
  }
1541
+ if (options?.screenHint === SCREEN_HINT_SIGNUP) {
1542
+ params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
1543
+ }
1539
1544
  const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
1540
1545
  logger.debug("Redirecting to authorize:", authorizeUrl);
1541
1546
  recordRedirectAttempt(authorizeKey, now, logger);
@@ -1547,18 +1552,17 @@ function createRedirectMethods(deps) {
1547
1552
  }
1548
1553
  return { success: true };
1549
1554
  }
1550
- async function redirectToLogin() {
1555
+ async function redirectToLogin(options) {
1551
1556
  if (typeof window === "undefined") {
1552
1557
  logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
1553
1558
  return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
1554
1559
  }
1555
1560
  if (authMode === "token") {
1556
- return redirectToAuthorize();
1561
+ return redirectToAuthorize(options);
1557
1562
  }
1558
- const currentUrl = window.location.href;
1559
- const loginUrl = `${baseUrl}/login?redirect=${encodeURIComponent(currentUrl)}&service=${encodeURIComponent(serviceCode)}`;
1560
- logger.debug("Redirecting to login:", loginUrl);
1561
- window.location.href = loginUrl;
1563
+ const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
1564
+ logger.debug("Redirecting to auth page:", targetUrl);
1565
+ window.location.href = targetUrl;
1562
1566
  return { success: true };
1563
1567
  }
1564
1568
  function getLoginUrl(redirectUrl) {
@@ -2691,8 +2695,8 @@ function FFIDProvider({
2691
2695
  setIsLoading(false);
2692
2696
  }
2693
2697
  }, [client]);
2694
- const login = react.useCallback(() => {
2695
- client.redirectToLogin().catch((err) => {
2698
+ const login = react.useCallback((options) => {
2699
+ client.redirectToLogin(options).catch((err) => {
2696
2700
  client.logger.error("\u30ED\u30B0\u30A4\u30F3\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", err);
2697
2701
  });
2698
2702
  }, [client]);
@@ -806,7 +806,7 @@ function createProfileMethods(deps) {
806
806
  }
807
807
 
808
808
  // src/client/version-check.ts
809
- var SDK_VERSION = "3.0.0";
809
+ var SDK_VERSION = "3.1.0";
810
810
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
811
811
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
812
812
  function sdkHeaders() {
@@ -1367,6 +1367,8 @@ function base64UrlEncode(buffer) {
1367
1367
  // src/client/redirect.ts
1368
1368
  var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
1369
1369
  var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
1370
+ var SCREEN_HINT_SIGNUP = "signup";
1371
+ var SCREEN_HINT_PARAM = "screen_hint";
1370
1372
  var STATE_RANDOM_BYTES = 16;
1371
1373
  var HEX_BASE2 = 16;
1372
1374
  var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
@@ -1534,6 +1536,9 @@ function createRedirectMethods(deps) {
1534
1536
  }
1535
1537
  params.set("organization_id", trimmedOrgId);
1536
1538
  }
1539
+ if (options?.screenHint === SCREEN_HINT_SIGNUP) {
1540
+ params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
1541
+ }
1537
1542
  const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
1538
1543
  logger.debug("Redirecting to authorize:", authorizeUrl);
1539
1544
  recordRedirectAttempt(authorizeKey, now, logger);
@@ -1545,18 +1550,17 @@ function createRedirectMethods(deps) {
1545
1550
  }
1546
1551
  return { success: true };
1547
1552
  }
1548
- async function redirectToLogin() {
1553
+ async function redirectToLogin(options) {
1549
1554
  if (typeof window === "undefined") {
1550
1555
  logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
1551
1556
  return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
1552
1557
  }
1553
1558
  if (authMode === "token") {
1554
- return redirectToAuthorize();
1559
+ return redirectToAuthorize(options);
1555
1560
  }
1556
- const currentUrl = window.location.href;
1557
- const loginUrl = `${baseUrl}/login?redirect=${encodeURIComponent(currentUrl)}&service=${encodeURIComponent(serviceCode)}`;
1558
- logger.debug("Redirecting to login:", loginUrl);
1559
- window.location.href = loginUrl;
1561
+ const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
1562
+ logger.debug("Redirecting to auth page:", targetUrl);
1563
+ window.location.href = targetUrl;
1560
1564
  return { success: true };
1561
1565
  }
1562
1566
  function getLoginUrl(redirectUrl) {
@@ -2689,8 +2693,8 @@ function FFIDProvider({
2689
2693
  setIsLoading(false);
2690
2694
  }
2691
2695
  }, [client]);
2692
- const login = useCallback(() => {
2693
- client.redirectToLogin().catch((err) => {
2696
+ const login = useCallback((options) => {
2697
+ client.redirectToLogin(options).catch((err) => {
2694
2698
  client.logger.error("\u30ED\u30B0\u30A4\u30F3\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", err);
2695
2699
  });
2696
2700
  }, [client]);
@@ -1,34 +1,34 @@
1
1
  'use strict';
2
2
 
3
- var chunkJNR4AKL5_cjs = require('../chunk-JNR4AKL5.cjs');
3
+ var chunkHZZQ2BX7_cjs = require('../chunk-HZZQ2BX7.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunkJNR4AKL5_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunkJNR4AKL5_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDInquiryForm", {
16
16
  enumerable: true,
17
- get: function () { return chunkJNR4AKL5_cjs.FFIDInquiryForm; }
17
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDInquiryForm; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDLoginButton", {
20
20
  enumerable: true,
21
- get: function () { return chunkJNR4AKL5_cjs.FFIDLoginButton; }
21
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDLoginButton; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
24
24
  enumerable: true,
25
- get: function () { return chunkJNR4AKL5_cjs.FFIDOrganizationSwitcher; }
25
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDOrganizationSwitcher; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
28
28
  enumerable: true,
29
- get: function () { return chunkJNR4AKL5_cjs.FFIDSubscriptionBadge; }
29
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDSubscriptionBadge; }
30
30
  });
31
31
  Object.defineProperty(exports, "FFIDUserMenu", {
32
32
  enumerable: true,
33
- get: function () { return chunkJNR4AKL5_cjs.FFIDUserMenu; }
33
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDUserMenu; }
34
34
  });
@@ -1,3 +1,3 @@
1
- export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-C3zyNa4j.cjs';
1
+ export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-COnReU8h.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-C3zyNa4j.js';
1
+ export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-COnReU8h.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-XWI4BFKW.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-RRN3DTET.js';
@@ -1056,10 +1056,32 @@ interface ContractWizardSubscriptionOptions {
1056
1056
 
1057
1057
  /** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
1058
1058
 
1059
+ /**
1060
+ * `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
1061
+ * Forwards to Supabase Auth signup screen; only the `'signup'` value is
1062
+ * propagated (no-op when `'login'` or omitted).
1063
+ */
1064
+ declare const SCREEN_HINT_SIGNUP: "signup";
1065
+ /** `screen_hint=login` (no-op marker; default screen is login) */
1066
+ declare const SCREEN_HINT_LOGIN: "login";
1059
1067
  /** Options for redirectToAuthorize */
1060
1068
  interface RedirectToAuthorizeOptions {
1061
1069
  /** Target organization ID — triggers org-scoped OAuth re-authorization */
1062
1070
  organizationId?: string;
1071
+ /**
1072
+ * Initial Supabase Auth screen hint (#2908 / #2911).
1073
+ *
1074
+ * - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
1075
+ * on the signup screen (used by external services that want to deep-link
1076
+ * new users into the signup CTA).
1077
+ * - `'login'` / `undefined`: no `screen_hint` param is added — the default
1078
+ * login screen is shown.
1079
+ *
1080
+ * In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
1081
+ * of `/login` so the SDK contract (signup-screen intent) stays consistent
1082
+ * regardless of `authMode`.
1083
+ */
1084
+ screenHint?: typeof SCREEN_HINT_SIGNUP | typeof SCREEN_HINT_LOGIN;
1063
1085
  }
1064
1086
 
1065
1087
  /**
@@ -1107,7 +1129,7 @@ declare function createTokenStore(storageType?: 'localStorage' | 'memory'): Toke
1107
1129
  declare function createFFIDClient(config: FFIDConfig): {
1108
1130
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
1109
1131
  signOut: () => Promise<FFIDApiResponse<void>>;
1110
- redirectToLogin: () => Promise<FFIDRedirectResult>;
1132
+ redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
1111
1133
  redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
1112
1134
  redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
1113
1135
  getLoginUrl: (redirectUrl?: string) => string;
@@ -1056,10 +1056,32 @@ interface ContractWizardSubscriptionOptions {
1056
1056
 
1057
1057
  /** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
1058
1058
 
1059
+ /**
1060
+ * `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
1061
+ * Forwards to Supabase Auth signup screen; only the `'signup'` value is
1062
+ * propagated (no-op when `'login'` or omitted).
1063
+ */
1064
+ declare const SCREEN_HINT_SIGNUP: "signup";
1065
+ /** `screen_hint=login` (no-op marker; default screen is login) */
1066
+ declare const SCREEN_HINT_LOGIN: "login";
1059
1067
  /** Options for redirectToAuthorize */
1060
1068
  interface RedirectToAuthorizeOptions {
1061
1069
  /** Target organization ID — triggers org-scoped OAuth re-authorization */
1062
1070
  organizationId?: string;
1071
+ /**
1072
+ * Initial Supabase Auth screen hint (#2908 / #2911).
1073
+ *
1074
+ * - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
1075
+ * on the signup screen (used by external services that want to deep-link
1076
+ * new users into the signup CTA).
1077
+ * - `'login'` / `undefined`: no `screen_hint` param is added — the default
1078
+ * login screen is shown.
1079
+ *
1080
+ * In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
1081
+ * of `/login` so the SDK contract (signup-screen intent) stays consistent
1082
+ * regardless of `authMode`.
1083
+ */
1084
+ screenHint?: typeof SCREEN_HINT_SIGNUP | typeof SCREEN_HINT_LOGIN;
1063
1085
  }
1064
1086
 
1065
1087
  /**
@@ -1107,7 +1129,7 @@ declare function createTokenStore(storageType?: 'localStorage' | 'memory'): Toke
1107
1129
  declare function createFFIDClient(config: FFIDConfig): {
1108
1130
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
1109
1131
  signOut: () => Promise<FFIDApiResponse<void>>;
1110
- redirectToLogin: () => Promise<FFIDRedirectResult>;
1132
+ redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
1111
1133
  redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
1112
1134
  redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
1113
1135
  getLoginUrl: (redirectUrl?: string) => string;
@@ -302,8 +302,17 @@ interface FFIDContextValue {
302
302
  isAuthenticated: boolean;
303
303
  /** Any authentication error */
304
304
  error: FFIDError | null;
305
- /** Redirect to FFID login page */
306
- login: () => void;
305
+ /**
306
+ * Redirect to FFID login page.
307
+ *
308
+ * @param options.screenHint `'signup'` to deep-link into the signup screen
309
+ * (forwards `screen_hint=signup` in token mode / redirects to `/signup`
310
+ * in cookie mode). `'login'` and `undefined` use the default login flow.
311
+ * See `RedirectToAuthorizeOptions` (#2908 / #2911).
312
+ */
313
+ login: (options?: {
314
+ screenHint?: 'signup' | 'login';
315
+ }) => void;
307
316
  /** Sign out and clear session */
308
317
  logout: () => Promise<void>;
309
318
  /**
@@ -302,8 +302,17 @@ interface FFIDContextValue {
302
302
  isAuthenticated: boolean;
303
303
  /** Any authentication error */
304
304
  error: FFIDError | null;
305
- /** Redirect to FFID login page */
306
- login: () => void;
305
+ /**
306
+ * Redirect to FFID login page.
307
+ *
308
+ * @param options.screenHint `'signup'` to deep-link into the signup screen
309
+ * (forwards `screen_hint=signup` in token mode / redirects to `/signup`
310
+ * in cookie mode). `'login'` and `undefined` use the default login flow.
311
+ * See `RedirectToAuthorizeOptions` (#2908 / #2911).
312
+ */
313
+ login: (options?: {
314
+ screenHint?: 'signup' | 'login';
315
+ }) => void;
307
316
  /** Sign out and clear session */
308
317
  logout: () => Promise<void>;
309
318
  /**
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJNR4AKL5_cjs = require('./chunk-JNR4AKL5.cjs');
3
+ var chunkHZZQ2BX7_cjs = require('./chunk-HZZQ2BX7.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
@@ -53,8 +53,8 @@ function defaultRedirect(url) {
53
53
  }
54
54
  function useRequireActiveSubscription(options) {
55
55
  const { redirectTo, allowGrace = true, onRedirect } = options;
56
- const { isLoading, error } = chunkJNR4AKL5_cjs.useFFIDContext();
57
- const { effectiveStatus, isBlocked, isGrace } = chunkJNR4AKL5_cjs.useSubscription();
56
+ const { isLoading, error } = chunkHZZQ2BX7_cjs.useFFIDContext();
57
+ const { effectiveStatus, isBlocked, isGrace } = chunkHZZQ2BX7_cjs.useSubscription();
58
58
  const hasFetchError = error !== null && effectiveStatus === null;
59
59
  const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
60
60
  react.useEffect(() => {
@@ -75,7 +75,7 @@ function useRequireActiveSubscription(options) {
75
75
  }
76
76
  function withFFIDAuth(Component, options = {}) {
77
77
  const WrappedComponent = (props) => {
78
- const { isLoading, isAuthenticated, login } = chunkJNR4AKL5_cjs.useFFIDContext();
78
+ const { isLoading, isAuthenticated, login } = chunkHZZQ2BX7_cjs.useFFIDContext();
79
79
  const hasRedirected = react.useRef(false);
80
80
  react.useEffect(() => {
81
81
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -104,115 +104,115 @@ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
104
104
 
105
105
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
106
106
  enumerable: true,
107
- get: function () { return chunkJNR4AKL5_cjs.DEFAULT_API_BASE_URL; }
107
+ get: function () { return chunkHZZQ2BX7_cjs.DEFAULT_API_BASE_URL; }
108
108
  });
109
109
  Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
110
110
  enumerable: true,
111
- get: function () { return chunkJNR4AKL5_cjs.DEFAULT_OAUTH_SCOPES; }
111
+ get: function () { return chunkHZZQ2BX7_cjs.DEFAULT_OAUTH_SCOPES; }
112
112
  });
113
113
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
114
114
  enumerable: true,
115
- get: function () { return chunkJNR4AKL5_cjs.FFIDAnnouncementBadge; }
115
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDAnnouncementBadge; }
116
116
  });
117
117
  Object.defineProperty(exports, "FFIDAnnouncementList", {
118
118
  enumerable: true,
119
- get: function () { return chunkJNR4AKL5_cjs.FFIDAnnouncementList; }
119
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDAnnouncementList; }
120
120
  });
121
121
  Object.defineProperty(exports, "FFIDInquiryForm", {
122
122
  enumerable: true,
123
- get: function () { return chunkJNR4AKL5_cjs.FFIDInquiryForm; }
123
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDInquiryForm; }
124
124
  });
125
125
  Object.defineProperty(exports, "FFIDLoginButton", {
126
126
  enumerable: true,
127
- get: function () { return chunkJNR4AKL5_cjs.FFIDLoginButton; }
127
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDLoginButton; }
128
128
  });
129
129
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
130
130
  enumerable: true,
131
- get: function () { return chunkJNR4AKL5_cjs.FFIDOrganizationSwitcher; }
131
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDOrganizationSwitcher; }
132
132
  });
133
133
  Object.defineProperty(exports, "FFIDProvider", {
134
134
  enumerable: true,
135
- get: function () { return chunkJNR4AKL5_cjs.FFIDProvider; }
135
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDProvider; }
136
136
  });
137
137
  Object.defineProperty(exports, "FFIDSDKError", {
138
138
  enumerable: true,
139
- get: function () { return chunkJNR4AKL5_cjs.FFIDSDKError; }
139
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDSDKError; }
140
140
  });
141
141
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
142
142
  enumerable: true,
143
- get: function () { return chunkJNR4AKL5_cjs.FFIDSubscriptionBadge; }
143
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDSubscriptionBadge; }
144
144
  });
145
145
  Object.defineProperty(exports, "FFIDUserMenu", {
146
146
  enumerable: true,
147
- get: function () { return chunkJNR4AKL5_cjs.FFIDUserMenu; }
147
+ get: function () { return chunkHZZQ2BX7_cjs.FFIDUserMenu; }
148
148
  });
149
149
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
150
150
  enumerable: true,
151
- get: function () { return chunkJNR4AKL5_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
151
+ get: function () { return chunkHZZQ2BX7_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
152
152
  });
153
153
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
154
154
  enumerable: true,
155
- get: function () { return chunkJNR4AKL5_cjs.FFID_INQUIRY_CATEGORIES; }
155
+ get: function () { return chunkHZZQ2BX7_cjs.FFID_INQUIRY_CATEGORIES; }
156
156
  });
157
157
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
158
158
  enumerable: true,
159
- get: function () { return chunkJNR4AKL5_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
159
+ get: function () { return chunkHZZQ2BX7_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
160
160
  });
161
161
  Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
162
162
  enumerable: true,
163
- get: function () { return chunkJNR4AKL5_cjs.computeEffectiveStatusFromSession; }
163
+ get: function () { return chunkHZZQ2BX7_cjs.computeEffectiveStatusFromSession; }
164
164
  });
165
165
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
166
166
  enumerable: true,
167
- get: function () { return chunkJNR4AKL5_cjs.createFFIDAnnouncementsClient; }
167
+ get: function () { return chunkHZZQ2BX7_cjs.createFFIDAnnouncementsClient; }
168
168
  });
169
169
  Object.defineProperty(exports, "createFFIDClient", {
170
170
  enumerable: true,
171
- get: function () { return chunkJNR4AKL5_cjs.createFFIDClient; }
171
+ get: function () { return chunkHZZQ2BX7_cjs.createFFIDClient; }
172
172
  });
173
173
  Object.defineProperty(exports, "createTokenStore", {
174
174
  enumerable: true,
175
- get: function () { return chunkJNR4AKL5_cjs.createTokenStore; }
175
+ get: function () { return chunkHZZQ2BX7_cjs.createTokenStore; }
176
176
  });
177
177
  Object.defineProperty(exports, "generateCodeChallenge", {
178
178
  enumerable: true,
179
- get: function () { return chunkJNR4AKL5_cjs.generateCodeChallenge; }
179
+ get: function () { return chunkHZZQ2BX7_cjs.generateCodeChallenge; }
180
180
  });
181
181
  Object.defineProperty(exports, "generateCodeVerifier", {
182
182
  enumerable: true,
183
- get: function () { return chunkJNR4AKL5_cjs.generateCodeVerifier; }
183
+ get: function () { return chunkHZZQ2BX7_cjs.generateCodeVerifier; }
184
184
  });
185
185
  Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
186
186
  enumerable: true,
187
- get: function () { return chunkJNR4AKL5_cjs.isFFIDInquiryCategorySite2026; }
187
+ get: function () { return chunkHZZQ2BX7_cjs.isFFIDInquiryCategorySite2026; }
188
188
  });
189
189
  Object.defineProperty(exports, "normalizeRedirectUri", {
190
190
  enumerable: true,
191
- get: function () { return chunkJNR4AKL5_cjs.normalizeRedirectUri; }
191
+ get: function () { return chunkHZZQ2BX7_cjs.normalizeRedirectUri; }
192
192
  });
193
193
  Object.defineProperty(exports, "retrieveCodeVerifier", {
194
194
  enumerable: true,
195
- get: function () { return chunkJNR4AKL5_cjs.retrieveCodeVerifier; }
195
+ get: function () { return chunkHZZQ2BX7_cjs.retrieveCodeVerifier; }
196
196
  });
197
197
  Object.defineProperty(exports, "storeCodeVerifier", {
198
198
  enumerable: true,
199
- get: function () { return chunkJNR4AKL5_cjs.storeCodeVerifier; }
199
+ get: function () { return chunkHZZQ2BX7_cjs.storeCodeVerifier; }
200
200
  });
201
201
  Object.defineProperty(exports, "useFFID", {
202
202
  enumerable: true,
203
- get: function () { return chunkJNR4AKL5_cjs.useFFID; }
203
+ get: function () { return chunkHZZQ2BX7_cjs.useFFID; }
204
204
  });
205
205
  Object.defineProperty(exports, "useFFIDAnnouncements", {
206
206
  enumerable: true,
207
- get: function () { return chunkJNR4AKL5_cjs.useFFIDAnnouncements; }
207
+ get: function () { return chunkHZZQ2BX7_cjs.useFFIDAnnouncements; }
208
208
  });
209
209
  Object.defineProperty(exports, "useSubscription", {
210
210
  enumerable: true,
211
- get: function () { return chunkJNR4AKL5_cjs.useSubscription; }
211
+ get: function () { return chunkHZZQ2BX7_cjs.useSubscription; }
212
212
  });
213
213
  Object.defineProperty(exports, "withSubscription", {
214
214
  enumerable: true,
215
- get: function () { return chunkJNR4AKL5_cjs.withSubscription; }
215
+ get: function () { return chunkHZZQ2BX7_cjs.withSubscription; }
216
216
  });
217
217
  exports.FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS;
218
218
  exports.FFID_NEWSLETTER_TYPES = FFID_NEWSLETTER_TYPES;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-C3zyNa4j.cjs';
2
- export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-C3zyNa4j.cjs';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-COnReU8h.cjs';
2
+ export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-COnReU8h.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -493,17 +493,39 @@ interface ContractWizardSubscriptionOptions {
493
493
 
494
494
  /** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
495
495
 
496
+ /**
497
+ * `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
498
+ * Forwards to Supabase Auth signup screen; only the `'signup'` value is
499
+ * propagated (no-op when `'login'` or omitted).
500
+ */
501
+ declare const SCREEN_HINT_SIGNUP: "signup";
502
+ /** `screen_hint=login` (no-op marker; default screen is login) */
503
+ declare const SCREEN_HINT_LOGIN: "login";
496
504
  /** Options for redirectToAuthorize */
497
505
  interface RedirectToAuthorizeOptions {
498
506
  /** Target organization ID — triggers org-scoped OAuth re-authorization */
499
507
  organizationId?: string;
508
+ /**
509
+ * Initial Supabase Auth screen hint (#2908 / #2911).
510
+ *
511
+ * - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
512
+ * on the signup screen (used by external services that want to deep-link
513
+ * new users into the signup CTA).
514
+ * - `'login'` / `undefined`: no `screen_hint` param is added — the default
515
+ * login screen is shown.
516
+ *
517
+ * In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
518
+ * of `/login` so the SDK contract (signup-screen intent) stays consistent
519
+ * regardless of `authMode`.
520
+ */
521
+ screenHint?: typeof SCREEN_HINT_SIGNUP | typeof SCREEN_HINT_LOGIN;
500
522
  }
501
523
 
502
524
  /** Creates an FFID API client instance */
503
525
  declare function createFFIDClient(config: FFIDConfig): {
504
526
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
505
527
  signOut: () => Promise<FFIDApiResponse<void>>;
506
- redirectToLogin: () => Promise<FFIDRedirectResult>;
528
+ redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
507
529
  redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
508
530
  redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
509
531
  getLoginUrl: (redirectUrl?: string) => string;
@@ -679,8 +701,17 @@ interface UseFFIDReturn {
679
701
  isAuthenticated: boolean;
680
702
  /** Any authentication error that occurred */
681
703
  error: FFIDError | null;
682
- /** Redirect to login page */
683
- login: () => void;
704
+ /**
705
+ * Redirect to login page.
706
+ *
707
+ * @param options.screenHint `'signup'` to deep-link into the signup screen
708
+ * (forwards `screen_hint=signup` in token mode / redirects to `/signup`
709
+ * in cookie mode). `'login'` and `undefined` use the default login flow.
710
+ * See `RedirectToAuthorizeOptions` (#2908 / #2911).
711
+ */
712
+ login: (options?: {
713
+ screenHint?: 'signup' | 'login';
714
+ }) => void;
684
715
  /** Sign out */
685
716
  logout: () => Promise<void>;
686
717
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-C3zyNa4j.js';
2
- export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-C3zyNa4j.js';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-COnReU8h.js';
2
+ export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-COnReU8h.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -493,17 +493,39 @@ interface ContractWizardSubscriptionOptions {
493
493
 
494
494
  /** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
495
495
 
496
+ /**
497
+ * `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
498
+ * Forwards to Supabase Auth signup screen; only the `'signup'` value is
499
+ * propagated (no-op when `'login'` or omitted).
500
+ */
501
+ declare const SCREEN_HINT_SIGNUP: "signup";
502
+ /** `screen_hint=login` (no-op marker; default screen is login) */
503
+ declare const SCREEN_HINT_LOGIN: "login";
496
504
  /** Options for redirectToAuthorize */
497
505
  interface RedirectToAuthorizeOptions {
498
506
  /** Target organization ID — triggers org-scoped OAuth re-authorization */
499
507
  organizationId?: string;
508
+ /**
509
+ * Initial Supabase Auth screen hint (#2908 / #2911).
510
+ *
511
+ * - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
512
+ * on the signup screen (used by external services that want to deep-link
513
+ * new users into the signup CTA).
514
+ * - `'login'` / `undefined`: no `screen_hint` param is added — the default
515
+ * login screen is shown.
516
+ *
517
+ * In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
518
+ * of `/login` so the SDK contract (signup-screen intent) stays consistent
519
+ * regardless of `authMode`.
520
+ */
521
+ screenHint?: typeof SCREEN_HINT_SIGNUP | typeof SCREEN_HINT_LOGIN;
500
522
  }
501
523
 
502
524
  /** Creates an FFID API client instance */
503
525
  declare function createFFIDClient(config: FFIDConfig): {
504
526
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
505
527
  signOut: () => Promise<FFIDApiResponse<void>>;
506
- redirectToLogin: () => Promise<FFIDRedirectResult>;
528
+ redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
507
529
  redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
508
530
  redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
509
531
  getLoginUrl: (redirectUrl?: string) => string;
@@ -679,8 +701,17 @@ interface UseFFIDReturn {
679
701
  isAuthenticated: boolean;
680
702
  /** Any authentication error that occurred */
681
703
  error: FFIDError | null;
682
- /** Redirect to login page */
683
- login: () => void;
704
+ /**
705
+ * Redirect to login page.
706
+ *
707
+ * @param options.screenHint `'signup'` to deep-link into the signup screen
708
+ * (forwards `screen_hint=signup` in token mode / redirects to `/signup`
709
+ * in cookie mode). `'login'` and `undefined` use the default login flow.
710
+ * See `RedirectToAuthorizeOptions` (#2908 / #2911).
711
+ */
712
+ login: (options?: {
713
+ screenHint?: 'signup' | 'login';
714
+ }) => void;
684
715
  /** Sign out */
685
716
  logout: () => Promise<void>;
686
717
  /**
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-XWI4BFKW.js';
2
- export { DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-XWI4BFKW.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-RRN3DTET.js';
2
+ export { DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-RRN3DTET.js';
3
3
  import { useEffect, useRef } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -803,7 +803,7 @@ function createProfileMethods(deps) {
803
803
  }
804
804
 
805
805
  // src/client/version-check.ts
806
- var SDK_VERSION = "3.0.0";
806
+ var SDK_VERSION = "3.1.0";
807
807
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
808
808
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
809
809
  function sdkHeaders() {
@@ -1325,6 +1325,8 @@ function base64UrlEncode(buffer) {
1325
1325
  // src/client/redirect.ts
1326
1326
  var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
1327
1327
  var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
1328
+ var SCREEN_HINT_SIGNUP = "signup";
1329
+ var SCREEN_HINT_PARAM = "screen_hint";
1328
1330
  var STATE_RANDOM_BYTES = 16;
1329
1331
  var HEX_BASE2 = 16;
1330
1332
  var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
@@ -1492,6 +1494,9 @@ function createRedirectMethods(deps) {
1492
1494
  }
1493
1495
  params.set("organization_id", trimmedOrgId);
1494
1496
  }
1497
+ if (options?.screenHint === SCREEN_HINT_SIGNUP) {
1498
+ params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
1499
+ }
1495
1500
  const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
1496
1501
  logger.debug("Redirecting to authorize:", authorizeUrl);
1497
1502
  recordRedirectAttempt(authorizeKey, now, logger);
@@ -1503,18 +1508,17 @@ function createRedirectMethods(deps) {
1503
1508
  }
1504
1509
  return { success: true };
1505
1510
  }
1506
- async function redirectToLogin() {
1511
+ async function redirectToLogin(options) {
1507
1512
  if (typeof window === "undefined") {
1508
1513
  logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
1509
1514
  return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
1510
1515
  }
1511
1516
  if (authMode === "token") {
1512
- return redirectToAuthorize();
1517
+ return redirectToAuthorize(options);
1513
1518
  }
1514
- const currentUrl = window.location.href;
1515
- const loginUrl = `${baseUrl}/login?redirect=${encodeURIComponent(currentUrl)}&service=${encodeURIComponent(serviceCode)}`;
1516
- logger.debug("Redirecting to login:", loginUrl);
1517
- window.location.href = loginUrl;
1519
+ const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
1520
+ logger.debug("Redirecting to auth page:", targetUrl);
1521
+ window.location.href = targetUrl;
1518
1522
  return { success: true };
1519
1523
  }
1520
1524
  function getLoginUrl(redirectUrl) {
@@ -1,5 +1,5 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-B26jbUp5.cjs';
2
- export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-B26jbUp5.cjs';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DM_t1seS.cjs';
2
+ export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-DM_t1seS.cjs';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
4
4
 
5
5
  /** Token verification - verifyAccessToken() implementation */
@@ -1,5 +1,5 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-B26jbUp5.js';
2
- export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-B26jbUp5.js';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DM_t1seS.js';
2
+ export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-DM_t1seS.js';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.js';
4
4
 
5
5
  /** Token verification - verifyAccessToken() implementation */
@@ -802,7 +802,7 @@ function createProfileMethods(deps) {
802
802
  }
803
803
 
804
804
  // src/client/version-check.ts
805
- var SDK_VERSION = "3.0.0";
805
+ var SDK_VERSION = "3.1.0";
806
806
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
807
807
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
808
808
  function sdkHeaders() {
@@ -1324,6 +1324,8 @@ function base64UrlEncode(buffer) {
1324
1324
  // src/client/redirect.ts
1325
1325
  var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
1326
1326
  var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
1327
+ var SCREEN_HINT_SIGNUP = "signup";
1328
+ var SCREEN_HINT_PARAM = "screen_hint";
1327
1329
  var STATE_RANDOM_BYTES = 16;
1328
1330
  var HEX_BASE2 = 16;
1329
1331
  var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
@@ -1491,6 +1493,9 @@ function createRedirectMethods(deps) {
1491
1493
  }
1492
1494
  params.set("organization_id", trimmedOrgId);
1493
1495
  }
1496
+ if (options?.screenHint === SCREEN_HINT_SIGNUP) {
1497
+ params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
1498
+ }
1494
1499
  const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
1495
1500
  logger.debug("Redirecting to authorize:", authorizeUrl);
1496
1501
  recordRedirectAttempt(authorizeKey, now, logger);
@@ -1502,18 +1507,17 @@ function createRedirectMethods(deps) {
1502
1507
  }
1503
1508
  return { success: true };
1504
1509
  }
1505
- async function redirectToLogin() {
1510
+ async function redirectToLogin(options) {
1506
1511
  if (typeof window === "undefined") {
1507
1512
  logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
1508
1513
  return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
1509
1514
  }
1510
1515
  if (authMode === "token") {
1511
- return redirectToAuthorize();
1516
+ return redirectToAuthorize(options);
1512
1517
  }
1513
- const currentUrl = window.location.href;
1514
- const loginUrl = `${baseUrl}/login?redirect=${encodeURIComponent(currentUrl)}&service=${encodeURIComponent(serviceCode)}`;
1515
- logger.debug("Redirecting to login:", loginUrl);
1516
- window.location.href = loginUrl;
1518
+ const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
1519
+ logger.debug("Redirecting to auth page:", targetUrl);
1520
+ window.location.href = targetUrl;
1517
1521
  return { success: true };
1518
1522
  }
1519
1523
  function getLoginUrl(redirectUrl) {
@@ -1,4 +1,4 @@
1
- import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-B26jbUp5.cjs';
1
+ import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-DM_t1seS.cjs';
2
2
 
3
3
  /**
4
4
  * FFID SDK - Test mode client (E2E / integration test bypass)
@@ -1,4 +1,4 @@
1
- import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-B26jbUp5.js';
1
+ import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-DM_t1seS.js';
2
2
 
3
3
  /**
4
4
  * FFID SDK - Test mode client (E2E / integration test bypass)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",