@feelflow/ffid-sdk 5.24.2 → 5.24.3

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.
@@ -1,6 +1,47 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
3
3
 
4
+ /**
5
+ * Token Store
6
+ *
7
+ * Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
8
+ * Falls back to in-memory storage when localStorage is unavailable
9
+ * (e.g., Safari private browsing mode).
10
+ */
11
+ /**
12
+ * Token data stored by the token store
13
+ */
14
+ interface TokenData {
15
+ /** OAuth 2.0 access token */
16
+ accessToken: string;
17
+ /** OAuth 2.0 refresh token */
18
+ refreshToken: string;
19
+ /** Expiration timestamp in milliseconds (Unix epoch) */
20
+ expiresAt: number;
21
+ }
22
+ /**
23
+ * Token store interface for managing OAuth tokens
24
+ */
25
+ interface TokenStore {
26
+ /** Get stored tokens (null if not stored) */
27
+ getTokens(): TokenData | null;
28
+ /** Store new tokens */
29
+ setTokens(tokens: TokenData): void;
30
+ /** Clear all stored tokens */
31
+ clearTokens(): void;
32
+ /** Check if access token is expired (with 30s buffer) */
33
+ isAccessTokenExpired(): boolean;
34
+ }
35
+ /**
36
+ * Create a token store with the specified storage type.
37
+ *
38
+ * When storageType is 'localStorage' (default in browser), falls back
39
+ * to memory if localStorage is not available (e.g., Safari private mode).
40
+ *
41
+ * @param storageType - 'localStorage' (default) or 'memory'
42
+ */
43
+ declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
44
+
4
45
  /** Cache adapter interface for FFID SDK token verification */
5
46
  /**
6
47
  * Pluggable cache adapter interface.
@@ -474,6 +515,29 @@ interface FFIDConfig {
474
515
  * @default undefined (no timeout, uses fetch default)
475
516
  */
476
517
  timeout?: number | undefined;
518
+ /**
519
+ * Token mode only: inject a shared {@link TokenStore} instance so the SDK and
520
+ * the host app read/write the *same* token source (#4318).
521
+ *
522
+ * By default the client creates its own store internally
523
+ * (`createTokenStore()` in `token` mode, `createTokenStore('memory')`
524
+ * otherwise). That is fine when `localStorage` is available, because a
525
+ * separately-created `localStorage` store still points at the same
526
+ * `ffid_tokens` key. But when `localStorage` is unavailable (e.g. Safari
527
+ * Private Mode) the SDK falls back to an *in-memory* store, and a store the
528
+ * host app creates independently is a **different** object — so the app would
529
+ * see the user as signed-out even though the SDK holds valid tokens.
530
+ *
531
+ * Passing a single instance here (typically `createTokenStore()` created once
532
+ * by the host) guarantees both sides share one source of truth regardless of
533
+ * storage backend. Prefer reading the token via `useFFID().getAccessToken()`
534
+ * so refresh/logout stay reflected without the host polling the store.
535
+ *
536
+ * Ignored in `cookie` and `service-key` modes (neither exposes a browser
537
+ * access-token store). When omitted, behavior is unchanged from previous
538
+ * versions.
539
+ */
540
+ tokenStore?: TokenStore | undefined;
477
541
  }
478
542
  /**
479
543
  * FFID JWT claims structure (minimal payload).
@@ -556,6 +620,18 @@ interface FFIDContextValue {
556
620
  switchOrganization: (organizationId: string) => void;
557
621
  /** Refresh session data */
558
622
  refresh: () => Promise<void>;
623
+ /**
624
+ * Token mode: return the currently-stored access token, or `null` when there
625
+ * is none, it is empty, or it is expired (30s buffer, same as
626
+ * `TokenStore.isAccessTokenExpired`). Reads the store live on every call, so a
627
+ * token the SDK refreshed in the background is reflected without the host
628
+ * caching or polling it (#4318).
629
+ *
630
+ * Always returns `null` in `cookie` / `service-key` mode (no browser access
631
+ * token to expose). This is a stable function reference — safe to call in
632
+ * render or event handlers without adding it to effect dependency arrays.
633
+ */
634
+ getAccessToken: () => string | null;
559
635
  }
