@feelflow/ffid-sdk 5.17.0 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHBPYSPBY_cjs = require('./chunk-HBPYSPBY.cjs');
3
+ var chunk55S5VUWR_cjs = require('./chunk-55S5VUWR.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 } = chunkHBPYSPBY_cjs.useFFIDContext();
58
- const { effectiveStatus, isBlocked, isGrace } = chunkHBPYSPBY_cjs.useSubscription();
57
+ const { isLoading, error } = chunk55S5VUWR_cjs.useFFIDContext();
58
+ const { effectiveStatus, isBlocked, isGrace } = chunk55S5VUWR_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 } = chunkHBPYSPBY_cjs.useFFIDContext();
79
+ const { isLoading, isAuthenticated, login } = chunk55S5VUWR_cjs.useFFIDContext();
80
80
  const hasRedirected = react.useRef(false);
81
81
  react.useEffect(() => {
82
82
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -105,151 +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 chunkHBPYSPBY_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
108
+ get: function () { return chunk55S5VUWR_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
109
109
  });
110
110
  Object.defineProperty(exports, "BLOCKING_EFFECTIVE_STATUSES", {
111
111
  enumerable: true,
112
- get: function () { return chunkHBPYSPBY_cjs.BLOCKING_EFFECTIVE_STATUSES; }
112
+ get: function () { return chunk55S5VUWR_cjs.BLOCKING_EFFECTIVE_STATUSES; }
113
113
  });
114
114
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
115
115
  enumerable: true,
116
- get: function () { return chunkHBPYSPBY_cjs.DEFAULT_API_BASE_URL; }
116
+ get: function () { return chunk55S5VUWR_cjs.DEFAULT_API_BASE_URL; }
117
117
  });
118
118
  Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
119
119
  enumerable: true,
120
- get: function () { return chunkHBPYSPBY_cjs.DEFAULT_OAUTH_SCOPES; }
120
+ get: function () { return chunk55S5VUWR_cjs.DEFAULT_OAUTH_SCOPES; }
121
121
  });
122
122
  Object.defineProperty(exports, "EFFECTIVE_SUBSCRIPTION_STATUSES", {
123
123
  enumerable: true,
124
- get: function () { return chunkHBPYSPBY_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
124
+ get: function () { return chunk55S5VUWR_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
125
125
  });
126
126
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
127
127
  enumerable: true,
128
- get: function () { return chunkHBPYSPBY_cjs.FFIDAnnouncementBadge; }
128
+ get: function () { return chunk55S5VUWR_cjs.FFIDAnnouncementBadge; }
129
129
  });
130
130
  Object.defineProperty(exports, "FFIDAnnouncementList", {
131
131
  enumerable: true,
132
- get: function () { return chunkHBPYSPBY_cjs.FFIDAnnouncementList; }
132
+ get: function () { return chunk55S5VUWR_cjs.FFIDAnnouncementList; }
133
133
  });
134
134
  Object.defineProperty(exports, "FFIDInquiryForm", {
135
135
  enumerable: true,
136
- get: function () { return chunkHBPYSPBY_cjs.FFIDInquiryForm; }
136
+ get: function () { return chunk55S5VUWR_cjs.FFIDInquiryForm; }
137
137
  });
138
138
  Object.defineProperty(exports, "FFIDLoginButton", {
139
139
  enumerable: true,
140
- get: function () { return chunkHBPYSPBY_cjs.FFIDLoginButton; }
140
+ get: function () { return chunk55S5VUWR_cjs.FFIDLoginButton; }
141
141
  });
142
142
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
143
143
  enumerable: true,
144
- get: function () { return chunkHBPYSPBY_cjs.FFIDOrganizationSwitcher; }
144
+ get: function () { return chunk55S5VUWR_cjs.FFIDOrganizationSwitcher; }
145
145
  });
146
146
  Object.defineProperty(exports, "FFIDProvider", {
147
147
  enumerable: true,
148
- get: function () { return chunkHBPYSPBY_cjs.FFIDProvider; }
148
+ get: function () { return chunk55S5VUWR_cjs.FFIDProvider; }
149
149
  });
150
150
  Object.defineProperty(exports, "FFIDSDKError", {
151
151
  enumerable: true,
152
- get: function () { return chunkHBPYSPBY_cjs.FFIDSDKError; }
152
+ get: function () { return chunk55S5VUWR_cjs.FFIDSDKError; }
153
153
  });
