@feelflow/ffid-sdk 1.9.1 → 1.11.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.
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunkAD2MA4LH_cjs = require('../chunk-AD2MA4LH.cjs');
3
+ var chunkWZZP7SQB_cjs = require('../chunk-WZZP7SQB.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunkAD2MA4LH_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunkWZZP7SQB_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunkAD2MA4LH_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunkWZZP7SQB_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDLoginButton", {
16
16
  enumerable: true,
17
- get: function () { return chunkAD2MA4LH_cjs.FFIDLoginButton; }
17
+ get: function () { return chunkWZZP7SQB_cjs.FFIDLoginButton; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
20
20
  enumerable: true,
21
- get: function () { return chunkAD2MA4LH_cjs.FFIDOrganizationSwitcher; }
21
+ get: function () { return chunkWZZP7SQB_cjs.FFIDOrganizationSwitcher; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
24
24
  enumerable: true,
25
- get: function () { return chunkAD2MA4LH_cjs.FFIDSubscriptionBadge; }
25
+ get: function () { return chunkWZZP7SQB_cjs.FFIDSubscriptionBadge; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDUserMenu", {
28
28
  enumerable: true,
29
- get: function () { return chunkAD2MA4LH_cjs.FFIDUserMenu; }
29
+ get: function () { return chunkWZZP7SQB_cjs.FFIDUserMenu; }
30
30
  });
@@ -1,3 +1,3 @@
1
- export { v as FFIDAnnouncementBadge, S as FFIDAnnouncementBadgeClassNames, T as FFIDAnnouncementBadgeProps, w as FFIDAnnouncementList, V as FFIDAnnouncementListClassNames, W as FFIDAnnouncementListProps, E as FFIDLoginButton, X as FFIDLoginButtonProps, J as FFIDOrganizationSwitcher, Y as FFIDOrganizationSwitcherClassNames, Z as FFIDOrganizationSwitcherProps, M as FFIDSubscriptionBadge, _ as FFIDSubscriptionBadgeClassNames, $ as FFIDSubscriptionBadgeProps, P as FFIDUserMenu, a0 as FFIDUserMenuClassNames, a1 as FFIDUserMenuProps } from '../index-DsXjcF0i.cjs';
1
+ export { x as FFIDAnnouncementBadge, V as FFIDAnnouncementBadgeClassNames, W as FFIDAnnouncementBadgeProps, y as FFIDAnnouncementList, X as FFIDAnnouncementListClassNames, Y as FFIDAnnouncementListProps, H as FFIDLoginButton, Z as FFIDLoginButtonProps, M as FFIDOrganizationSwitcher, _ as FFIDOrganizationSwitcherClassNames, $ as FFIDOrganizationSwitcherProps, O as FFIDSubscriptionBadge, a0 as FFIDSubscriptionBadgeClassNames, a1 as FFIDSubscriptionBadgeProps, R as FFIDUserMenu, a2 as FFIDUserMenuClassNames, a3 as FFIDUserMenuProps } from '../index-DMgtXEt5.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { v as FFIDAnnouncementBadge, S as FFIDAnnouncementBadgeClassNames, T as FFIDAnnouncementBadgeProps, w as FFIDAnnouncementList, V as FFIDAnnouncementListClassNames, W as FFIDAnnouncementListProps, E as FFIDLoginButton, X as FFIDLoginButtonProps, J as FFIDOrganizationSwitcher, Y as FFIDOrganizationSwitcherClassNames, Z as FFIDOrganizationSwitcherProps, M as FFIDSubscriptionBadge, _ as FFIDSubscriptionBadgeClassNames, $ as FFIDSubscriptionBadgeProps, P as FFIDUserMenu, a0 as FFIDUserMenuClassNames, a1 as FFIDUserMenuProps } from '../index-DsXjcF0i.js';
1
+ export { x as FFIDAnnouncementBadge, V as FFIDAnnouncementBadgeClassNames, W as FFIDAnnouncementBadgeProps, y as FFIDAnnouncementList, X as FFIDAnnouncementListClassNames, Y as FFIDAnnouncementListProps, H as FFIDLoginButton, Z as FFIDLoginButtonProps, M as FFIDOrganizationSwitcher, _ as FFIDOrganizationSwitcherClassNames, $ as FFIDOrganizationSwitcherProps, O as FFIDSubscriptionBadge, a0 as FFIDSubscriptionBadgeClassNames, a1 as FFIDSubscriptionBadgeProps, R as FFIDUserMenu, a2 as FFIDUserMenuClassNames, a3 as FFIDUserMenuProps } from '../index-DMgtXEt5.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-S7GPQ4OJ.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-GW23IWNE.js';
@@ -28,6 +28,8 @@ interface FFIDCacheConfig {
28
28
  * Core types for the FeelFlow ID SDK
29
29
  */
30
30
 
31
+ /** Authentication mode for FFID client */
32
+ type FFIDAuthMode = 'cookie' | 'token' | 'service-key';
31
33
  /**
32
34
  * User information from FFID
33
35
  */
@@ -130,6 +132,17 @@ interface FFIDOAuthUserInfo {
130
132
  organizationId?: string | null | undefined;
131
133
  subscription?: FFIDOAuthUserInfoSubscription | undefined;
132
134
  }
135
+ /** Options for verifyAccessToken */
136
+ interface FFIDVerifyAccessTokenOptions {
137
+ /**
138
+ * When true, fetches profile info (email, name, picture) via introspect API
139
+ * after local JWT verification. No effect when verifyStrategy is 'introspect'
140
+ * (profile is always included).
141
+ * Requires {@link FFIDConfig.serviceApiKey} to be configured when using jwt strategy.
142
+ * @default false
143
+ */
144
+ includeProfile?: boolean;
145
+ }
133
146
  /**
134
147
  * SDK configuration options
135
148
  */
@@ -157,7 +170,7 @@ interface FFIDConfig {
157
170
  /** Callback on authentication error */
158
171
  onError?: ((error: FFIDError) => void) | undefined;
159
172
  /** Authentication mode: 'cookie' (default), 'token' (OAuth Bearer), or 'service-key' (server-to-server) */
160
- authMode?: 'cookie' | 'token' | 'service-key' | undefined;
173
+ authMode?: FFIDAuthMode | undefined;
161
174
  /** Client ID for token mode (defaults to serviceCode if not set) */
162
175
  clientId?: string | undefined;
163
176
  /** Custom redirect URI for OAuth flow (defaults to window.location.origin + window.location.pathname) */
@@ -169,14 +182,16 @@ interface FFIDConfig {
169
182
  * - 'jwt': Local JWT verification via JWKS (default, lower latency)
170
183
  * - 'introspect': Remote introspection via /api/v1/oauth/introspect
171
184
  *
172
- * JWT verification returns limited claims (no email/name/picture/subscription).
173
- * Use 'introspect' if you need full user profile data.
185
+ * JWT verification returns limited claims (no email/name/picture/subscription) by default.
186
+ * Use 'introspect' if you always need full user profile data, or pass
187
+ * { includeProfile: true } to verifyAccessToken() for on-demand profile fetching.
174
188
  */
175
189
  verifyStrategy?: 'jwt' | 'introspect' | undefined;
176
190
  /**
177
191
  * Cache configuration for token verification results.
178
192
  * When set, introspect/userinfo responses are cached to reduce API calls.
179
- * Only effective in service-key mode with verifyStrategy: 'introspect'.
193
+ * Effective in service-key mode with verifyStrategy: 'introspect',
194
+ * or with verifyStrategy: 'jwt' when includeProfile: true is used.
180
195
  */
181
196
  cache?: FFIDCacheConfig | undefined;
182
197
  /**
@@ -761,4 +776,4 @@ interface FFIDAnnouncementListProps {
761
776
  */
762
777
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
763
778
 
764
- export { type FFIDSubscriptionBadgeProps as $, type AnnouncementListResponse as A, type FFIDCacheConfig as B, type FFIDContextValue as C, type FFIDJwtClaims as D, FFIDLoginButton as E, type FFIDConfig as F, type FFIDOAuthTokenResponse as G, type FFIDOAuthUserInfoMemberRole as H, type FFIDOAuthUserInfoSubscription as I, FFIDOrganizationSwitcher as J, type FFIDSeatModel as K, type ListAnnouncementsOptions as L, FFIDSubscriptionBadge as M, type FFIDSubscriptionStatus as N, type FFIDTokenIntrospectionResponse as O, FFIDUserMenu as P, type UseFFIDAnnouncementsReturn as Q, useFFIDAnnouncements as R, type FFIDAnnouncementBadgeClassNames as S, type FFIDAnnouncementBadgeProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDAnnouncementListClassNames as V, type FFIDAnnouncementListProps as W, type FFIDLoginButtonProps as X, type FFIDOrganizationSwitcherClassNames as Y, type FFIDOrganizationSwitcherProps as Z, type FFIDSubscriptionBadgeClassNames as _, type FFIDApiResponse as a, type FFIDUserMenuClassNames as a0, type FFIDUserMenuProps as a1, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDCreateCheckoutParams as e, type FFIDCheckoutSessionResponse as f, type FFIDCreatePortalParams as g, type FFIDPortalSessionResponse as h, type FFIDOAuthUserInfo as i, type FFIDLogger as j, type FFIDCacheAdapter as k, type FFIDUser as l, type FFIDOrganization as m, type FFIDSubscription as n, type FFIDSubscriptionContextValue as o, type FFIDAnnouncementsClientConfig as p, type FFIDAnnouncementsApiResponse as q, type FFIDAnnouncementsLogger as r, type Announcement as s, type AnnouncementStatus as t, type AnnouncementType as u, FFIDAnnouncementBadge as v, FFIDAnnouncementList as w, type FFIDAnnouncementsError as x, type FFIDAnnouncementsErrorCode as y, type FFIDAnnouncementsServerResponse as z };
779
+ export { type FFIDOrganizationSwitcherProps as $, type AnnouncementListResponse as A, type FFIDAnnouncementsErrorCode as B, type FFIDAnnouncementsServerResponse as C, type FFIDCacheConfig as D, type FFIDContextValue as E, type FFIDConfig as F, type FFIDJwtClaims as G, FFIDLoginButton as H, type FFIDOAuthTokenResponse as I, type FFIDOAuthUserInfoMemberRole as J, type FFIDOAuthUserInfoSubscription as K, type ListAnnouncementsOptions as L, FFIDOrganizationSwitcher as M, type FFIDSeatModel as N, FFIDSubscriptionBadge as O, type FFIDSubscriptionStatus as P, type FFIDTokenIntrospectionResponse as Q, FFIDUserMenu as R, type UseFFIDAnnouncementsReturn as S, useFFIDAnnouncements as T, type UseFFIDAnnouncementsOptions as U, type FFIDAnnouncementBadgeClassNames as V, type FFIDAnnouncementBadgeProps as W, type FFIDAnnouncementListClassNames as X, type FFIDAnnouncementListProps as Y, type FFIDLoginButtonProps as Z, type FFIDOrganizationSwitcherClassNames as _, type FFIDApiResponse as a, type FFIDSubscriptionBadgeClassNames as a0, type FFIDSubscriptionBadgeProps as a1, type FFIDUserMenuClassNames as a2, type FFIDUserMenuProps as a3, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDCreateCheckoutParams as e, type FFIDCheckoutSessionResponse as f, type FFIDCreatePortalParams as g, type FFIDPortalSessionResponse as h, type FFIDVerifyAccessTokenOptions as i, type FFIDOAuthUserInfo as j, type FFIDAuthMode as k, type FFIDLogger as l, type FFIDCacheAdapter as m, type FFIDUser as n, type FFIDOrganization as o, type FFIDSubscription as p, type FFIDSubscriptionContextValue as q, type FFIDAnnouncementsClientConfig as r, type FFIDAnnouncementsApiResponse as s, type FFIDAnnouncementsLogger as t, type Announcement as u, type AnnouncementStatus as v, type AnnouncementType as w, FFIDAnnouncementBadge as x, FFIDAnnouncementList as y, type FFIDAnnouncementsError as z };
@@ -28,6 +28,8 @@ interface FFIDCacheConfig {
28
28
  * Core types for the FeelFlow ID SDK
29
29
  */
30
30
 
31
+ /** Authentication mode for FFID client */
32
+ type FFIDAuthMode = 'cookie' | 'token' | 'service-key';
31
33
  /**
32
34
  * User information from FFID
33
35
  */
@@ -130,6 +132,17 @@ interface FFIDOAuthUserInfo {
130
132
  organizationId?: string | null | undefined;
131
133
  subscription?: FFIDOAuthUserInfoSubscription | undefined;
132
134
  }
135
+ /** Options for verifyAccessToken */
136
+ interface FFIDVerifyAccessTokenOptions {
137
+ /**
138
+ * When true, fetches profile info (email, name, picture) via introspect API
139
+ * after local JWT verification. No effect when verifyStrategy is 'introspect'
140
+ * (profile is always included).
141
+ * Requires {@link FFIDConfig.serviceApiKey} to be configured when using jwt strategy.
142
+ * @default false
143
+ */
144
+ includeProfile?: boolean;
145
+ }
133
146
  /**
134
147
  * SDK configuration options
135
148
  */
@@ -157,7 +170,7 @@ interface FFIDConfig {
157
170
  /** Callback on authentication error */
158
171
  onError?: ((error: FFIDError) => void) | undefined;
159
172
  /** Authentication mode: 'cookie' (default), 'token' (OAuth Bearer), or 'service-key' (server-to-server) */
160
- authMode?: 'cookie' | 'token' | 'service-key' | undefined;
173
+ authMode?: FFIDAuthMode | undefined;
161
174
  /** Client ID for token mode (defaults to serviceCode if not set) */
162
175
  clientId?: string | undefined;
163
176
  /** Custom redirect URI for OAuth flow (defaults to window.location.origin + window.location.pathname) */
@@ -169,14 +182,16 @@ interface FFIDConfig {
169
182
  * - 'jwt': Local JWT verification via JWKS (default, lower latency)
170
183
  * - 'introspect': Remote introspection via /api/v1/oauth/introspect
171
184
  *
172
- * JWT verification returns limited claims (no email/name/picture/subscription).
173
- * Use 'introspect' if you need full user profile data.
185
+ * JWT verification returns limited claims (no email/name/picture/subscription) by default.
186
+ * Use 'introspect' if you always need full user profile data, or pass
187
+ * { includeProfile: true } to verifyAccessToken() for on-demand profile fetching.
174
188
  */
175
189
  verifyStrategy?: 'jwt' | 'introspect' | undefined;
176
190
  /**
177
191
  * Cache configuration for token verification results.
178
192
  * When set, introspect/userinfo responses are cached to reduce API calls.
179
- * Only effective in service-key mode with verifyStrategy: 'introspect'.
193
+ * Effective in service-key mode with verifyStrategy: 'introspect',
194
+ * or with verifyStrategy: 'jwt' when includeProfile: true is used.
180
195
  */
181
196
  cache?: FFIDCacheConfig | undefined;
182
197
  /**
@@ -761,4 +776,4 @@ interface FFIDAnnouncementListProps {
761
776
  */
762
777
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
763
778
 
764
- export { type FFIDSubscriptionBadgeProps as $, type AnnouncementListResponse as A, type FFIDCacheConfig as B, type FFIDContextValue as C, type FFIDJwtClaims as D, FFIDLoginButton as E, type FFIDConfig as F, type FFIDOAuthTokenResponse as G, type FFIDOAuthUserInfoMemberRole as H, type FFIDOAuthUserInfoSubscription as I, FFIDOrganizationSwitcher as J, type FFIDSeatModel as K, type ListAnnouncementsOptions as L, FFIDSubscriptionBadge as M, type FFIDSubscriptionStatus as N, type FFIDTokenIntrospectionResponse as O, FFIDUserMenu as P, type UseFFIDAnnouncementsReturn as Q, useFFIDAnnouncements as R, type FFIDAnnouncementBadgeClassNames as S, type FFIDAnnouncementBadgeProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDAnnouncementListClassNames as V, type FFIDAnnouncementListProps as W, type FFIDLoginButtonProps as X, type FFIDOrganizationSwitcherClassNames as Y, type FFIDOrganizationSwitcherProps as Z, type FFIDSubscriptionBadgeClassNames as _, type FFIDApiResponse as a, type FFIDUserMenuClassNames as a0, type FFIDUserMenuProps as a1, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDCreateCheckoutParams as e, type FFIDCheckoutSessionResponse as f, type FFIDCreatePortalParams as g, type FFIDPortalSessionResponse as h, type FFIDOAuthUserInfo as i, type FFIDLogger as j, type FFIDCacheAdapter as k, type FFIDUser as l, type FFIDOrganization as m, type FFIDSubscription as n, type FFIDSubscriptionContextValue as o, type FFIDAnnouncementsClientConfig as p, type FFIDAnnouncementsApiResponse as q, type FFIDAnnouncementsLogger as r, type Announcement as s, type AnnouncementStatus as t, type AnnouncementType as u, FFIDAnnouncementBadge as v, FFIDAnnouncementList as w, type FFIDAnnouncementsError as x, type FFIDAnnouncementsErrorCode as y, type FFIDAnnouncementsServerResponse as z };
779
+ export { type FFIDOrganizationSwitcherProps as $, type AnnouncementListResponse as A, type FFIDAnnouncementsErrorCode as B, type FFIDAnnouncementsServerResponse as C, type FFIDCacheConfig as D, type FFIDContextValue as E, type FFIDConfig as F, type FFIDJwtClaims as G, FFIDLoginButton as H, type FFIDOAuthTokenResponse as I, type FFIDOAuthUserInfoMemberRole as J, type FFIDOAuthUserInfoSubscription as K, type ListAnnouncementsOptions as L, FFIDOrganizationSwitcher as M, type FFIDSeatModel as N, FFIDSubscriptionBadge as O, type FFIDSubscriptionStatus as P, type FFIDTokenIntrospectionResponse as Q, FFIDUserMenu as R, type UseFFIDAnnouncementsReturn as S, useFFIDAnnouncements as T, type UseFFIDAnnouncementsOptions as U, type FFIDAnnouncementBadgeClassNames as V, type FFIDAnnouncementBadgeProps as W, type FFIDAnnouncementListClassNames as X, type FFIDAnnouncementListProps as Y, type FFIDLoginButtonProps as Z, type FFIDOrganizationSwitcherClassNames as _, type FFIDApiResponse as a, type FFIDSubscriptionBadgeClassNames as a0, type FFIDSubscriptionBadgeProps as a1, type FFIDUserMenuClassNames as a2, type FFIDUserMenuProps as a3, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDCreateCheckoutParams as e, type FFIDCheckoutSessionResponse as f, type FFIDCreatePortalParams as g, type FFIDPortalSessionResponse as h, type FFIDVerifyAccessTokenOptions as i, type FFIDOAuthUserInfo as j, type FFIDAuthMode as k, type FFIDLogger as l, type FFIDCacheAdapter as m, type FFIDUser as n, type FFIDOrganization as o, type FFIDSubscription as p, type FFIDSubscriptionContextValue as q, type FFIDAnnouncementsClientConfig as r, type FFIDAnnouncementsApiResponse as s, type FFIDAnnouncementsLogger as t, type Announcement as u, type AnnouncementStatus as v, type AnnouncementType as w, FFIDAnnouncementBadge as x, FFIDAnnouncementList as y, type FFIDAnnouncementsError as z };
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkAD2MA4LH_cjs = require('./chunk-AD2MA4LH.cjs');
3
+ var chunkWZZP7SQB_cjs = require('./chunk-WZZP7SQB.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
@@ -46,7 +46,7 @@ function createKVCacheAdapter(kv) {
46
46
  }
47
47
  function withFFIDAuth(Component, options = {}) {
48
48
  const WrappedComponent = (props) => {
49
- const { isLoading, isAuthenticated, login } = chunkAD2MA4LH_cjs.useFFIDContext();
49
+ const { isLoading, isAuthenticated, login } = chunkWZZP7SQB_cjs.useFFIDContext();
50
50
  const hasRedirected = react.useRef(false);
51
51
  react.useEffect(() => {
52
52
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -71,83 +71,83 @@ function withFFIDAuth(Component, options = {}) {
71
71
 
72
72
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
73
73
  enumerable: true,
74
- get: function () { return chunkAD2MA4LH_cjs.DEFAULT_API_BASE_URL; }
74
+ get: function () { return chunkWZZP7SQB_cjs.DEFAULT_API_BASE_URL; }
75
75
  });
76
76
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
77
77
  enumerable: true,
78
- get: function () { return chunkAD2MA4LH_cjs.FFIDAnnouncementBadge; }
78
+ get: function () { return chunkWZZP7SQB_cjs.FFIDAnnouncementBadge; }
79
79
  });
80
80
  Object.defineProperty(exports, "FFIDAnnouncementList", {
81
81
  enumerable: true,
82
- get: function () { return chunkAD2MA4LH_cjs.FFIDAnnouncementList; }
82
+ get: function () { return chunkWZZP7SQB_cjs.FFIDAnnouncementList; }
83
83
  });
84
84
  Object.defineProperty(exports, "FFIDLoginButton", {
85
85
  enumerable: true,
86
- get: function () { return chunkAD2MA4LH_cjs.FFIDLoginButton; }
86
+ get: function () { return chunkWZZP7SQB_cjs.FFIDLoginButton; }
87
87
  });
88
88
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
89
89
  enumerable: true,
90
- get: function () { return chunkAD2MA4LH_cjs.FFIDOrganizationSwitcher; }
90
+ get: function () { return chunkWZZP7SQB_cjs.FFIDOrganizationSwitcher; }
91
91
  });
92
92
  Object.defineProperty(exports, "FFIDProvider", {
93
93
  enumerable: true,
94
- get: function () { return chunkAD2MA4LH_cjs.FFIDProvider; }
94
+ get: function () { return chunkWZZP7SQB_cjs.FFIDProvider; }
95
95
  });
96
96
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
97
97
  enumerable: true,
98
- get: function () { return chunkAD2MA4LH_cjs.FFIDSubscriptionBadge; }
98
+ get: function () { return chunkWZZP7SQB_cjs.FFIDSubscriptionBadge; }
99
99
  });
100
100
  Object.defineProperty(exports, "FFIDUserMenu", {
101
101
  enumerable: true,
102
- get: function () { return chunkAD2MA4LH_cjs.FFIDUserMenu; }
102
+ get: function () { return chunkWZZP7SQB_cjs.FFIDUserMenu; }
103
103
  });
104
104
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
105
105
  enumerable: true,
106
- get: function () { return chunkAD2MA4LH_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
106
+ get: function () { return chunkWZZP7SQB_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
107
107
  });
108
108
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
109
109
  enumerable: true,
110
- get: function () { return chunkAD2MA4LH_cjs.createFFIDAnnouncementsClient; }
110
+ get: function () { return chunkWZZP7SQB_cjs.createFFIDAnnouncementsClient; }
111
111
  });
112
112
  Object.defineProperty(exports, "createFFIDClient", {
113
113
  enumerable: true,
114
- get: function () { return chunkAD2MA4LH_cjs.createFFIDClient; }
114
+ get: function () { return chunkWZZP7SQB_cjs.createFFIDClient; }
115
115
  });
116
116
  Object.defineProperty(exports, "createTokenStore", {
117
117
  enumerable: true,
118
- get: function () { return chunkAD2MA4LH_cjs.createTokenStore; }
118
+ get: function () { return chunkWZZP7SQB_cjs.createTokenStore; }
119
119
  });
120
120
  Object.defineProperty(exports, "generateCodeChallenge", {
121
121
  enumerable: true,
122
- get: function () { return chunkAD2MA4LH_cjs.generateCodeChallenge; }
122
+ get: function () { return chunkWZZP7SQB_cjs.generateCodeChallenge; }
123
123
  });
124
124
  Object.defineProperty(exports, "generateCodeVerifier", {
125
125
  enumerable: true,
126
- get: function () { return chunkAD2MA4LH_cjs.generateCodeVerifier; }
126
+ get: function () { return chunkWZZP7SQB_cjs.generateCodeVerifier; }
127
127
  });
128
128
  Object.defineProperty(exports, "retrieveCodeVerifier", {
129
129
  enumerable: true,
130
- get: function () { return chunkAD2MA4LH_cjs.retrieveCodeVerifier; }
130
+ get: function () { return chunkWZZP7SQB_cjs.retrieveCodeVerifier; }
131
131
  });
132
132
  Object.defineProperty(exports, "storeCodeVerifier", {
133
133
  enumerable: true,
134
- get: function () { return chunkAD2MA4LH_cjs.storeCodeVerifier; }
134
+ get: function () { return chunkWZZP7SQB_cjs.storeCodeVerifier; }
135
135
  });
136
136
  Object.defineProperty(exports, "useFFID", {
137
137
  enumerable: true,
138
- get: function () { return chunkAD2MA4LH_cjs.useFFID; }
138
+ get: function () { return chunkWZZP7SQB_cjs.useFFID; }
139
139
  });
140
140
  Object.defineProperty(exports, "useFFIDAnnouncements", {
141
141
  enumerable: true,
142
- get: function () { return chunkAD2MA4LH_cjs.useFFIDAnnouncements; }
142
+ get: function () { return chunkWZZP7SQB_cjs.useFFIDAnnouncements; }
143
143
  });
144
144
  Object.defineProperty(exports, "useSubscription", {
145
145
  enumerable: true,
146
- get: function () { return chunkAD2MA4LH_cjs.useSubscription; }
146
+ get: function () { return chunkWZZP7SQB_cjs.useSubscription; }
147
147
  });
148
148
  Object.defineProperty(exports, "withSubscription", {
149
149
  enumerable: true,
150
- get: function () { return chunkAD2MA4LH_cjs.withSubscription; }
150
+ get: function () { return chunkWZZP7SQB_cjs.withSubscription; }
151
151
  });
152
152
  exports.createKVCacheAdapter = createKVCacheAdapter;
153
153
  exports.createMemoryCacheAdapter = createMemoryCacheAdapter;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDCreateCheckoutParams, f as FFIDCheckoutSessionResponse, g as FFIDCreatePortalParams, h as FFIDPortalSessionResponse, i as FFIDOAuthUserInfo, j as FFIDLogger, k as FFIDCacheAdapter, l as FFIDUser, m as FFIDOrganization, n as FFIDSubscription, o as FFIDSubscriptionContextValue, p as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, q as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, r as FFIDAnnouncementsLogger } from './index-DsXjcF0i.cjs';
2
- export { s as Announcement, t as AnnouncementStatus, u as AnnouncementType, v as FFIDAnnouncementBadge, w as FFIDAnnouncementList, x as FFIDAnnouncementsError, y as FFIDAnnouncementsErrorCode, z as FFIDAnnouncementsServerResponse, B as FFIDCacheConfig, C as FFIDContextValue, D as FFIDJwtClaims, E as FFIDLoginButton, G as FFIDOAuthTokenResponse, H as FFIDOAuthUserInfoMemberRole, I as FFIDOAuthUserInfoSubscription, J as FFIDOrganizationSwitcher, K as FFIDSeatModel, M as FFIDSubscriptionBadge, N as FFIDSubscriptionStatus, O as FFIDTokenIntrospectionResponse, P as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, Q as UseFFIDAnnouncementsReturn, R as useFFIDAnnouncements } from './index-DsXjcF0i.cjs';
1
+ import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDCreateCheckoutParams, f as FFIDCheckoutSessionResponse, g as FFIDCreatePortalParams, h as FFIDPortalSessionResponse, i as FFIDVerifyAccessTokenOptions, j as FFIDOAuthUserInfo, k as FFIDAuthMode, l as FFIDLogger, m as FFIDCacheAdapter, n as FFIDUser, o as FFIDOrganization, p as FFIDSubscription, q as FFIDSubscriptionContextValue, r as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, s as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, t as FFIDAnnouncementsLogger } from './index-DMgtXEt5.cjs';
2
+ export { u as Announcement, v as AnnouncementStatus, w as AnnouncementType, x as FFIDAnnouncementBadge, y as FFIDAnnouncementList, z as FFIDAnnouncementsError, B as FFIDAnnouncementsErrorCode, C as FFIDAnnouncementsServerResponse, D as FFIDCacheConfig, E as FFIDContextValue, G as FFIDJwtClaims, H as FFIDLoginButton, I as FFIDOAuthTokenResponse, J as FFIDOAuthUserInfoMemberRole, K as FFIDOAuthUserInfoSubscription, M as FFIDOrganizationSwitcher, N as FFIDSeatModel, O as FFIDSubscriptionBadge, P as FFIDSubscriptionStatus, Q as FFIDTokenIntrospectionResponse, R as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, S as UseFFIDAnnouncementsReturn, T as useFFIDAnnouncements } from './index-DMgtXEt5.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -88,7 +88,7 @@ declare function retrieveCodeVerifier(): string | null;
88
88
  declare function createFFIDClient(config: FFIDConfig): {
89
89
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
90
90
  signOut: () => Promise<FFIDApiResponse<void>>;
91
- redirectToLogin: () => boolean;
91
+ redirectToLogin: () => Promise<boolean>;
92
92
  getLoginUrl: (redirectUrl?: string) => string;
93
93
  getSignupUrl: (redirectUrl?: string) => string;
94
94
  createError: (code: string, message: string) => FFIDError;
@@ -100,11 +100,11 @@ declare function createFFIDClient(config: FFIDConfig): {
100
100
  }) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
101
101
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
102
102
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
103
- verifyAccessToken: (accessToken: string) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
103
+ verifyAccessToken: (accessToken: string, options?: FFIDVerifyAccessTokenOptions) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
104
104
  /** Token store (token mode only) */
105
105
  tokenStore: TokenStore;
106
106
  /** Resolved auth mode */
107
- authMode: "cookie" | "token" | "service-key";
107
+ authMode: FFIDAuthMode;
108
108
  /** Resolved logger instance */
109
109
  logger: FFIDLogger;
110
110
  baseUrl: string;
@@ -366,4 +366,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
366
366
  /** Type of the FFID Announcements client */
367
367
  type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
368
368
 
369
- export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
369
+ export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDCreateCheckoutParams, f as FFIDCheckoutSessionResponse, g as FFIDCreatePortalParams, h as FFIDPortalSessionResponse, i as FFIDOAuthUserInfo, j as FFIDLogger, k as FFIDCacheAdapter, l as FFIDUser, m as FFIDOrganization, n as FFIDSubscription, o as FFIDSubscriptionContextValue, p as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, q as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, r as FFIDAnnouncementsLogger } from './index-DsXjcF0i.js';
2
- export { s as Announcement, t as AnnouncementStatus, u as AnnouncementType, v as FFIDAnnouncementBadge, w as FFIDAnnouncementList, x as FFIDAnnouncementsError, y as FFIDAnnouncementsErrorCode, z as FFIDAnnouncementsServerResponse, B as FFIDCacheConfig, C as FFIDContextValue, D as FFIDJwtClaims, E as FFIDLoginButton, G as FFIDOAuthTokenResponse, H as FFIDOAuthUserInfoMemberRole, I as FFIDOAuthUserInfoSubscription, J as FFIDOrganizationSwitcher, K as FFIDSeatModel, M as FFIDSubscriptionBadge, N as FFIDSubscriptionStatus, O as FFIDTokenIntrospectionResponse, P as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, Q as UseFFIDAnnouncementsReturn, R as useFFIDAnnouncements } from './index-DsXjcF0i.js';
1
+ import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDCreateCheckoutParams, f as FFIDCheckoutSessionResponse, g as FFIDCreatePortalParams, h as FFIDPortalSessionResponse, i as FFIDVerifyAccessTokenOptions, j as FFIDOAuthUserInfo, k as FFIDAuthMode, l as FFIDLogger, m as FFIDCacheAdapter, n as FFIDUser, o as FFIDOrganization, p as FFIDSubscription, q as FFIDSubscriptionContextValue, r as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, s as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, t as FFIDAnnouncementsLogger } from './index-DMgtXEt5.js';
2
+ export { u as Announcement, v as AnnouncementStatus, w as AnnouncementType, x as FFIDAnnouncementBadge, y as FFIDAnnouncementList, z as FFIDAnnouncementsError, B as FFIDAnnouncementsErrorCode, C as FFIDAnnouncementsServerResponse, D as FFIDCacheConfig, E as FFIDContextValue, G as FFIDJwtClaims, H as FFIDLoginButton, I as FFIDOAuthTokenResponse, J as FFIDOAuthUserInfoMemberRole, K as FFIDOAuthUserInfoSubscription, M as FFIDOrganizationSwitcher, N as FFIDSeatModel, O as FFIDSubscriptionBadge, P as FFIDSubscriptionStatus, Q as FFIDTokenIntrospectionResponse, R as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, S as UseFFIDAnnouncementsReturn, T as useFFIDAnnouncements } from './index-DMgtXEt5.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -88,7 +88,7 @@ declare function retrieveCodeVerifier(): string | null;
88
88
  declare function createFFIDClient(config: FFIDConfig): {
89
89
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
90
90
  signOut: () => Promise<FFIDApiResponse<void>>;
91
- redirectToLogin: () => boolean;
91
+ redirectToLogin: () => Promise<boolean>;
92
92
  getLoginUrl: (redirectUrl?: string) => string;
93
93
  getSignupUrl: (redirectUrl?: string) => string;
94
94
  createError: (code: string, message: string) => FFIDError;
@@ -100,11 +100,11 @@ declare function createFFIDClient(config: FFIDConfig): {
100
100
  }) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
101
101
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
102
102
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
103
- verifyAccessToken: (accessToken: string) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
103
+ verifyAccessToken: (accessToken: string, options?: FFIDVerifyAccessTokenOptions) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
104
104
  /** Token store (token mode only) */
105
105
  tokenStore: TokenStore;
106
106
  /** Resolved auth mode */
107
- authMode: "cookie" | "token" | "service-key";
107
+ authMode: FFIDAuthMode;
108
108
  /** Resolved logger instance */
109
109
  logger: FFIDLogger;
110
110
  baseUrl: string;
@@ -366,4 +366,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
366
366
  /** Type of the FFID Announcements client */
367
367
  type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
368
368
 
369
- export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
369
+ export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext } from './chunk-S7GPQ4OJ.js';
2
- export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-S7GPQ4OJ.js';
1
+ import { useFFIDContext } from './chunk-GW23IWNE.js';
2
+ export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-GW23IWNE.js';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5