560
636
  /**
561
637
  * Subscription context value
@@ -1526,4 +1602,4 @@ interface FFIDInquiryFormPlaceholderContext {
1526
1602
  }
1527
1603
  declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
1528
1604
 
1529
- export { type FFIDInquiryFormSubmitResult as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, EFFECTIVE_SUBSCRIPTION_STATUSES as G, FFIDAnnouncementBadge as H, FFIDAnnouncementList as I, type FFIDAnnouncementsError as J, type FFIDAnnouncementsErrorCode as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsServerResponse as M, type FFIDApiResponseMeta as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type FFIDInquiryFormCategoryItem as T, type FFIDInquiryFormClassNames as U, type FFIDInquiryFormLegalLayout as V, type FFIDInquiryFormOrganization as W, type FFIDInquiryFormPlaceholderContext as X, type FFIDInquiryFormPrefill as Y, type FFIDInquiryFormProps as Z, type FFIDInquiryFormSubmitData as _, type FFIDPrompt as a, type FFIDJwtClaims as a0, FFIDLoginButton as a1, type FFIDOAuthTokenResponse as a2, type FFIDOAuthUserInfoMemberRole as a3, FFIDOrganizationSwitcher as a4, type FFIDRedirectErrorCode as a5, type FFIDSeatModel as a6, type FFIDServiceAccessDenialReason as a7, type FFIDServiceAccessFailPolicy as a8, FFIDSubscriptionBadge as a9, type FFIDTokenIntrospectionResponse as aa, FFIDUserMenu as ab, FFID_INQUIRY_CATEGORIES as ac, FFID_INQUIRY_CATEGORIES_SITE_2026 as ad, type UseFFIDAnnouncementsOptions as ae, type UseFFIDAnnouncementsReturn as af, isFFIDInquiryCategorySite2026 as ag, useFFIDAnnouncements as ah, type FFIDAnnouncementBadgeClassNames as ai, type FFIDAnnouncementBadgeProps as aj, type FFIDAnnouncementListClassNames as ak, type FFIDAnnouncementListProps as al, type FFIDLoginButtonProps as am, type FFIDOrganizationSwitcherClassNames as an, type FFIDOrganizationSwitcherProps as ao, type FFIDSubscriptionBadgeClassNames as ap, type FFIDSubscriptionBadgeProps as aq, type FFIDUserMenuClassNames as ar, type FFIDUserMenuProps as as, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDSignOutResult as e, type FFIDRedirectResult as f, type FFIDError as g, type FFIDSubscriptionCheckResponse as h, type FFIDCheckServiceAccessParams as i, type FFIDServiceAccessDecision as j, type FFIDAnalyticsConfig as k, type FFIDVerifyAccessTokenOptions as l, type FFIDOAuthUserInfo as m, type FFIDInquiryCreateParams as n, type FFIDInquiryCreateResponse as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDOAuthUserInfoSubscription as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
1605
+ export { type FFIDInquiryFormSubmitData as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, EFFECTIVE_SUBSCRIPTION_STATUSES as G, FFIDAnnouncementBadge as H, FFIDAnnouncementList as I, type FFIDAnnouncementsError as J, type FFIDAnnouncementsErrorCode as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsServerResponse as M, type FFIDApiResponseMeta as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type TokenStore as T, type FFIDInquiryFormCategoryItem as U, type FFIDInquiryFormClassNames as V, type FFIDInquiryFormLegalLayout as W, type FFIDInquiryFormOrganization as X, type FFIDInquiryFormPlaceholderContext as Y, type FFIDInquiryFormPrefill as Z, type FFIDInquiryFormProps as _, type FFIDPrompt as a, type FFIDInquiryFormSubmitResult as a0, type FFIDJwtClaims as a1, FFIDLoginButton as a2, type FFIDOAuthTokenResponse as a3, type FFIDOAuthUserInfoMemberRole as a4, FFIDOrganizationSwitcher as a5, type FFIDRedirectErrorCode as a6, type FFIDSeatModel as a7, type FFIDServiceAccessDenialReason as a8, type FFIDServiceAccessFailPolicy as a9, FFIDSubscriptionBadge as aa, type FFIDTokenIntrospectionResponse as ab, FFIDUserMenu as ac, FFID_INQUIRY_CATEGORIES as ad, FFID_INQUIRY_CATEGORIES_SITE_2026 as ae, type TokenData as af, type UseFFIDAnnouncementsOptions as ag, type UseFFIDAnnouncementsReturn as ah, createTokenStore as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDSignOutResult as e, type FFIDRedirectResult as f, type FFIDError as g, type FFIDSubscriptionCheckResponse as h, type FFIDCheckServiceAccessParams as i, type FFIDServiceAccessDecision as j, type FFIDAnalyticsConfig as k, type FFIDVerifyAccessTokenOptions as l, type FFIDOAuthUserInfo as m, type FFIDInquiryCreateParams as n, type FFIDInquiryCreateResponse as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDOAuthUserInfoSubscription as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
@@ -1,6 +1,47 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
3
3
 
4
+ /**
5
+ * Token Store
6
+ *
7
+ * Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
8
+ * Falls back to in-memory storage when localStorage is unavailable
9
+ * (e.g., Safari private browsing mode).
10
+ */
11
+ /**
12
+ * Token data stored by the token store
13
+ */
14
+ interface TokenData {
15
+ /** OAuth 2.0 access token */
16
+ accessToken: string;
17
+ /** OAuth 2.0 refresh token */
18
+ refreshToken: string;
19
+ /** Expiration timestamp in milliseconds (Unix epoch) */
20
+ expiresAt: number;
21
+ }
22
+ /**
23
+ * Token store interface for managing OAuth tokens
24
+ */
25
+ interface TokenStore {
26
+ /** Get stored tokens (null if not stored) */
27
+ getTokens(): TokenData | null;
28
+ /** Store new tokens */
29
+ setTokens(tokens: TokenData): void;
30
+ /** Clear all stored tokens */
31
+ clearTokens(): void;
32
+ /** Check if access token is expired (with 30s buffer) */
33
+ isAccessTokenExpired(): boolean;
34
+ }
35
+ /**
36
+ * Create a token store with the specified storage type.
37
+ *
38
+ * When storageType is 'localStorage' (default in browser), falls back
39
+ * to memory if localStorage is not available (e.g., Safari private mode).
40
+ *
41
+ * @param storageType - 'localStorage' (default) or 'memory'
42
+ */
43
+ declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
44
+
4
45
  /** Cache adapter interface for FFID SDK token verification */