154
154
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
155
155
  enumerable: true,
156
- get: function () { return chunkHBPYSPBY_cjs.FFIDSubscriptionBadge; }
156
+ get: function () { return chunk55S5VUWR_cjs.FFIDSubscriptionBadge; }
157
157
  });
158
158
  Object.defineProperty(exports, "FFIDUserMenu", {
159
159
  enumerable: true,
160
- get: function () { return chunkHBPYSPBY_cjs.FFIDUserMenu; }
160
+ get: function () { return chunk55S5VUWR_cjs.FFIDUserMenu; }
161
161
  });
162
162
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
163
163
  enumerable: true,
164
- get: function () { return chunkHBPYSPBY_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
164
+ get: function () { return chunk55S5VUWR_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
165
+ });
166
+ Object.defineProperty(exports, "FFID_ERROR_CODES", {
167
+ enumerable: true,
168
+ get: function () { return chunk55S5VUWR_cjs.FFID_ERROR_CODES; }
165
169
  });
166
170
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
167
171
  enumerable: true,
168
- get: function () { return chunkHBPYSPBY_cjs.FFID_INQUIRY_CATEGORIES; }
172
+ get: function () { return chunk55S5VUWR_cjs.FFID_INQUIRY_CATEGORIES; }
169
173
  });
170
174
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
171
175
  enumerable: true,
172
- get: function () { return chunkHBPYSPBY_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
176
+ get: function () { return chunk55S5VUWR_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
173
177
  });
174
178
  Object.defineProperty(exports, "clearState", {
175
179
  enumerable: true,
176
- get: function () { return chunkHBPYSPBY_cjs.cleanupStateStorage; }
180
+ get: function () { return chunk55S5VUWR_cjs.cleanupStateStorage; }
177
181
  });
178
182
  Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
179
183
  enumerable: true,
180
- get: function () { return chunkHBPYSPBY_cjs.computeEffectiveStatusFromSession; }
184
+ get: function () { return chunk55S5VUWR_cjs.computeEffectiveStatusFromSession; }
181
185
  });
182
186
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
183
187
  enumerable: true,
184
- get: function () { return chunkHBPYSPBY_cjs.createFFIDAnnouncementsClient; }
188
+ get: function () { return chunk55S5VUWR_cjs.createFFIDAnnouncementsClient; }
185
189
  });
186
190
  Object.defineProperty(exports, "createFFIDClient", {
187
191
  enumerable: true,
188
- get: function () { return chunkHBPYSPBY_cjs.createFFIDClient; }
192
+ get: function () { return chunk55S5VUWR_cjs.createFFIDClient; }
189
193
  });
190
194
  Object.defineProperty(exports, "createTokenStore", {
191
195
  enumerable: true,
192
- get: function () { return chunkHBPYSPBY_cjs.createTokenStore; }
196
+ get: function () { return chunk55S5VUWR_cjs.createTokenStore; }
193
197
  });
194
198
  Object.defineProperty(exports, "generateCodeChallenge", {
195
199
  enumerable: true,
196
- get: function () { return chunkHBPYSPBY_cjs.generateCodeChallenge; }
200
+ get: function () { return chunk55S5VUWR_cjs.generateCodeChallenge; }
197
201
  });
198
202
  Object.defineProperty(exports, "generateCodeVerifier", {
199
203
  enumerable: true,
200
- get: function () { return chunkHBPYSPBY_cjs.generateCodeVerifier; }
204
+ get: function () { return chunk55S5VUWR_cjs.generateCodeVerifier; }
201
205
  });
202
206
  Object.defineProperty(exports, "handleRedirectCallback", {
203
207
  enumerable: true,
204
- get: function () { return chunkHBPYSPBY_cjs.handleRedirectCallback; }
208
+ get: function () { return chunk55S5VUWR_cjs.handleRedirectCallback; }
205
209
  });
206
210
  Object.defineProperty(exports, "hasAccessFromUserinfo", {
207
211
  enumerable: true,
208
- get: function () { return chunkHBPYSPBY_cjs.hasAccessFromUserinfo; }
212
+ get: function () { return chunk55S5VUWR_cjs.hasAccessFromUserinfo; }
209
213
  });
210
214
  Object.defineProperty(exports, "isBlockedFromUserinfo", {
211
215
  enumerable: true,
212
- get: function () { return chunkHBPYSPBY_cjs.isBlockedFromUserinfo; }
216
+ get: function () { return chunk55S5VUWR_cjs.isBlockedFromUserinfo; }
213
217
  });
214
218
  Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
215
219
  enumerable: true,
216
- get: function () { return chunkHBPYSPBY_cjs.isFFIDInquiryCategorySite2026; }
220
+ get: function () { return chunk55S5VUWR_cjs.isFFIDInquiryCategorySite2026; }
217
221
  });
218
222
  Object.defineProperty(exports, "normalizeRedirectUri", {
219
223
  enumerable: true,
220
- get: function () { return chunkHBPYSPBY_cjs.normalizeRedirectUri; }
224
+ get: function () { return chunk55S5VUWR_cjs.normalizeRedirectUri; }
221
225
  });
222
226
  Object.defineProperty(exports, "retrieveCodeVerifier", {
223
227
  enumerable: true,
224
- get: function () { return chunkHBPYSPBY_cjs.retrieveCodeVerifier; }
228
+ get: function () { return chunk55S5VUWR_cjs.retrieveCodeVerifier; }
225
229
  });
226
230
  Object.defineProperty(exports, "retrieveState", {
227
231
  enumerable: true,
228
- get: function () { return chunkHBPYSPBY_cjs.retrieveState; }
232
+ get: function () { return chunk55S5VUWR_cjs.retrieveState; }
229
233
  });
230
234
  Object.defineProperty(exports, "storeCodeVerifier", {
231
235
  enumerable: true,
232
- get: function () { return chunkHBPYSPBY_cjs.storeCodeVerifier; }
236
+ get: function () { return chunk55S5VUWR_cjs.storeCodeVerifier; }
233
237
  });
234
238
  Object.defineProperty(exports, "storeState", {
235
239
  enumerable: true,
236
- get: function () { return chunkHBPYSPBY_cjs.storeState; }
240
+ get: function () { return chunk55S5VUWR_cjs.storeState; }
237
241
  });
238
242
  Object.defineProperty(exports, "useFFID", {
239
243
  enumerable: true,
240
- get: function () { return chunkHBPYSPBY_cjs.useFFID; }
244
+ get: function () { return chunk55S5VUWR_cjs.useFFID; }
241
245
  });
242
246
  Object.defineProperty(exports, "useFFIDAnnouncements", {
243
247
  enumerable: true,
244
- get: function () { return chunkHBPYSPBY_cjs.useFFIDAnnouncements; }
248
+ get: function () { return chunk55S5VUWR_cjs.useFFIDAnnouncements; }
245
249
  });
246
250
  Object.defineProperty(exports, "useSubscription", {
247
251
  enumerable: true,
248
- get: function () { return chunkHBPYSPBY_cjs.useSubscription; }
252
+ get: function () { return chunk55S5VUWR_cjs.useSubscription; }
249
253
  });
250
254
  Object.defineProperty(exports, "withSubscription", {
251
255
  enumerable: true,
252
- get: function () { return chunkHBPYSPBY_cjs.withSubscription; }
256
+ get: function () { return chunk55S5VUWR_cjs.withSubscription; }
253
257
  });
254
258
  Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
255
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 FFIDRedirectResult, f as FFIDError, g as FFIDSubscriptionCheckResponse, h as FFIDCheckServiceAccessParams, i as FFIDServiceAccessDecision, j as FFIDAnalyticsConfig, k as FFIDVerifyAccessTokenOptions, l as FFIDOAuthUserInfo, m as FFIDInquiryCreateParams, n as FFIDInquiryCreateResponse, o as FFIDAuthMode, p as FFIDLogger, q as FFIDCacheAdapter, r as FFIDUser, s as FFIDOrganization, t as FFIDSubscription, u as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, v as FFIDOAuthUserInfoSubscription, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-CG0vObax.cjs';
2
- export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDCacheConfig, N as FFIDContextValue, O as FFIDInquiryCategory, P as FFIDInquiryCategorySite2026, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, _ as FFIDJwtClaims, $ as FFIDLoginButton, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOrganizationSwitcher, a3 as FFIDRedirectErrorCode, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDTokenIntrospectionResponse, a9 as FFIDUserMenu, aa as FFID_INQUIRY_CATEGORIES, ab as FFID_INQUIRY_CATEGORIES_SITE_2026, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as isFFIDInquiryCategorySite2026, af as useFFIDAnnouncements } from './index-CG0vObax.cjs';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDRedirectResult, f as FFIDError, g as FFIDSubscriptionCheckResponse, h as FFIDCheckServiceAccessParams, i as FFIDServiceAccessDecision, j as FFIDAnalyticsConfig, k as FFIDVerifyAccessTokenOptions, l as FFIDOAuthUserInfo, m as FFIDInquiryCreateParams, n as FFIDInquiryCreateResponse, o as FFIDAuthMode, p as FFIDLogger, q as FFIDCacheAdapter, r as FFIDUser, s as FFIDOrganization, t as FFIDSubscription, u as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, v as FFIDOAuthUserInfoSubscription, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-Bkul-fRw.cjs';
2
+ export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDCacheConfig, N as FFIDContextValue, O as FFIDInquiryCategory, P as FFIDInquiryCategorySite2026, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, _ as FFIDJwtClaims, $ as FFIDLoginButton, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOrganizationSwitcher, a3 as FFIDRedirectErrorCode, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDTokenIntrospectionResponse, a9 as FFIDUserMenu, aa as FFID_INQUIRY_CATEGORIES, ab as FFID_INQUIRY_CATEGORIES_SITE_2026, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as isFFIDInquiryCategorySite2026, af as useFFIDAnnouncements } from './index-Bkul-fRw.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';
@@ -1127,6 +1127,33 @@ interface RedirectToAuthorizeOptions {
1127
1127
  prompt?: FFIDPrompt;
1128
1128
  }
1129
1129
 
1130
+ /**
1131
+ * FFID SDK error codes
1132
+ *
1133
+ * Codes the SDK itself attaches to `FFIDError.code`. Exported from the
1134
+ * package entry points so consumers can branch on codes (e.g.
1135
+ * `TOKEN_EXPIRED` vs `TOKEN_VERIFICATION_ERROR`) without hardcoding strings.
1136
+ */
1137
+ /** Error codes used by the SDK */
1138
+ declare const FFID_ERROR_CODES: {
1139
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
1140
+ readonly PARSE_ERROR: "PARSE_ERROR";
1141
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
1142
+ readonly TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR";
1143
+ readonly TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR";
1144
+ readonly NO_TOKENS: "NO_TOKENS";
1145
+ readonly TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR";
1146
+ readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
1147
+ readonly STATE_MISMATCH_ERROR: "STATE_MISMATCH_ERROR";
1148
+ };
1149
+ /**
1150
+ * Union of the error code literals the SDK itself produces.
1151
+ *
1152
+ * Note: `FFIDError.code` intentionally stays `string` — server-provided
1153
+ * error codes pass through verbatim and must not be narrowed away.
1154
+ */
1155
+ type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
1156
+
1130
1157
  /** Creates an FFID API client instance */
1131
1158
  declare function createFFIDClient(config: FFIDConfig): {
1132
1159
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
@@ -2040,4 +2067,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
2040
2067
  };
2041
2068
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
2042
2069
 
2043
- 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 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, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, 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_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 };
2070
+ 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, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, 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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDRedirectResult, f as FFIDError, g as FFIDSubscriptionCheckResponse, h as FFIDCheckServiceAccessParams, i as FFIDServiceAccessDecision, j as FFIDAnalyticsConfig, k as FFIDVerifyAccessTokenOptions, l as FFIDOAuthUserInfo, m as FFIDInquiryCreateParams, n as FFIDInquiryCreateResponse, o as FFIDAuthMode, p as FFIDLogger, q as FFIDCacheAdapter, r as FFIDUser, s as FFIDOrganization, t as FFIDSubscription, u as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, v as FFIDOAuthUserInfoSubscription, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-CG0vObax.js';
2
- export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDCacheConfig, N as FFIDContextValue, O as FFIDInquiryCategory, P as FFIDInquiryCategorySite2026, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, _ as FFIDJwtClaims, $ as FFIDLoginButton, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOrganizationSwitcher, a3 as FFIDRedirectErrorCode, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDTokenIntrospectionResponse, a9 as FFIDUserMenu, aa as FFID_INQUIRY_CATEGORIES, ab as FFID_INQUIRY_CATEGORIES_SITE_2026, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as isFFIDInquiryCategorySite2026, af as useFFIDAnnouncements } from './index-CG0vObax.js';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDRedirectResult, f as FFIDError, g as FFIDSubscriptionCheckResponse, h as FFIDCheckServiceAccessParams, i as FFIDServiceAccessDecision, j as FFIDAnalyticsConfig, k as FFIDVerifyAccessTokenOptions, l as FFIDOAuthUserInfo, m as FFIDInquiryCreateParams, n as FFIDInquiryCreateResponse, o as FFIDAuthMode, p as FFIDLogger, q as FFIDCacheAdapter, r as FFIDUser, s as FFIDOrganization, t as FFIDSubscription, u as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, v as FFIDOAuthUserInfoSubscription, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-Bkul-fRw.js';
2
+ export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDCacheConfig, N as FFIDContextValue, O as FFIDInquiryCategory, P as FFIDInquiryCategorySite2026, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, _ as FFIDJwtClaims, $ as FFIDLoginButton, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOrganizationSwitcher, a3 as FFIDRedirectErrorCode, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDTokenIntrospectionResponse, a9 as FFIDUserMenu, aa as FFID_INQUIRY_CATEGORIES, ab as FFID_INQUIRY_CATEGORIES_SITE_2026, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as isFFIDInquiryCategorySite2026, af as useFFIDAnnouncements } from './index-Bkul-fRw.js';
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.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ReactNode, ComponentType, FC } from 'react';
@@ -1127,6 +1127,33 @@ interface RedirectToAuthorizeOptions {
1127
1127
  prompt?: FFIDPrompt;
1128
1128
  }
1129
1129
 
1130
+ /**
1131
+ * FFID SDK error codes
1132
+ *
1133
+ * Codes the SDK itself attaches to `FFIDError.code`. Exported from the
1134
+ * package entry points so consumers can branch on codes (e.g.
1135
+ * `TOKEN_EXPIRED` vs `TOKEN_VERIFICATION_ERROR`) without hardcoding strings.
1136
+ */
1137
+ /** Error codes used by the SDK */
1138
+ declare const FFID_ERROR_CODES: {
1139
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
1140
+ readonly PARSE_ERROR: "PARSE_ERROR";
1141
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
1142
+ readonly TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR";
1143
+ readonly TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR";
1144
+ readonly NO_TOKENS: "NO_TOKENS";
1145
+ readonly TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR";
1146
+ readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
1147
+ readonly STATE_MISMATCH_ERROR: "STATE_MISMATCH_ERROR";
1148
+ };
1149
+ /**
1150
+ * Union of the error code literals the SDK itself produces.
1151
+ *
1152
+ * Note: `FFIDError.code` intentionally stays `string` — server-provided
1153
+ * error codes pass through verbatim and must not be narrowed away.
1154
+ */
1155
+ type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
1156
+
1130
1157
  /** Creates an FFID API client instance */
1131
1158
  declare function createFFIDClient(config: FFIDConfig): {
1132
1159
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
@@ -2040,4 +2067,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
2040
2067
  };
2041
2068
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
2042
2069
 
2043
- 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 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, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, 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_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 };
2070
+ 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, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, 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 };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-HLCHSKAF.js';
2
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-HLCHSKAF.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-L2H56C4W.js';
2
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-L2H56C4W.js';
3
3
  export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, CONSENT_DISMISSAL_TIMESTAMP_KEY, COOKIE_VERSION, DEFAULT_CONSENT_ERROR_MESSAGES, FFIDAnalyticsProvider, FFIDConsentError, FFIDCookieBanner, FFIDCookieLink, FFIDCookieSettings, FFID_CONSENT_ERROR_CODES, clearConsentDismissalTimestamp, decodeConsentCookie, encodeConsentCookie, readConsentCookie, readConsentDismissalTimestamp, useFFIDConsent, useFFIDConsentPreferences, writeConsentCookie, writeConsentDismissalTimestamp } from './chunk-G7VOX64X.js';
4
4
  import { useEffect, useRef } from 'react';
5
5
  import { jsx, Fragment } from 'react/jsx-runtime';
@@ -112,10 +112,13 @@ function hasOwnKey(value, key) {
112
112
  function normalizeUserinfo(raw) {
113
113
  const hasOrganizationId = hasOwnKey(raw, "organization_id");
114
114
  const hasOrganizationName = hasOwnKey(raw, "organization_name");
115
- const organizationFields = hasOrganizationId ? {
116
- organizationId: raw.organization_id ?? null,
117
- organizationName: hasOrganizationName ? raw.organization_name ?? null : null
118
- } : hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {};
115
+ const hasOrganizationMemberRole = hasOwnKey(raw, "organization_member_role");
116
+ const organizationMemberRole = hasOrganizationMemberRole ? raw.organization_member_role ?? null : raw.subscription ? raw.subscription.member_role ?? null : void 0;
117
+ const organizationFields = {
118
+ ...hasOrganizationId ? { organizationId: raw.organization_id ?? null } : {},
119
+ ...hasOrganizationId || hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {},
120
+ ...organizationMemberRole !== void 0 ? { organizationMemberRole } : {}
121
+ };
119
122
  return {
120
123
  sub: raw.sub,
121
124
  email: raw.email,
@@ -222,10 +225,29 @@ function createJwtVerifier(deps) {
222
225
  return { data: userInfo };
223
226
  } catch (error) {
224
227
  const message = error instanceof Error ? error.message : "JWT\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F";
225
- logger.error("JWT verification failed:", message);
228
+ if (error instanceof jose.errors.JWTExpired) {
229
+ logger.debug("JWT verification failed (token expired):", message);
230
+ return {
231
+ error: createError(
232
+ errorCodes.TOKEN_EXPIRED,
233
+ "\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059"
234
+ )
235
+ };
236
+ }
237
+ const isTokenLevelError = error instanceof jose.errors.JWTClaimValidationFailed || error instanceof jose.errors.JWTInvalid || error instanceof jose.errors.JWSInvalid || error instanceof jose.errors.JWSSignatureVerificationFailed || error instanceof jose.errors.JOSEAlgNotAllowed || error instanceof jose.errors.JOSENotSupported || error instanceof jose.errors.JWKSNoMatchingKey || error instanceof jose.errors.JWKSMultipleMatchingKeys;
238
+ if (isTokenLevelError) {
239
+ logger.warn("JWT verification failed:", message);
240
+ return {
241
+ error: createError(
242
+ errorCodes.TOKEN_VERIFICATION_ERROR,
243
+ `JWT\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${message}`
244
+ )
245
+ };
246
+ }
247
+ logger.error("JWT verification failed (JWKS fetch):", message);
226
248
  return {
227
249
  error: createError(
228
- errorCodes.TOKEN_VERIFICATION_ERROR,
250
+ errorCodes.NETWORK_ERROR,
229
251
  `JWT\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${message}`
230
252
  )
231
253
  };
@@ -250,7 +272,9 @@ function createVerifyAccessToken(deps) {
250
272
  serviceCode,
251
273
  logger,
252
274
  createError,
253
- errorCodes: { TOKEN_VERIFICATION_ERROR: errorCodes.TOKEN_VERIFICATION_ERROR }
275
+ // structural superset of JwtVerifierDeps.errorCodes — passing it
276
+ // wholesale removes the hand-transcription drift point
277
+ errorCodes
254
278
  });
255
279
  }
256
280
  return jwtVerify2;
@@ -1090,7 +1114,7 @@ function createNonContractMethods(deps) {
1090
1114
  }
1091
1115
 
1092
1116
  // src/client/version-check.ts
1093
- var SDK_VERSION = "5.17.0";
1117
+ var SDK_VERSION = "5.18.0";
1094
1118
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1095
1119
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1096
1120
  function sdkHeaders() {
@@ -2517,6 +2541,19 @@ var BLOCKING_EFFECTIVE_STATUSES = [
2517
2541
  "trial_expired"
2518
2542
  ];
2519
2543
 
2544
+ // src/client/error-codes.ts
2545
+ var FFID_ERROR_CODES = {
2546
+ NETWORK_ERROR: "NETWORK_ERROR",
2547
+ PARSE_ERROR: "PARSE_ERROR",
2548
+ UNKNOWN_ERROR: "UNKNOWN_ERROR",
2549
+ TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR",
2550
+ TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR",
2551
+ NO_TOKENS: "NO_TOKENS",
2552
+ TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR",
2553
+ TOKEN_EXPIRED: "TOKEN_EXPIRED",
2554
+ STATE_MISMATCH_ERROR: "STATE_MISMATCH_ERROR"
2555
+ };
2556
+
2520
2557
  // src/client/ffid-client.ts
2521
2558
  var UNAUTHORIZED_STATUS2 = 401;
2522
2559
  var SDK_LOG_PREFIX = "[FFID SDK]";
@@ -2525,8 +2562,10 @@ var noopLogger = {
2525
2562
  },
2526
2563
  info: () => {
2527
2564
  },
2528
- warn: (...args) => console.warn(SDK_LOG_PREFIX, ...args),
2529
- error: (...args) => console.error(SDK_LOG_PREFIX, ...args)
2565
+ warn: () => {
2566
+ },
2567
+ error: () => {
2568
+ }
2530
2569
  };
2531
2570
  var consoleLogger = {
2532
2571
  debug: (...args) => console.debug(SDK_LOG_PREFIX, ...args),
@@ -2534,16 +2573,6 @@ var consoleLogger = {
2534
2573
  warn: (...args) => console.warn(SDK_LOG_PREFIX, ...args),
2535
2574
  error: (...args) => console.error(SDK_LOG_PREFIX, ...args)
2536
2575
  };
2537
- var FFID_ERROR_CODES = {
2538
- NETWORK_ERROR: "NETWORK_ERROR",
2539
- PARSE_ERROR: "PARSE_ERROR",
2540
- UNKNOWN_ERROR: "UNKNOWN_ERROR",
2541
- TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR",
2542
- TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR",
2543
- NO_TOKENS: "NO_TOKENS",
2544
- TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR",
2545
- STATE_MISMATCH_ERROR: "STATE_MISMATCH_ERROR"
2546
- };
2547
2576
  var EXT_CHECK_ENDPOINT = "/api/v1/subscriptions/ext/check";
2548
2577
  var DEFAULT_ALLOW_GRACE = true;
2549
2578
  var DEFAULT_SERVICE_ACCESS_FAIL_POLICY = "failClosed";
@@ -3224,6 +3253,7 @@ Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
3224
3253
  exports.ALL_DENIED_EXCEPT_NECESSARY = ALL_DENIED_EXCEPT_NECESSARY;
3225
3254
  exports.CONSENT_COOKIE_NAME = CONSENT_COOKIE_NAME;
3226
3255
  exports.COOKIE_VERSION = COOKIE_VERSION;
3256
+ exports.FFID_ERROR_CODES = FFID_ERROR_CODES;
3227
3257
  exports.createFFIDClient = createFFIDClient;
3228
3258
  exports.createKVCacheAdapter = createKVCacheAdapter;
3229
3259
  exports.createMemoryCacheAdapter = createMemoryCacheAdapter;
@@ -1,9 +1,36 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DZEK3tkP.cjs';
2
- export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-DZEK3tkP.cjs';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-Cwk6cG3b.cjs';
2
+ export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-Cwk6cG3b.cjs';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
4
4
  import { z } from 'zod';
5
5
  import '../types-BeVl-z12.cjs';
6
6
 
7
+ /**
8
+ * FFID SDK error codes
9
+ *
10
+ * Codes the SDK itself attaches to `FFIDError.code`. Exported from the
11
+ * package entry points so consumers can branch on codes (e.g.
12
+ * `TOKEN_EXPIRED` vs `TOKEN_VERIFICATION_ERROR`) without hardcoding strings.
13
+ */
14
+ /** Error codes used by the SDK */
15
+ declare const FFID_ERROR_CODES: {
16
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
17
+ readonly PARSE_ERROR: "PARSE_ERROR";
18
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
19
+ readonly TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR";
20
+ readonly TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR";
21
+ readonly NO_TOKENS: "NO_TOKENS";
22
+ readonly TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR";
23
+ readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
24
+ readonly STATE_MISMATCH_ERROR: "STATE_MISMATCH_ERROR";
25
+ };
26
+ /**
27
+ * Union of the error code literals the SDK itself produces.
28
+ *
29
+ * Note: `FFIDError.code` intentionally stays `string` — server-provided
30
+ * error codes pass through verbatim and must not be narrowed away.
31
+ */
32
+ type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
33
+
7
34
  /** Token verification - verifyAccessToken() implementation */
8
35
 
9
36
  /** Dependencies required by verifyAccessToken */
@@ -16,9 +43,10 @@ interface VerifyAccessTokenDeps {
16
43
  logger: FFIDLogger;
17
44
  createError: (code: string, message: string) => FFIDError;
18
45
  errorCodes: {
19
- NETWORK_ERROR: string;
20
- PARSE_ERROR: string;
21
- TOKEN_VERIFICATION_ERROR: string;
46
+ NETWORK_ERROR: 'NETWORK_ERROR';
47
+ PARSE_ERROR: 'PARSE_ERROR';
48
+ TOKEN_VERIFICATION_ERROR: 'TOKEN_VERIFICATION_ERROR';
49
+ TOKEN_EXPIRED: 'TOKEN_EXPIRED';
22
50
  };
23
51
  cache?: {
24
52
  adapter: FFIDCacheAdapter;
@@ -205,4 +233,4 @@ declare function decodeConsentCookie(raw: string | null | undefined): FFIDConsen
205
233
 
206
234
  declare const CONSENT_COOKIE_NAME = "ffid_consent";
207
235
 
208
- export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, COOKIE_VERSION, FFIDCacheAdapter, type FFIDConsentCategories, type FFIDConsentCategoryCode, type FFIDCookieStoreLike, FFIDOAuthUserInfo, FFIDVerifyAccessTokenOptions, type KVNamespaceLike, createKVCacheAdapter, createMemoryCacheAdapter, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies };
236
+ export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, COOKIE_VERSION, FFIDCacheAdapter, type FFIDConsentCategories, type FFIDConsentCategoryCode, type FFIDCookieStoreLike, type FFIDErrorCode, FFIDOAuthUserInfo, FFIDVerifyAccessTokenOptions, FFID_ERROR_CODES, type KVNamespaceLike, createKVCacheAdapter, createMemoryCacheAdapter, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies };
@@ -1,9 +1,36 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-BtS84epg.js';
2
- export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-BtS84epg.js';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-w8Twi5lD.js';
2
+ export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-w8Twi5lD.js';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.js';
4
4
  import { z } from 'zod';
5
5
  import '../types-BeVl-z12.js';
6
6
 
7
+ /**
8
+ * FFID SDK error codes
9
+ *
10
+ * Codes the SDK itself attaches to `FFIDError.code`. Exported from the
11
+ * package entry points so consumers can branch on codes (e.g.
12
+ * `TOKEN_EXPIRED` vs `TOKEN_VERIFICATION_ERROR`) without hardcoding strings.
13
+ */
14
+ /** Error codes used by the SDK */
15
+ declare const FFID_ERROR_CODES: {
16
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
17
+ readonly PARSE_ERROR: "PARSE_ERROR";
18
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
19
+ readonly TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR";
20
+ readonly TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR";
21
+ readonly NO_TOKENS: "NO_TOKENS";
22
+ readonly TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR";
23
+ readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
24
+ readonly STATE_MISMATCH_ERROR: "STATE_MISMATCH_ERROR";
25
+ };
26
+ /**
27
+ * Union of the error code literals the SDK itself produces.
28
+ *
29
+ * Note: `FFIDError.code` intentionally stays `string` — server-provided
30
+ * error codes pass through verbatim and must not be narrowed away.
31
+ */
32
+ type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
33
+
7
34
  /** Token verification - verifyAccessToken() implementation */
8
35
 
9
36
  /** Dependencies required by verifyAccessToken */
@@ -16,9 +43,10 @@ interface VerifyAccessTokenDeps {
16
43
  logger: FFIDLogger;
17
44
  createError: (code: string, message: string) => FFIDError;
18
45
  errorCodes: {
19
- NETWORK_ERROR: string;
20
- PARSE_ERROR: string;
21
- TOKEN_VERIFICATION_ERROR: string;
46
+ NETWORK_ERROR: 'NETWORK_ERROR';
47
+ PARSE_ERROR: 'PARSE_ERROR';
48
+ TOKEN_VERIFICATION_ERROR: 'TOKEN_VERIFICATION_ERROR';
49
+ TOKEN_EXPIRED: 'TOKEN_EXPIRED';
22
50
  };
23
51
  cache?: {
24
52
  adapter: FFIDCacheAdapter;
@@ -205,4 +233,4 @@ declare function decodeConsentCookie(raw: string | null | undefined): FFIDConsen
205
233
 
206
234
  declare const CONSENT_COOKIE_NAME = "ffid_consent";
207
235
 
208
- export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, COOKIE_VERSION, FFIDCacheAdapter, type FFIDConsentCategories, type FFIDConsentCategoryCode, type FFIDCookieStoreLike, FFIDOAuthUserInfo, FFIDVerifyAccessTokenOptions, type KVNamespaceLike, createKVCacheAdapter, createMemoryCacheAdapter, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies };
236
+ export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, COOKIE_VERSION, FFIDCacheAdapter, type FFIDConsentCategories, type FFIDConsentCategoryCode, type FFIDCookieStoreLike, type FFIDErrorCode, FFIDOAuthUserInfo, FFIDVerifyAccessTokenOptions, FFID_ERROR_CODES, type KVNamespaceLike, createKVCacheAdapter, createMemoryCacheAdapter, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies };