@feelflow/ffid-sdk 1.7.2 → 1.8.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/README.md CHANGED
@@ -17,6 +17,10 @@ yarn add @feelflow/ffid-sdk
17
17
  pnpm add @feelflow/ffid-sdk
18
18
  ```
19
19
 
20
+ ## 統合ガイド
21
+
22
+ サービスを FFID Platform に統合する詳細なガイドは **[Integration Guide](./docs/INTEGRATION_GUIDE.md)** を参照してください。OAuth フロー、フロントエンド/バックエンド実装パターン、セキュリティチェックリスト、アンチパターン集を網羅しています。
23
+
20
24
  ## クイックスタート
21
25
 
22
26
  ### 1. プロバイダーを設定(5行で完了!)
@@ -263,9 +267,10 @@ token mode では SDK は `/api/v1/oauth/userinfo` を呼び出し、基本プ
263
267
 
264
268
  ```ts
265
269
  interface FFIDOAuthUserInfoSubscription {
270
+ subscriptionId: string | null
266
271
  status: 'trialing' | 'active' | 'past_due' | 'canceled' | 'paused' | null
267
272
  planCode: string | null
268
- seatModel: 'organization' | 'individual' | null
273
+ seatModel: 'organization' | null
269
274
  memberRole: 'owner' | 'admin' | 'member' | 'viewer' | null
270
275
  organizationId: string | null
271
276
  }
@@ -412,6 +412,43 @@ function createBillingMethods(deps) {
412
412
  return { createCheckoutSession, createPortalSession };
413
413
  }
414
414
 
415
+ // src/client/version-check.ts
416
+ var SDK_VERSION = "1.8.0";
417
+ var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
418
+ var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
419
+ var LATEST_VERSION_HEADER = "X-FFID-SDK-Latest-Version";
420
+ var SEMVER_PATTERN = /^\d+(\.\d+)*$/;
421
+ var _versionWarningShown = false;
422
+ function compareSemver(a, b) {
423
+ const cleanA = a.replace(/^v/, "");
424
+ const cleanB = b.replace(/^v/, "");
425
+ if (!SEMVER_PATTERN.test(cleanA) || !SEMVER_PATTERN.test(cleanB)) return 0;
426
+ const partsA = cleanA.split(".").map(Number);
427
+ const partsB = cleanB.split(".").map(Number);
428
+ const maxLen = Math.max(partsA.length, partsB.length);
429
+ for (let i = 0; i < maxLen; i++) {
430
+ const numA = partsA[i] ?? 0;
431
+ const numB = partsB[i] ?? 0;
432
+ if (numA < numB) return -1;
433
+ if (numA > numB) return 1;
434
+ }
435
+ return 0;
436
+ }
437
+ function checkVersionHeader(response, logger) {
438
+ if (_versionWarningShown) return;
439
+ if (typeof process !== "undefined" && process.env?.NODE_ENV === "production") return;
440
+ if (!response.headers?.get) return;
441
+ const latestVersion = response.headers.get(LATEST_VERSION_HEADER);
442
+ if (!latestVersion) return;
443
+ if (compareSemver(SDK_VERSION, latestVersion) < 0) {
444
+ _versionWarningShown = true;
445
+ logger.warn(
446
+ `\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u5229\u7528\u53EF\u80FD\u3067\u3059: v${latestVersion} (\u73FE\u5728: v${SDK_VERSION})
447
+ npm install @feelflow/ffid-sdk@latest \u3067\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3067\u304D\u307E\u3059`
448
+ );
449
+ }
450
+ }
451
+
415
452
  // src/client/ffid-client.ts
416
453
  var NO_CONTENT_STATUS = 204;
417
454
  var SESSION_ENDPOINT = "/api/v1/auth/session";
@@ -512,6 +549,7 @@ function createFFIDClient(config) {
512
549
  };
513
550
  }
514
551
  logger.debug("Response:", response.status, raw);
552
+ checkVersionHeader(response, logger);
515
553
  if (!response.ok) {
516
554
  return {
517
555
  error: raw.error ?? {
@@ -530,6 +568,12 @@ function createFFIDClient(config) {
530
568
  }
531
569
  return { data: raw.data };
532
570
  }
571
+ function sdkHeaders() {
572
+ return {
573
+ "User-Agent": SDK_USER_AGENT,
574
+ [SDK_VERSION_HEADER]: SDK_VERSION
575
+ };
576
+ }
533
577
  function buildFetchOptions(options) {
534
578
  if (authMode === "service-key") {
535
579
  return {
@@ -537,6 +581,7 @@ function createFFIDClient(config) {
537
581
  credentials: "omit",
538
582
  headers: {
539
583
  "Content-Type": "application/json",
584
+ ...sdkHeaders(),
540
585
  "X-Service-Api-Key": serviceApiKey,
541
586
  ...options.headers
542
587
  }
@@ -546,6 +591,7 @@ function createFFIDClient(config) {
546
591
  const tokens = tokenStore.getTokens();
547
592
  const headers = {
548
593
  "Content-Type": "application/json",
594
+ ...sdkHeaders(),
549
595
  ...options.headers
550
596
  };
551
597
  if (tokens) {
@@ -562,6 +608,7 @@ function createFFIDClient(config) {
562
608
  credentials: "include",
563
609
  headers: {
564
610
  "Content-Type": "application/json",
611
+ ...sdkHeaders(),
565
612
  ...options.headers
566
613
  }
567
614
  };
@@ -607,7 +654,8 @@ function createFFIDClient(config) {
607
654
  credentials: "omit",
608
655
  headers: {
609
656
  "Authorization": `Bearer ${tokens.accessToken}`,
610
- "Content-Type": "application/json"
657
+ "Content-Type": "application/json",
658
+ ...sdkHeaders()
611
659
  }
612
660
  });
613
661
  } catch (error) {
@@ -629,7 +677,8 @@ function createFFIDClient(config) {
629
677
  credentials: "omit",
630
678
  headers: {
631
679
  "Authorization": `Bearer ${retryTokens.accessToken}`,
632
- "Content-Type": "application/json"
680
+ "Content-Type": "application/json",
681
+ ...sdkHeaders()
633
682
  }
634
683
  });
635
684
  } catch (retryError) {
@@ -699,7 +748,7 @@ function createFFIDClient(config) {
699
748
  response = await fetch(url, {
700
749
  method: "POST",
701
750
  credentials: "include",
702
- headers: { "Content-Type": "application/json" }
751
+ headers: { "Content-Type": "application/json", ...sdkHeaders() }
703
752
  });
704
753
  } catch (error) {
705
754
  logger.error("Network error:", error);
@@ -748,7 +797,7 @@ function createFFIDClient(config) {
748
797
  await fetch(url, {
749
798
  method: "POST",
750
799
  credentials: "omit",
751
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
800
+ headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
752
801
  body: new URLSearchParams({
753
802
  token: tokens.accessToken,
754
803
  client_id: clientId
@@ -787,7 +836,7 @@ function createFFIDClient(config) {
787
836
  response = await fetch(url, {
788
837
  method: "POST",
789
838
  credentials: "omit",
790
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
839
+ headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
791
840
  body: new URLSearchParams(body).toString()
792
841
  });
793
842
  } catch (error) {
@@ -845,7 +894,7 @@ function createFFIDClient(config) {
845
894
  response = await fetch(url, {
846
895
  method: "POST",
847
896
  credentials: "omit",
848
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
897
+ headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
849
898
  body: new URLSearchParams({
850
899
  grant_type: "refresh_token",
851
900
  refresh_token: tokens.refreshToken,
@@ -1265,6 +1314,7 @@ function useFFID() {
1265
1314
  user: context.user,
1266
1315
  organizations: context.organizations,
1267
1316
  currentOrganization: context.currentOrganization,
1317
+ subscriptions: context.subscriptions,
1268
1318
  isLoading: context.isLoading,
1269
1319
  isAuthenticated: context.isAuthenticated,
1270
1320
  error: context.error,
@@ -414,6 +414,43 @@ function createBillingMethods(deps) {
414
414
  return { createCheckoutSession, createPortalSession };
415
415
  }
416
416
 
417
+ // src/client/version-check.ts
418
+ var SDK_VERSION = "1.8.0";
419
+ var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
420
+ var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
421
+ var LATEST_VERSION_HEADER = "X-FFID-SDK-Latest-Version";
422
+ var SEMVER_PATTERN = /^\d+(\.\d+)*$/;
423
+ var _versionWarningShown = false;
424
+ function compareSemver(a, b) {
425
+ const cleanA = a.replace(/^v/, "");
426
+ const cleanB = b.replace(/^v/, "");
427
+ if (!SEMVER_PATTERN.test(cleanA) || !SEMVER_PATTERN.test(cleanB)) return 0;
428
+ const partsA = cleanA.split(".").map(Number);
429
+ const partsB = cleanB.split(".").map(Number);
430
+ const maxLen = Math.max(partsA.length, partsB.length);
431
+ for (let i = 0; i < maxLen; i++) {
432
+ const numA = partsA[i] ?? 0;
433
+ const numB = partsB[i] ?? 0;
434
+ if (numA < numB) return -1;
435
+ if (numA > numB) return 1;
436
+ }
437
+ return 0;
438
+ }
439
+ function checkVersionHeader(response, logger) {
440
+ if (_versionWarningShown) return;
441
+ if (typeof process !== "undefined" && process.env?.NODE_ENV === "production") return;
442
+ if (!response.headers?.get) return;
443
+ const latestVersion = response.headers.get(LATEST_VERSION_HEADER);
444
+ if (!latestVersion) return;
445
+ if (compareSemver(SDK_VERSION, latestVersion) < 0) {
446
+ _versionWarningShown = true;
447
+ logger.warn(
448
+ `\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u5229\u7528\u53EF\u80FD\u3067\u3059: v${latestVersion} (\u73FE\u5728: v${SDK_VERSION})
449
+ npm install @feelflow/ffid-sdk@latest \u3067\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3067\u304D\u307E\u3059`
450
+ );
451
+ }
452
+ }
453
+
417
454
  // src/client/ffid-client.ts
418
455
  var NO_CONTENT_STATUS = 204;
419
456
  var SESSION_ENDPOINT = "/api/v1/auth/session";
@@ -514,6 +551,7 @@ function createFFIDClient(config) {
514
551
  };
515
552
  }
516
553
  logger.debug("Response:", response.status, raw);
554
+ checkVersionHeader(response, logger);
517
555
  if (!response.ok) {
518
556
  return {
519
557
  error: raw.error ?? {
@@ -532,6 +570,12 @@ function createFFIDClient(config) {
532
570
  }
533
571
  return { data: raw.data };
534
572
  }
573
+ function sdkHeaders() {
574
+ return {
575
+ "User-Agent": SDK_USER_AGENT,
576
+ [SDK_VERSION_HEADER]: SDK_VERSION
577
+ };
578
+ }
535
579
  function buildFetchOptions(options) {
536
580
  if (authMode === "service-key") {
537
581
  return {
@@ -539,6 +583,7 @@ function createFFIDClient(config) {
539
583
  credentials: "omit",
540
584
  headers: {
541
585
  "Content-Type": "application/json",
586
+ ...sdkHeaders(),
542
587
  "X-Service-Api-Key": serviceApiKey,
543
588
  ...options.headers
544
589
  }
@@ -548,6 +593,7 @@ function createFFIDClient(config) {
548
593
  const tokens = tokenStore.getTokens();
549
594
  const headers = {
550
595
  "Content-Type": "application/json",
596
+ ...sdkHeaders(),
551
597
  ...options.headers
552
598
  };
553
599
  if (tokens) {
@@ -564,6 +610,7 @@ function createFFIDClient(config) {
564
610
  credentials: "include",
565
611
  headers: {
566
612
  "Content-Type": "application/json",
613
+ ...sdkHeaders(),
567
614
  ...options.headers
568
615
  }
569
616
  };
@@ -609,7 +656,8 @@ function createFFIDClient(config) {
609
656
  credentials: "omit",
610
657
  headers: {
611
658
  "Authorization": `Bearer ${tokens.accessToken}`,
612
- "Content-Type": "application/json"
659
+ "Content-Type": "application/json",
660
+ ...sdkHeaders()
613
661
  }
614
662
  });
615
663
  } catch (error) {
@@ -631,7 +679,8 @@ function createFFIDClient(config) {
631
679
  credentials: "omit",
632
680
  headers: {
633
681
  "Authorization": `Bearer ${retryTokens.accessToken}`,
634
- "Content-Type": "application/json"
682
+ "Content-Type": "application/json",
683
+ ...sdkHeaders()
635
684
  }
636
685
  });
637
686
  } catch (retryError) {
@@ -701,7 +750,7 @@ function createFFIDClient(config) {
701
750
  response = await fetch(url, {
702
751
  method: "POST",
703
752
  credentials: "include",
704
- headers: { "Content-Type": "application/json" }
753
+ headers: { "Content-Type": "application/json", ...sdkHeaders() }
705
754
  });
706
755
  } catch (error) {
707
756
  logger.error("Network error:", error);
@@ -750,7 +799,7 @@ function createFFIDClient(config) {
750
799
  await fetch(url, {
751
800
  method: "POST",
752
801
  credentials: "omit",
753
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
802
+ headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
754
803
  body: new URLSearchParams({
755
804
  token: tokens.accessToken,
756
805
  client_id: clientId
@@ -789,7 +838,7 @@ function createFFIDClient(config) {
789
838
  response = await fetch(url, {
790
839
  method: "POST",
791
840
  credentials: "omit",
792
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
841
+ headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
793
842
  body: new URLSearchParams(body).toString()
794
843
  });
795
844
  } catch (error) {
@@ -847,7 +896,7 @@ function createFFIDClient(config) {
847
896
  response = await fetch(url, {
848
897
  method: "POST",
849
898
  credentials: "omit",
850
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
899
+ headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
851
900
  body: new URLSearchParams({
852
901
  grant_type: "refresh_token",
853
902
  refresh_token: tokens.refreshToken,
@@ -1267,6 +1316,7 @@ function useFFID() {
1267
1316
  user: context.user,
1268
1317
  organizations: context.organizations,
1269
1318
  currentOrganization: context.currentOrganization,
1319
+ subscriptions: context.subscriptions,
1270
1320
  isLoading: context.isLoading,
1271
1321
  isAuthenticated: context.isAuthenticated,
1272
1322
  error: context.error,
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunkFAX3PU43_cjs = require('../chunk-FAX3PU43.cjs');
3
+ var chunkDEN7AUNE_cjs = require('../chunk-DEN7AUNE.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunkFAX3PU43_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunkDEN7AUNE_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunkFAX3PU43_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunkDEN7AUNE_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDLoginButton", {
16
16
  enumerable: true,
17
- get: function () { return chunkFAX3PU43_cjs.FFIDLoginButton; }
17
+ get: function () { return chunkDEN7AUNE_cjs.FFIDLoginButton; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
20
20
  enumerable: true,
21
- get: function () { return chunkFAX3PU43_cjs.FFIDOrganizationSwitcher; }
21
+ get: function () { return chunkDEN7AUNE_cjs.FFIDOrganizationSwitcher; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
24
24
  enumerable: true,
25
- get: function () { return chunkFAX3PU43_cjs.FFIDSubscriptionBadge; }
25
+ get: function () { return chunkDEN7AUNE_cjs.FFIDSubscriptionBadge; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDUserMenu", {
28
28
  enumerable: true,
29
- get: function () { return chunkFAX3PU43_cjs.FFIDUserMenu; }
29
+ get: function () { return chunkDEN7AUNE_cjs.FFIDUserMenu; }
30
30
  });
@@ -1,3 +1,3 @@
1
- export { t as FFIDAnnouncementBadge, Q as FFIDAnnouncementBadgeClassNames, R as FFIDAnnouncementBadgeProps, u as FFIDAnnouncementList, S as FFIDAnnouncementListClassNames, T as FFIDAnnouncementListProps, B as FFIDLoginButton, V as FFIDLoginButtonProps, G as FFIDOrganizationSwitcher, W as FFIDOrganizationSwitcherClassNames, X as FFIDOrganizationSwitcherProps, J as FFIDSubscriptionBadge, Y as FFIDSubscriptionBadgeClassNames, Z as FFIDSubscriptionBadgeProps, N as FFIDUserMenu, _ as FFIDUserMenuClassNames, $ as FFIDUserMenuProps } from '../index-CpTGcffN.cjs';
1
+ export { u as FFIDAnnouncementBadge, Q as FFIDAnnouncementBadgeClassNames, R as FFIDAnnouncementBadgeProps, v as FFIDAnnouncementList, S as FFIDAnnouncementListClassNames, T as FFIDAnnouncementListProps, C as FFIDLoginButton, V as FFIDLoginButtonProps, H as FFIDOrganizationSwitcher, W as FFIDOrganizationSwitcherClassNames, X as FFIDOrganizationSwitcherProps, J as FFIDSubscriptionBadge, Y as FFIDSubscriptionBadgeClassNames, Z as FFIDSubscriptionBadgeProps, N as FFIDUserMenu, _ as FFIDUserMenuClassNames, $ as FFIDUserMenuProps } from '../index-ea8WAh39.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { t as FFIDAnnouncementBadge, Q as FFIDAnnouncementBadgeClassNames, R as FFIDAnnouncementBadgeProps, u as FFIDAnnouncementList, S as FFIDAnnouncementListClassNames, T as FFIDAnnouncementListProps, B as FFIDLoginButton, V as FFIDLoginButtonProps, G as FFIDOrganizationSwitcher, W as FFIDOrganizationSwitcherClassNames, X as FFIDOrganizationSwitcherProps, J as FFIDSubscriptionBadge, Y as FFIDSubscriptionBadgeClassNames, Z as FFIDSubscriptionBadgeProps, N as FFIDUserMenu, _ as FFIDUserMenuClassNames, $ as FFIDUserMenuProps } from '../index-CpTGcffN.js';
1
+ export { u as FFIDAnnouncementBadge, Q as FFIDAnnouncementBadgeClassNames, R as FFIDAnnouncementBadgeProps, v as FFIDAnnouncementList, S as FFIDAnnouncementListClassNames, T as FFIDAnnouncementListProps, C as FFIDLoginButton, V as FFIDLoginButtonProps, H as FFIDOrganizationSwitcher, W as FFIDOrganizationSwitcherClassNames, X as FFIDOrganizationSwitcherProps, J as FFIDSubscriptionBadge, Y as FFIDSubscriptionBadgeClassNames, Z as FFIDSubscriptionBadgeProps, N as FFIDUserMenu, _ as FFIDUserMenuClassNames, $ as FFIDUserMenuProps } from '../index-ea8WAh39.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-AZQOPZI6.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-7WZBWL56.js';
@@ -189,7 +189,7 @@ interface FFIDContextValue {
189
189
  organizations: FFIDOrganization[];
190
190
  /** Currently selected organization */
191
191
  currentOrganization: FFIDOrganization | null;
192
- /** User's subscriptions for the current service */
192
+ /** All subscriptions for the authenticated user (use useSubscription() for current-service filtering) */
193
193
  subscriptions: FFIDSubscription[];
194
194
  /** Whether authentication is being checked */
195
195
  isLoading: boolean;
@@ -727,4 +727,4 @@ interface FFIDAnnouncementListProps {
727
727
  */
728
728
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
729
729
 
730
- export { type FFIDUserMenuProps as $, type AnnouncementListResponse as A, FFIDLoginButton as B, type FFIDOAuthTokenResponse as C, type FFIDOAuthUserInfoMemberRole as D, type FFIDOAuthUserInfoSubscription as E, type FFIDConfig as F, FFIDOrganizationSwitcher as G, type FFIDSeatModel as H, type FFIDSubscription as I, FFIDSubscriptionBadge as J, type FFIDSubscriptionStatus as K, type ListAnnouncementsOptions as L, type FFIDTokenIntrospectionResponse as M, FFIDUserMenu as N, type UseFFIDAnnouncementsReturn as O, useFFIDAnnouncements as P, type FFIDAnnouncementBadgeClassNames as Q, type FFIDAnnouncementBadgeProps as R, type FFIDAnnouncementListClassNames as S, type FFIDAnnouncementListProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDLoginButtonProps as V, type FFIDOrganizationSwitcherClassNames as W, type FFIDOrganizationSwitcherProps as X, type FFIDSubscriptionBadgeClassNames as Y, type FFIDSubscriptionBadgeProps as Z, type FFIDUserMenuClassNames as _, type FFIDApiResponse as a, 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 FFIDUser as k, type FFIDOrganization as l, type FFIDSubscriptionContextValue as m, type FFIDAnnouncementsClientConfig as n, type FFIDAnnouncementsApiResponse as o, type FFIDAnnouncementsLogger as p, type Announcement as q, type AnnouncementStatus as r, type AnnouncementType as s, FFIDAnnouncementBadge as t, FFIDAnnouncementList as u, type FFIDAnnouncementsError as v, type FFIDAnnouncementsErrorCode as w, type FFIDAnnouncementsServerResponse as x, type FFIDContextValue as y, type FFIDJwtClaims as z };
730
+ export { type FFIDUserMenuProps as $, type AnnouncementListResponse as A, type FFIDJwtClaims as B, FFIDLoginButton as C, type FFIDOAuthTokenResponse as D, type FFIDOAuthUserInfoMemberRole as E, type FFIDConfig as F, type FFIDOAuthUserInfoSubscription as G, FFIDOrganizationSwitcher as H, type FFIDSeatModel as I, FFIDSubscriptionBadge as J, type FFIDSubscriptionStatus as K, type ListAnnouncementsOptions as L, type FFIDTokenIntrospectionResponse as M, FFIDUserMenu as N, type UseFFIDAnnouncementsReturn as O, useFFIDAnnouncements as P, type FFIDAnnouncementBadgeClassNames as Q, type FFIDAnnouncementBadgeProps as R, type FFIDAnnouncementListClassNames as S, type FFIDAnnouncementListProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDLoginButtonProps as V, type FFIDOrganizationSwitcherClassNames as W, type FFIDOrganizationSwitcherProps as X, type FFIDSubscriptionBadgeClassNames as Y, type FFIDSubscriptionBadgeProps as Z, type FFIDUserMenuClassNames as _, type FFIDApiResponse as a, 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 FFIDUser as k, type FFIDOrganization as l, type FFIDSubscription as m, type FFIDSubscriptionContextValue as n, type FFIDAnnouncementsClientConfig as o, type FFIDAnnouncementsApiResponse as p, type FFIDAnnouncementsLogger as q, type Announcement as r, type AnnouncementStatus as s, type AnnouncementType as t, FFIDAnnouncementBadge as u, FFIDAnnouncementList as v, type FFIDAnnouncementsError as w, type FFIDAnnouncementsErrorCode as x, type FFIDAnnouncementsServerResponse as y, type FFIDContextValue as z };
@@ -189,7 +189,7 @@ interface FFIDContextValue {
189
189
  organizations: FFIDOrganization[];
190
190
  /** Currently selected organization */
191
191
  currentOrganization: FFIDOrganization | null;
192
- /** User's subscriptions for the current service */
192
+ /** All subscriptions for the authenticated user (use useSubscription() for current-service filtering) */
193
193
  subscriptions: FFIDSubscription[];
194
194
  /** Whether authentication is being checked */
195
195
  isLoading: boolean;
@@ -727,4 +727,4 @@ interface FFIDAnnouncementListProps {
727
727
  */
728
728
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
729
729
 
730
- export { type FFIDUserMenuProps as $, type AnnouncementListResponse as A, FFIDLoginButton as B, type FFIDOAuthTokenResponse as C, type FFIDOAuthUserInfoMemberRole as D, type FFIDOAuthUserInfoSubscription as E, type FFIDConfig as F, FFIDOrganizationSwitcher as G, type FFIDSeatModel as H, type FFIDSubscription as I, FFIDSubscriptionBadge as J, type FFIDSubscriptionStatus as K, type ListAnnouncementsOptions as L, type FFIDTokenIntrospectionResponse as M, FFIDUserMenu as N, type UseFFIDAnnouncementsReturn as O, useFFIDAnnouncements as P, type FFIDAnnouncementBadgeClassNames as Q, type FFIDAnnouncementBadgeProps as R, type FFIDAnnouncementListClassNames as S, type FFIDAnnouncementListProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDLoginButtonProps as V, type FFIDOrganizationSwitcherClassNames as W, type FFIDOrganizationSwitcherProps as X, type FFIDSubscriptionBadgeClassNames as Y, type FFIDSubscriptionBadgeProps as Z, type FFIDUserMenuClassNames as _, type FFIDApiResponse as a, 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 FFIDUser as k, type FFIDOrganization as l, type FFIDSubscriptionContextValue as m, type FFIDAnnouncementsClientConfig as n, type FFIDAnnouncementsApiResponse as o, type FFIDAnnouncementsLogger as p, type Announcement as q, type AnnouncementStatus as r, type AnnouncementType as s, FFIDAnnouncementBadge as t, FFIDAnnouncementList as u, type FFIDAnnouncementsError as v, type FFIDAnnouncementsErrorCode as w, type FFIDAnnouncementsServerResponse as x, type FFIDContextValue as y, type FFIDJwtClaims as z };
730
+ export { type FFIDUserMenuProps as $, type AnnouncementListResponse as A, type FFIDJwtClaims as B, FFIDLoginButton as C, type FFIDOAuthTokenResponse as D, type FFIDOAuthUserInfoMemberRole as E, type FFIDConfig as F, type FFIDOAuthUserInfoSubscription as G, FFIDOrganizationSwitcher as H, type FFIDSeatModel as I, FFIDSubscriptionBadge as J, type FFIDSubscriptionStatus as K, type ListAnnouncementsOptions as L, type FFIDTokenIntrospectionResponse as M, FFIDUserMenu as N, type UseFFIDAnnouncementsReturn as O, useFFIDAnnouncements as P, type FFIDAnnouncementBadgeClassNames as Q, type FFIDAnnouncementBadgeProps as R, type FFIDAnnouncementListClassNames as S, type FFIDAnnouncementListProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDLoginButtonProps as V, type FFIDOrganizationSwitcherClassNames as W, type FFIDOrganizationSwitcherProps as X, type FFIDSubscriptionBadgeClassNames as Y, type FFIDSubscriptionBadgeProps as Z, type FFIDUserMenuClassNames as _, type FFIDApiResponse as a, 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 FFIDUser as k, type FFIDOrganization as l, type FFIDSubscription as m, type FFIDSubscriptionContextValue as n, type FFIDAnnouncementsClientConfig as o, type FFIDAnnouncementsApiResponse as p, type FFIDAnnouncementsLogger as q, type Announcement as r, type AnnouncementStatus as s, type AnnouncementType as t, FFIDAnnouncementBadge as u, FFIDAnnouncementList as v, type FFIDAnnouncementsError as w, type FFIDAnnouncementsErrorCode as x, type FFIDAnnouncementsServerResponse as y, type FFIDContextValue as z };
package/dist/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkFAX3PU43_cjs = require('./chunk-FAX3PU43.cjs');
3
+ var chunkDEN7AUNE_cjs = require('./chunk-DEN7AUNE.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
7
7
  function withFFIDAuth(Component, options = {}) {
8
8
  const WrappedComponent = (props) => {
9
- const { isLoading, isAuthenticated, login } = chunkFAX3PU43_cjs.useFFIDContext();
9
+ const { isLoading, isAuthenticated, login } = chunkDEN7AUNE_cjs.useFFIDContext();
10
10
  const hasRedirected = react.useRef(false);
11
11
  react.useEffect(() => {
12
12
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -31,82 +31,82 @@ function withFFIDAuth(Component, options = {}) {
31
31
 
32
32
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
33
33
  enumerable: true,
34
- get: function () { return chunkFAX3PU43_cjs.DEFAULT_API_BASE_URL; }
34
+ get: function () { return chunkDEN7AUNE_cjs.DEFAULT_API_BASE_URL; }
35
35
  });
36
36
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
37
37
  enumerable: true,
38
- get: function () { return chunkFAX3PU43_cjs.FFIDAnnouncementBadge; }
38
+ get: function () { return chunkDEN7AUNE_cjs.FFIDAnnouncementBadge; }
39
39
  });
40
40
  Object.defineProperty(exports, "FFIDAnnouncementList", {
41
41
  enumerable: true,
42
- get: function () { return chunkFAX3PU43_cjs.FFIDAnnouncementList; }
42
+ get: function () { return chunkDEN7AUNE_cjs.FFIDAnnouncementList; }
43
43
  });
44
44
  Object.defineProperty(exports, "FFIDLoginButton", {
45
45
  enumerable: true,
46
- get: function () { return chunkFAX3PU43_cjs.FFIDLoginButton; }
46
+ get: function () { return chunkDEN7AUNE_cjs.FFIDLoginButton; }
47
47
  });
48
48
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
49
49
  enumerable: true,
50
- get: function () { return chunkFAX3PU43_cjs.FFIDOrganizationSwitcher; }
50
+ get: function () { return chunkDEN7AUNE_cjs.FFIDOrganizationSwitcher; }
51
51
  });
52
52
  Object.defineProperty(exports, "FFIDProvider", {
53
53
  enumerable: true,
54
- get: function () { return chunkFAX3PU43_cjs.FFIDProvider; }
54
+ get: function () { return chunkDEN7AUNE_cjs.FFIDProvider; }
55
55
  });
56
56
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
57
57
  enumerable: true,
58
- get: function () { return chunkFAX3PU43_cjs.FFIDSubscriptionBadge; }
58
+ get: function () { return chunkDEN7AUNE_cjs.FFIDSubscriptionBadge; }
59
59
  });
60
60
  Object.defineProperty(exports, "FFIDUserMenu", {
61
61
  enumerable: true,
62
- get: function () { return chunkFAX3PU43_cjs.FFIDUserMenu; }
62
+ get: function () { return chunkDEN7AUNE_cjs.FFIDUserMenu; }
63
63
  });
64
64
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
65
65
  enumerable: true,
66
- get: function () { return chunkFAX3PU43_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
66
+ get: function () { return chunkDEN7AUNE_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
67
67
  });
68
68
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
69
69
  enumerable: true,
70
- get: function () { return chunkFAX3PU43_cjs.createFFIDAnnouncementsClient; }
70
+ get: function () { return chunkDEN7AUNE_cjs.createFFIDAnnouncementsClient; }
71
71
  });
72
72
  Object.defineProperty(exports, "createFFIDClient", {
73
73
  enumerable: true,
74
- get: function () { return chunkFAX3PU43_cjs.createFFIDClient; }
74
+ get: function () { return chunkDEN7AUNE_cjs.createFFIDClient; }
75
75
  });
76
76
  Object.defineProperty(exports, "createTokenStore", {
77
77
  enumerable: true,
78
- get: function () { return chunkFAX3PU43_cjs.createTokenStore; }
78
+ get: function () { return chunkDEN7AUNE_cjs.createTokenStore; }
79
79
  });
80
80
  Object.defineProperty(exports, "generateCodeChallenge", {
81
81
  enumerable: true,
82
- get: function () { return chunkFAX3PU43_cjs.generateCodeChallenge; }
82
+ get: function () { return chunkDEN7AUNE_cjs.generateCodeChallenge; }
83
83
  });
84
84
  Object.defineProperty(exports, "generateCodeVerifier", {
85
85
  enumerable: true,
86
- get: function () { return chunkFAX3PU43_cjs.generateCodeVerifier; }
86
+ get: function () { return chunkDEN7AUNE_cjs.generateCodeVerifier; }
87
87
  });
88
88
  Object.defineProperty(exports, "retrieveCodeVerifier", {
89
89
  enumerable: true,
90
- get: function () { return chunkFAX3PU43_cjs.retrieveCodeVerifier; }
90
+ get: function () { return chunkDEN7AUNE_cjs.retrieveCodeVerifier; }
91
91
  });
92
92
  Object.defineProperty(exports, "storeCodeVerifier", {
93
93
  enumerable: true,
94
- get: function () { return chunkFAX3PU43_cjs.storeCodeVerifier; }
94
+ get: function () { return chunkDEN7AUNE_cjs.storeCodeVerifier; }
95
95
  });
96
96
  Object.defineProperty(exports, "useFFID", {
97
97
  enumerable: true,
98
- get: function () { return chunkFAX3PU43_cjs.useFFID; }
98
+ get: function () { return chunkDEN7AUNE_cjs.useFFID; }
99
99
  });
100
100
  Object.defineProperty(exports, "useFFIDAnnouncements", {
101
101
  enumerable: true,
102
- get: function () { return chunkFAX3PU43_cjs.useFFIDAnnouncements; }
102
+ get: function () { return chunkDEN7AUNE_cjs.useFFIDAnnouncements; }
103
103
  });
104
104
  Object.defineProperty(exports, "useSubscription", {
105
105
  enumerable: true,
106
- get: function () { return chunkFAX3PU43_cjs.useSubscription; }
106
+ get: function () { return chunkDEN7AUNE_cjs.useSubscription; }
107
107
  });
108
108
  Object.defineProperty(exports, "withSubscription", {
109
109
  enumerable: true,
110
- get: function () { return chunkFAX3PU43_cjs.withSubscription; }
110
+ get: function () { return chunkDEN7AUNE_cjs.withSubscription; }
111
111
  });
112
112
  exports.withFFIDAuth = withFFIDAuth;
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 FFIDUser, l as FFIDOrganization, m as FFIDSubscriptionContextValue, n as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, o as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, p as FFIDAnnouncementsLogger } from './index-CpTGcffN.cjs';
2
- export { q as Announcement, r as AnnouncementStatus, s as AnnouncementType, t as FFIDAnnouncementBadge, u as FFIDAnnouncementList, v as FFIDAnnouncementsError, w as FFIDAnnouncementsErrorCode, x as FFIDAnnouncementsServerResponse, y as FFIDContextValue, z as FFIDJwtClaims, B as FFIDLoginButton, C as FFIDOAuthTokenResponse, D as FFIDOAuthUserInfoMemberRole, E as FFIDOAuthUserInfoSubscription, G as FFIDOrganizationSwitcher, H as FFIDSeatModel, I as FFIDSubscription, J as FFIDSubscriptionBadge, K as FFIDSubscriptionStatus, M as FFIDTokenIntrospectionResponse, N as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, O as UseFFIDAnnouncementsReturn, P as useFFIDAnnouncements } from './index-CpTGcffN.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 FFIDOAuthUserInfo, j as FFIDLogger, k as FFIDUser, l as FFIDOrganization, m as FFIDSubscription, n as FFIDSubscriptionContextValue, o as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, p as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, q as FFIDAnnouncementsLogger } from './index-ea8WAh39.cjs';
2
+ export { r as Announcement, s as AnnouncementStatus, t as AnnouncementType, u as FFIDAnnouncementBadge, v as FFIDAnnouncementList, w as FFIDAnnouncementsError, x as FFIDAnnouncementsErrorCode, y as FFIDAnnouncementsServerResponse, z as FFIDContextValue, B as FFIDJwtClaims, C as FFIDLoginButton, D as FFIDOAuthTokenResponse, E as FFIDOAuthUserInfoMemberRole, G as FFIDOAuthUserInfoSubscription, H as FFIDOrganizationSwitcher, I as FFIDSeatModel, J as FFIDSubscriptionBadge, K as FFIDSubscriptionStatus, M as FFIDTokenIntrospectionResponse, N as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, O as UseFFIDAnnouncementsReturn, P as useFFIDAnnouncements } from './index-ea8WAh39.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -144,6 +144,8 @@ interface UseFFIDReturn {
144
144
  organizations: FFIDOrganization[];
145
145
  /** Currently selected organization */
146
146
  currentOrganization: FFIDOrganization | null;
147
+ /** All subscriptions for the authenticated user (use useSubscription() for current-service filtering) */
148
+ subscriptions: FFIDSubscription[];
147
149
  /** Whether session is being loaded */
148
150
  isLoading: boolean;
149
151
  /** Whether user is authenticated */
@@ -341,4 +343,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
341
343
  /** Type of the FFID Announcements client */
342
344
  type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
343
345
 
344
- export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
346
+ export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, 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 FFIDUser, l as FFIDOrganization, m as FFIDSubscriptionContextValue, n as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, o as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, p as FFIDAnnouncementsLogger } from './index-CpTGcffN.js';
2
- export { q as Announcement, r as AnnouncementStatus, s as AnnouncementType, t as FFIDAnnouncementBadge, u as FFIDAnnouncementList, v as FFIDAnnouncementsError, w as FFIDAnnouncementsErrorCode, x as FFIDAnnouncementsServerResponse, y as FFIDContextValue, z as FFIDJwtClaims, B as FFIDLoginButton, C as FFIDOAuthTokenResponse, D as FFIDOAuthUserInfoMemberRole, E as FFIDOAuthUserInfoSubscription, G as FFIDOrganizationSwitcher, H as FFIDSeatModel, I as FFIDSubscription, J as FFIDSubscriptionBadge, K as FFIDSubscriptionStatus, M as FFIDTokenIntrospectionResponse, N as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, O as UseFFIDAnnouncementsReturn, P as useFFIDAnnouncements } from './index-CpTGcffN.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 FFIDOAuthUserInfo, j as FFIDLogger, k as FFIDUser, l as FFIDOrganization, m as FFIDSubscription, n as FFIDSubscriptionContextValue, o as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, p as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, q as FFIDAnnouncementsLogger } from './index-ea8WAh39.js';
2
+ export { r as Announcement, s as AnnouncementStatus, t as AnnouncementType, u as FFIDAnnouncementBadge, v as FFIDAnnouncementList, w as FFIDAnnouncementsError, x as FFIDAnnouncementsErrorCode, y as FFIDAnnouncementsServerResponse, z as FFIDContextValue, B as FFIDJwtClaims, C as FFIDLoginButton, D as FFIDOAuthTokenResponse, E as FFIDOAuthUserInfoMemberRole, G as FFIDOAuthUserInfoSubscription, H as FFIDOrganizationSwitcher, I as FFIDSeatModel, J as FFIDSubscriptionBadge, K as FFIDSubscriptionStatus, M as FFIDTokenIntrospectionResponse, N as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, O as UseFFIDAnnouncementsReturn, P as useFFIDAnnouncements } from './index-ea8WAh39.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -144,6 +144,8 @@ interface UseFFIDReturn {
144
144
  organizations: FFIDOrganization[];
145
145
  /** Currently selected organization */
146
146
  currentOrganization: FFIDOrganization | null;
147
+ /** All subscriptions for the authenticated user (use useSubscription() for current-service filtering) */
148
+ subscriptions: FFIDSubscription[];
147
149
  /** Whether session is being loaded */
148
150
  isLoading: boolean;
149
151
  /** Whether user is authenticated */
@@ -341,4 +343,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
341
343
  /** Type of the FFID Announcements client */
342
344
  type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
343
345
 
344
- export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
346
+ export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext } from './chunk-AZQOPZI6.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-AZQOPZI6.js';
1
+ import { useFFIDContext } from './chunk-7WZBWL56.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-7WZBWL56.js';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",