5
46
  /**
6
47
  * Pluggable cache adapter interface.
@@ -474,6 +515,29 @@ interface FFIDConfig {
474
515
  * @default undefined (no timeout, uses fetch default)
475
516
  */
476
517
  timeout?: number | undefined;
518
+ /**
519
+ * Token mode only: inject a shared {@link TokenStore} instance so the SDK and
520
+ * the host app read/write the *same* token source (#4318).
521
+ *
522
+ * By default the client creates its own store internally
523
+ * (`createTokenStore()` in `token` mode, `createTokenStore('memory')`
524
+ * otherwise). That is fine when `localStorage` is available, because a
525
+ * separately-created `localStorage` store still points at the same
526
+ * `ffid_tokens` key. But when `localStorage` is unavailable (e.g. Safari
527
+ * Private Mode) the SDK falls back to an *in-memory* store, and a store the
528
+ * host app creates independently is a **different** object — so the app would
529
+ * see the user as signed-out even though the SDK holds valid tokens.
530
+ *
531
+ * Passing a single instance here (typically `createTokenStore()` created once
532
+ * by the host) guarantees both sides share one source of truth regardless of
533
+ * storage backend. Prefer reading the token via `useFFID().getAccessToken()`
534
+ * so refresh/logout stay reflected without the host polling the store.
535
+ *
536
+ * Ignored in `cookie` and `service-key` modes (neither exposes a browser
537
+ * access-token store). When omitted, behavior is unchanged from previous
538
+ * versions.
539
+ */
540
+ tokenStore?: TokenStore | undefined;
477
541
  }
478
542
  /**
479
543
  * FFID JWT claims structure (minimal payload).
@@ -556,6 +620,18 @@ interface FFIDContextValue {
556
620
  switchOrganization: (organizationId: string) => void;
557
621
  /** Refresh session data */
558
622
  refresh: () => Promise<void>;
623
+ /**
624
+ * Token mode: return the currently-stored access token, or `null` when there
625
+ * is none, it is empty, or it is expired (30s buffer, same as
626
+ * `TokenStore.isAccessTokenExpired`). Reads the store live on every call, so a
627
+ * token the SDK refreshed in the background is reflected without the host
628
+ * caching or polling it (#4318).
629
+ *
630
+ * Always returns `null` in `cookie` / `service-key` mode (no browser access
631
+ * token to expose). This is a stable function reference — safe to call in
632
+ * render or event handlers without adding it to effect dependency arrays.
633
+ */
634
+ getAccessToken: () => string | null;
559
635
  }
560
636
  /**
561
637
  * Subscription context value
@@ -1526,4 +1602,4 @@ interface FFIDInquiryFormPlaceholderContext {
1526
1602
  }
1527
1603
  declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
1528
1604
 
1529
- export { type FFIDInquiryFormSubmitResult as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, EFFECTIVE_SUBSCRIPTION_STATUSES as G, FFIDAnnouncementBadge as H, FFIDAnnouncementList as I, type FFIDAnnouncementsError as J, type FFIDAnnouncementsErrorCode as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsServerResponse as M, type FFIDApiResponseMeta as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type FFIDInquiryFormCategoryItem as T, type FFIDInquiryFormClassNames as U, type FFIDInquiryFormLegalLayout as V, type FFIDInquiryFormOrganization as W, type FFIDInquiryFormPlaceholderContext as X, type FFIDInquiryFormPrefill as Y, type FFIDInquiryFormProps as Z, type FFIDInquiryFormSubmitData as _, type FFIDPrompt as a, type FFIDJwtClaims as a0, FFIDLoginButton as a1, type FFIDOAuthTokenResponse as a2, type FFIDOAuthUserInfoMemberRole as a3, FFIDOrganizationSwitcher as a4, type FFIDRedirectErrorCode as a5, type FFIDSeatModel as a6, type FFIDServiceAccessDenialReason as a7, type FFIDServiceAccessFailPolicy as a8, FFIDSubscriptionBadge as a9, type FFIDTokenIntrospectionResponse as aa, FFIDUserMenu as ab, FFID_INQUIRY_CATEGORIES as ac, FFID_INQUIRY_CATEGORIES_SITE_2026 as ad, type UseFFIDAnnouncementsOptions as ae, type UseFFIDAnnouncementsReturn as af, isFFIDInquiryCategorySite2026 as ag, useFFIDAnnouncements as ah, type FFIDAnnouncementBadgeClassNames as ai, type FFIDAnnouncementBadgeProps as aj, type FFIDAnnouncementListClassNames as ak, type FFIDAnnouncementListProps as al, type FFIDLoginButtonProps as am, type FFIDOrganizationSwitcherClassNames as an, type FFIDOrganizationSwitcherProps as ao, type FFIDSubscriptionBadgeClassNames as ap, type FFIDSubscriptionBadgeProps as aq, type FFIDUserMenuClassNames as ar, type FFIDUserMenuProps as as, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDSignOutResult as e, type FFIDRedirectResult as f, type FFIDError as g, type FFIDSubscriptionCheckResponse as h, type FFIDCheckServiceAccessParams as i, type FFIDServiceAccessDecision as j, type FFIDAnalyticsConfig as k, type FFIDVerifyAccessTokenOptions as l, type FFIDOAuthUserInfo as m, type FFIDInquiryCreateParams as n, type FFIDInquiryCreateResponse as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDOAuthUserInfoSubscription as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
1605
+ export { type FFIDInquiryFormSubmitData as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, EFFECTIVE_SUBSCRIPTION_STATUSES as G, FFIDAnnouncementBadge as H, FFIDAnnouncementList as I, type FFIDAnnouncementsError as J, type FFIDAnnouncementsErrorCode as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsServerResponse as M, type FFIDApiResponseMeta as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type TokenStore as T, type FFIDInquiryFormCategoryItem as U, type FFIDInquiryFormClassNames as V, type FFIDInquiryFormLegalLayout as W, type FFIDInquiryFormOrganization as X, type FFIDInquiryFormPlaceholderContext as Y, type FFIDInquiryFormPrefill as Z, type FFIDInquiryFormProps as _, type FFIDPrompt as a, type FFIDInquiryFormSubmitResult as a0, type FFIDJwtClaims as a1, FFIDLoginButton as a2, type FFIDOAuthTokenResponse as a3, type FFIDOAuthUserInfoMemberRole as a4, FFIDOrganizationSwitcher as a5, type FFIDRedirectErrorCode as a6, type FFIDSeatModel as a7, type FFIDServiceAccessDenialReason as a8, type FFIDServiceAccessFailPolicy as a9, FFIDSubscriptionBadge as aa, type FFIDTokenIntrospectionResponse as ab, FFIDUserMenu as ac, FFID_INQUIRY_CATEGORIES as ad, FFID_INQUIRY_CATEGORIES_SITE_2026 as ae, type TokenData as af, type UseFFIDAnnouncementsOptions as ag, type UseFFIDAnnouncementsReturn as ah, createTokenStore as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDSignOutResult as e, type FFIDRedirectResult as f, type FFIDError as g, type FFIDSubscriptionCheckResponse as h, type FFIDCheckServiceAccessParams as i, type FFIDServiceAccessDecision as j, type FFIDAnalyticsConfig as k, type FFIDVerifyAccessTokenOptions as l, type FFIDOAuthUserInfo as m, type FFIDInquiryCreateParams as n, type FFIDInquiryCreateResponse as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDOAuthUserInfoSubscription as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQMWUOVZK_cjs = require('./chunk-QMWUOVZK.cjs');
3
+ var chunkAMVL7J2G_cjs = require('./chunk-AMVL7J2G.cjs');
4
4
  var chunkH5O2CCAY_cjs = require('./chunk-H5O2CCAY.cjs');
5
5
  var react = require('react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
@@ -54,8 +54,8 @@ function defaultRedirect(url) {
54
54
  }
55
55
  function useRequireActiveSubscription(options) {
56
56
  const { redirectTo, allowGrace = true, onRedirect } = options;
57
- const { isLoading, error } = chunkQMWUOVZK_cjs.useFFIDContext();
58
- const { effectiveStatus, isBlocked, isGrace } = chunkQMWUOVZK_cjs.useSubscription();
57
+ const { isLoading, error } = chunkAMVL7J2G_cjs.useFFIDContext();
58
+ const { effectiveStatus, isBlocked, isGrace } = chunkAMVL7J2G_cjs.useSubscription();
59
59
  const hasFetchError = error !== null && effectiveStatus === null;
60
60
  const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
61
61
  react.useEffect(() => {
@@ -76,7 +76,7 @@ function useRequireActiveSubscription(options) {
76
76
  }
77
77
  function withFFIDAuth(Component, options = {}) {
78
78
  const WrappedComponent = (props) => {
79
- const { isLoading, isAuthenticated, login } = chunkQMWUOVZK_cjs.useFFIDContext();
79
+ const { isLoading, isAuthenticated, login } = chunkAMVL7J2G_cjs.useFFIDContext();
80
80
  const hasRedirected = react.useRef(false);
81
81
  react.useEffect(() => {
82
82
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -105,155 +105,155 @@ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
105
105
 
106
106
  Object.defineProperty(exports, "ACCESS_GRANTING_EFFECTIVE_STATUSES", {
107
107
  enumerable: true,
108
- get: function () { return chunkQMWUOVZK_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
108
+ get: function () { return chunkAMVL7J2G_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
109
109
  });
110
110
  Object.defineProperty(exports, "BLOCKING_EFFECTIVE_STATUSES", {
111
111
  enumerable: true,
112
- get: function () { return chunkQMWUOVZK_cjs.BLOCKING_EFFECTIVE_STATUSES; }
112
+ get: function () { return chunkAMVL7J2G_cjs.BLOCKING_EFFECTIVE_STATUSES; }
113
113
  });
114
114
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
115
115
  enumerable: true,
116
- get: function () { return chunkQMWUOVZK_cjs.DEFAULT_API_BASE_URL; }
116
+ get: function () { return chunkAMVL7J2G_cjs.DEFAULT_API_BASE_URL; }
117
117
  });
118
118
  Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
119
119
  enumerable: true,
120
- get: function () { return chunkQMWUOVZK_cjs.DEFAULT_OAUTH_SCOPES; }
120
+ get: function () { return chunkAMVL7J2G_cjs.DEFAULT_OAUTH_SCOPES; }
121
121
  });
122
122
  Object.defineProperty(exports, "EFFECTIVE_SUBSCRIPTION_STATUSES", {
123
123
  enumerable: true,
124
- get: function () { return chunkQMWUOVZK_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
124
+ get: function () { return chunkAMVL7J2G_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
125
125
  });
126
126
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
127
127
  enumerable: true,
128
- get: function () { return chunkQMWUOVZK_cjs.FFIDAnnouncementBadge; }
128
+ get: function () { return chunkAMVL7J2G_cjs.FFIDAnnouncementBadge; }
129
129
  });
130
130
  Object.defineProperty(exports, "FFIDAnnouncementList", {
131
131
  enumerable: true,
132
- get: function () { return chunkQMWUOVZK_cjs.FFIDAnnouncementList; }
132
+ get: function () { return chunkAMVL7J2G_cjs.FFIDAnnouncementList; }
133
133
  });
134
134
  Object.defineProperty(exports, "FFIDInquiryForm", {
135
135
  enumerable: true,
136
- get: function () { return chunkQMWUOVZK_cjs.FFIDInquiryForm; }
136
+ get: function () { return chunkAMVL7J2G_cjs.FFIDInquiryForm; }
137
137
  });
138
138
  Object.defineProperty(exports, "FFIDLoginButton", {
139
139
  enumerable: true,
140
- get: function () { return chunkQMWUOVZK_cjs.FFIDLoginButton; }
140
+ get: function () { return chunkAMVL7J2G_cjs.FFIDLoginButton; }
141
141
  });
142
142
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
143
143
  enumerable: true,
144
- get: function () { return chunkQMWUOVZK_cjs.FFIDOrganizationSwitcher; }
144
+ get: function () { return chunkAMVL7J2G_cjs.FFIDOrganizationSwitcher; }
145
145
  });
146
146
  Object.defineProperty(exports, "FFIDProvider", {
147
147
  enumerable: true,
148
- get: function () { return chunkQMWUOVZK_cjs.FFIDProvider; }
148
+ get: function () { return chunkAMVL7J2G_cjs.FFIDProvider; }
149
149
  });
150
150
  Object.defineProperty(exports, "FFIDSDKError", {
151
151
  enumerable: true,
152
- get: function () { return chunkQMWUOVZK_cjs.FFIDSDKError; }
152
+ get: function () { return chunkAMVL7J2G_cjs.FFIDSDKError; }
153
153
  });
154
154
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
155
155
  enumerable: true,
156
- get: function () { return chunkQMWUOVZK_cjs.FFIDSubscriptionBadge; }
156
+ get: function () { return chunkAMVL7J2G_cjs.FFIDSubscriptionBadge; }
157
157
  });
158
158
  Object.defineProperty(exports, "FFIDUserMenu", {
159
159
  enumerable: true,
160
- get: function () { return chunkQMWUOVZK_cjs.FFIDUserMenu; }
160
+ get: function () { return chunkAMVL7J2G_cjs.FFIDUserMenu; }
161
161
  });
162
162
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
163
163
  enumerable: true,
164
- get: function () { return chunkQMWUOVZK_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
164
+ get: function () { return chunkAMVL7J2G_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
165
165
  });
166
166
  Object.defineProperty(exports, "FFID_ERROR_CODES", {
167
167
  enumerable: true,
168
- get: function () { return chunkQMWUOVZK_cjs.FFID_ERROR_CODES; }
168
+ get: function () { return chunkAMVL7J2G_cjs.FFID_ERROR_CODES; }
169
169
  });
170
170
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
171
171
  enumerable: true,
172
- get: function () { return chunkQMWUOVZK_cjs.FFID_INQUIRY_CATEGORIES; }
172
+ get: function () { return chunkAMVL7J2G_cjs.FFID_INQUIRY_CATEGORIES; }
173
173
  });
174
174
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
175
175
  enumerable: true,
176
- get: function () { return chunkQMWUOVZK_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
176
+ get: function () { return chunkAMVL7J2G_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
177
177
  });
178
178
  Object.defineProperty(exports, "clearState", {
179
179
  enumerable: true,
180
- get: function () { return chunkQMWUOVZK_cjs.cleanupStateStorage; }
180
+ get: function () { return chunkAMVL7J2G_cjs.cleanupStateStorage; }
181
181
  });
182
182
  Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
183
183
  enumerable: true,
184
- get: function () { return chunkQMWUOVZK_cjs.computeEffectiveStatusFromSession; }
184
+ get: function () { return chunkAMVL7J2G_cjs.computeEffectiveStatusFromSession; }
185
185
  });
186
186
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
187
187
  enumerable: true,
188
- get: function () { return chunkQMWUOVZK_cjs.createFFIDAnnouncementsClient; }
188
+ get: function () { return chunkAMVL7J2G_cjs.createFFIDAnnouncementsClient; }
189
189
  });
190
190
  Object.defineProperty(exports, "createFFIDClient", {
191
191
  enumerable: true,
192
- get: function () { return chunkQMWUOVZK_cjs.createFFIDClient; }
192
+ get: function () { return chunkAMVL7J2G_cjs.createFFIDClient; }
193
193
  });
194
194
  Object.defineProperty(exports, "createTokenStore", {
195
195
  enumerable: true,
196
- get: function () { return chunkQMWUOVZK_cjs.createTokenStore; }
196
+ get: function () { return chunkAMVL7J2G_cjs.createTokenStore; }
197
197
  });
198
198
  Object.defineProperty(exports, "generateCodeChallenge", {
199
199
  enumerable: true,
200
- get: function () { return chunkQMWUOVZK_cjs.generateCodeChallenge; }
200
+ get: function () { return chunkAMVL7J2G_cjs.generateCodeChallenge; }
201
201
  });
202
202
  Object.defineProperty(exports, "generateCodeVerifier", {
203
203
  enumerable: true,
204
- get: function () { return chunkQMWUOVZK_cjs.generateCodeVerifier; }
204
+ get: function () { return chunkAMVL7J2G_cjs.generateCodeVerifier; }
205
205
  });
206
206
  Object.defineProperty(exports, "handleRedirectCallback", {
207
207
  enumerable: true,
208
- get: function () { return chunkQMWUOVZK_cjs.handleRedirectCallback; }
208
+ get: function () { return chunkAMVL7J2G_cjs.handleRedirectCallback; }
209
209
  });
210
210
  Object.defineProperty(exports, "hasAccessFromUserinfo", {
211
211
  enumerable: true,
212
- get: function () { return chunkQMWUOVZK_cjs.hasAccessFromUserinfo; }
212
+ get: function () { return chunkAMVL7J2G_cjs.hasAccessFromUserinfo; }
213
213
  });
214
214
  Object.defineProperty(exports, "isBlockedFromUserinfo", {
215
215
  enumerable: true,
216
- get: function () { return chunkQMWUOVZK_cjs.isBlockedFromUserinfo; }
216
+ get: function () { return chunkAMVL7J2G_cjs.isBlockedFromUserinfo; }
217
217
  });
218
218
  Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
219
219
  enumerable: true,
220
- get: function () { return chunkQMWUOVZK_cjs.isFFIDInquiryCategorySite2026; }
220
+ get: function () { return chunkAMVL7J2G_cjs.isFFIDInquiryCategorySite2026; }
221
221
  });
222
222
  Object.defineProperty(exports, "normalizeRedirectUri", {
223
223
  enumerable: true,
224
- get: function () { return chunkQMWUOVZK_cjs.normalizeRedirectUri; }
224
+ get: function () { return chunkAMVL7J2G_cjs.normalizeRedirectUri; }
225
225
  });
226
226
  Object.defineProperty(exports, "retrieveCodeVerifier", {
227
227
  enumerable: true,
228
- get: function () { return chunkQMWUOVZK_cjs.retrieveCodeVerifier; }
228
+ get: function () { return chunkAMVL7J2G_cjs.retrieveCodeVerifier; }
229
229
  });
230
230
  Object.defineProperty(exports, "retrieveState", {
231
231
  enumerable: true,
232
- get: function () { return chunkQMWUOVZK_cjs.retrieveState; }
232
+ get: function () { return chunkAMVL7J2G_cjs.retrieveState; }
233
233
  });
234
234
  Object.defineProperty(exports, "storeCodeVerifier", {
235
235
  enumerable: true,
236
- get: function () { return chunkQMWUOVZK_cjs.storeCodeVerifier; }
236
+ get: function () { return chunkAMVL7J2G_cjs.storeCodeVerifier; }
237
237
  });
238
238
  Object.defineProperty(exports, "storeState", {
239
239
  enumerable: true,
240
- get: function () { return chunkQMWUOVZK_cjs.storeState; }
240
+ get: function () { return chunkAMVL7J2G_cjs.storeState; }
241
241
  });
242
242
  Object.defineProperty(exports, "useFFID", {
243
243
  enumerable: true,
244
- get: function () { return chunkQMWUOVZK_cjs.useFFID; }
244
+ get: function () { return chunkAMVL7J2G_cjs.useFFID; }
245
245
  });
246
246
  Object.defineProperty(exports, "useFFIDAnnouncements", {
247
247
  enumerable: true,
248
- get: function () { return chunkQMWUOVZK_cjs.useFFIDAnnouncements; }
248
+ get: function () { return chunkAMVL7J2G_cjs.useFFIDAnnouncements; }
249
249
  });
250
250
  Object.defineProperty(exports, "useSubscription", {
251
251
  enumerable: true,
252
- get: function () { return chunkQMWUOVZK_cjs.useSubscription; }
252
+ get: function () { return chunkAMVL7J2G_cjs.useSubscription; }
253
253
  });
254
254
  Object.defineProperty(exports, "withSubscription", {
255
255
  enumerable: true,
256
- get: function () { return chunkQMWUOVZK_cjs.withSubscription; }
256
+ get: function () { return chunkAMVL7J2G_cjs.withSubscription; }
257
257
  });
258
258
  Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
259
259
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDSignOutResult, f as FFIDRedirectResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDVerifyAccessTokenOptions, m as FFIDOAuthUserInfo, n as FFIDInquiryCreateParams, o as FFIDInquiryCreateResponse, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, w as FFIDOAuthUserInfoSubscription, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-GqflEaKi.cjs';
2
- export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryCategory, R as FFIDInquiryCategorySite2026, S as FFIDInquiryForm, T as FFIDInquiryFormCategoryItem, U as FFIDInquiryFormClassNames, V as FFIDInquiryFormLegalLayout, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a0 as FFIDJwtClaims, a1 as FFIDLoginButton, a2 as FFIDOAuthTokenResponse, a3 as FFIDOAuthUserInfoMemberRole, a4 as FFIDOrganizationSwitcher, a5 as FFIDRedirectErrorCode, a6 as FFIDSeatModel, a7 as FFIDServiceAccessDenialReason, a8 as FFIDServiceAccessFailPolicy, a9 as FFIDSubscriptionBadge, aa as FFIDTokenIntrospectionResponse, ab as FFIDUserMenu, ac as FFID_INQUIRY_CATEGORIES, ad as FFID_INQUIRY_CATEGORIES_SITE_2026, ae as UseFFIDAnnouncementsOptions, af as UseFFIDAnnouncementsReturn, ag as isFFIDInquiryCategorySite2026, ah as useFFIDAnnouncements } from './index-GqflEaKi.cjs';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDSignOutResult, f as FFIDRedirectResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDVerifyAccessTokenOptions, m as FFIDOAuthUserInfo, n as FFIDInquiryCreateParams, o as FFIDInquiryCreateResponse, T as TokenStore, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, w as FFIDOAuthUserInfoSubscription, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-BRMn6xT0.cjs';
2
+ export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryCategory, R as FFIDInquiryCategorySite2026, S as FFIDInquiryForm, U as FFIDInquiryFormCategoryItem, V as FFIDInquiryFormClassNames, W as FFIDInquiryFormLegalLayout, X as FFIDInquiryFormOrganization, Y as FFIDInquiryFormPlaceholderContext, Z as FFIDInquiryFormPrefill, _ as FFIDInquiryFormProps, $ as FFIDInquiryFormSubmitData, a0 as FFIDInquiryFormSubmitResult, a1 as FFIDJwtClaims, a2 as FFIDLoginButton, a3 as FFIDOAuthTokenResponse, a4 as FFIDOAuthUserInfoMemberRole, a5 as FFIDOrganizationSwitcher, a6 as FFIDRedirectErrorCode, a7 as FFIDSeatModel, a8 as FFIDServiceAccessDenialReason, a9 as FFIDServiceAccessFailPolicy, aa as FFIDSubscriptionBadge, ab as FFIDTokenIntrospectionResponse, ac as FFIDUserMenu, ad as FFID_INQUIRY_CATEGORIES, ae as FFID_INQUIRY_CATEGORIES_SITE_2026, af as TokenData, ag as UseFFIDAnnouncementsOptions, ah as UseFFIDAnnouncementsReturn, ai as createTokenStore, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-BRMn6xT0.cjs';
3
3
  export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, o as FFIDAnalyticsProvider, p as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, r as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, w as FFIDConsentError, x as FFIDConsentErrorCode, y as FFIDConsentMergeStrategy, B as FFIDConsentMergeWarning, E as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, I as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, M as FFIDCookieBanner, N as FFIDCookieBannerClassNames, O as FFIDCookieBannerProps, Q as FFIDCookieLink, R as FFIDCookieLinkProps, f as FFIDCookiePolicy, T as FFIDCookieSettings, U as FFIDCookieSettingsClassNames, V as FFIDCookieSettingsProps, _ as FFID_CONSENT_ERROR_CODES, ae as UseFFIDConsentPreferencesReturn, af as UseFFIDConsentReturn, ag as clearConsentDismissalTimestamp, aj as decodeConsentCookie, al as encodeConsentCookie, an as readConsentCookie, ao as readConsentDismissalTimestamp, aq as useFFIDConsent, ar as useFFIDConsentPreferences, as as writeConsentCookie, at as writeConsentDismissalTimestamp } from './FFIDCookieLink-BJgVcJyw.cjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ReactNode, ComponentType, FC } from 'react';
@@ -39,47 +39,6 @@ declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
39
39
  */
40
40
  declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
41
41
 
42
- /**
43
- * Token Store
44
- *
45
- * Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
46
- * Falls back to in-memory storage when localStorage is unavailable
47
- * (e.g., Safari private browsing mode).
48
- */
49
- /**
50
- * Token data stored by the token store
51
- */
52
- interface TokenData {
53
- /** OAuth 2.0 access token */
54
- accessToken: string;
55
- /** OAuth 2.0 refresh token */
56
- refreshToken: string;
57
- /** Expiration timestamp in milliseconds (Unix epoch) */
58
- expiresAt: number;
59
- }
60
- /**
61
- * Token store interface for managing OAuth tokens
62
- */
63
- interface TokenStore {
64
- /** Get stored tokens (null if not stored) */
65
- getTokens(): TokenData | null;
66
- /** Store new tokens */
67
- setTokens(tokens: TokenData): void;
68
- /** Clear all stored tokens */
69
- clearTokens(): void;
70
- /** Check if access token is expired (with 30s buffer) */
71
- isAccessTokenExpired(): boolean;
72
- }
73
- /**
74
- * Create a token store with the specified storage type.
75
- *
76
- * When storageType is 'localStorage' (default in browser), falls back
77
- * to memory if localStorage is not available (e.g., Safari private mode).
78
- *
79
- * @param storageType - 'localStorage' (default) or 'memory'
80
- */
81
- declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
82
-
83
42
  /**
84
43
  * Generate a random code verifier (43-128 characters, RFC 7636 Section 4.1).
85
44
  *
@@ -1478,6 +1437,11 @@ declare function createFFIDClient(config: FFIDConfig): {
1478
1437
  };
1479
1438
  /** Token store (token mode only) */
1480
1439
  tokenStore: TokenStore;
1440
+ /**
1441
+ * Return the currently-valid access token, or null (token mode only; #4318).
1442
+ * Live-reads the store and applies the 30s expiry buffer.
1443
+ */
1444
+ getAccessToken: () => string | null;
1481
1445
  /** Resolved auth mode */
1482
1446
  authMode: FFIDAuthMode;
1483
1447
  /** Resolved logger instance */
@@ -1643,7 +1607,7 @@ interface FFIDProviderProps extends FFIDConfig {
1643
1607
  * - Automatic session refresh
1644
1608
  * - Token mode: automatic code exchange and token refresh
1645
1609
  */
1646
- declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, timeout, cleanCallbackUrl, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
1610
+ declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, timeout, tokenStore, cleanCallbackUrl, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
1647
1611
 
1648
1612
  /**
1649
1613
  * Return type for useFFID hook
@@ -1707,6 +1671,14 @@ interface UseFFIDReturn {
1707
1671
  switchOrganization: (organizationId: string) => void;
1708
1672
  /** Refresh session data */
1709
1673
  refresh: () => Promise<void>;
1674
+ /**
1675
+ * Token mode: return the currently-valid access token, or `null` when there is
1676
+ * none or it is expired (30s buffer). Live-reads the shared token store on each
1677
+ * call, so a token refreshed in the background — or cleared on logout — is
1678
+ * reflected without the host caching or polling it. Always `null` in
1679
+ * cookie / service-key mode. Stable function reference (#4318).
1680
+ */
1681
+ getAccessToken: () => string | null;
1710
1682
  /** Get login URL with redirect parameter */
1711
1683
  getLoginUrl: (redirectUrl?: string) => string;
1712
1684
  /** Get signup URL with redirect parameter */
@@ -2316,4 +2288,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
2316
2288
  };
2317
2289
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
2318
2290
 
2319
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
2291
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };