@feelflow/ffid-sdk 2.20.0 → 2.21.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
@@ -351,6 +351,43 @@ await client.updateProfile({
351
351
 
352
352
  対応フィールド: `displayName` / `phone` / `companyName` / `department` / `jobTitle` / `preferences`。`timezone` / `locale` は application-level invariant(サーバー側 normalization が string 前提)のため null 非許容。クリアは不可 — キー未指定で現状維持、もしくは新しい有効な値を渡す。
353
353
 
354
+ ### getAnalyticsConfig() (#2347)
355
+
356
+ 外部サービスが自身に割り当てられた GA4 Measurement ID を取得するメソッド。
357
+
358
+ - エンドポイント: `GET /api/v1/ext/analytics/config?service=<code>`
359
+ - 必要 scope: `analytics:read`(Bearer / API Key 両方で enforce)
360
+ - レスポンス: `FFIDAnalyticsConfig` (`{ code, measurementId, displayName, isActive }`)
361
+ - **archived service** (`isActive: false`) でも 200 を返す — caller が次回 deploy で tracking 停止判断する間、in-flight events が 5xx を起こさないように measurementId は引き続き返す
362
+
363
+ ```ts
364
+ import { createFFIDClient } from '@feelflow/ffid-sdk/server'
365
+
366
+ const client = createFFIDClient({
367
+ serviceCode: 'flow-board-ai',
368
+ authMode: 'service-key',
369
+ serviceApiKey: process.env.FFID_SERVICE_API_KEY!,
370
+ })
371
+
372
+ const result = await client.getAnalyticsConfig('feel-agent-ai')
373
+ if (result.error) {
374
+ if (result.error.code === 'SERVICE_NOT_FOUND') {
375
+ // 該当 GA4 stream がまだ sync されていない / typo
376
+ } else {
377
+ console.error(`[FFID] analytics config fetch failed: ${result.error.code}`)
378
+ }
379
+ } else if (result.data.isActive) {
380
+ // GA4 タグを描画して events を送信
381
+ loadGA4Script(result.data.measurementId)
382
+ }
383
+ ```
384
+
385
+ エラーコード:
386
+ - `VALIDATION_ERROR` — `serviceCode` が空 / kebab-case 形式違反(SDK 側 pre-validate)
387
+ - `INSUFFICIENT_SCOPE` (403) — `analytics:read` scope なし
388
+ - `SERVICE_NOT_FOUND` (404) — DB に未登録の service code
389
+ - `INVALID_PARAM` (400) — server 側で形式違反を検出(pre-validate 通過後の boundary)
390
+
354
391
  ## 型定義
355
392
 
356
393
  ```typescript
@@ -807,7 +807,7 @@ function createProfileMethods(deps) {
807
807
  }
808
808
 
809
809
  // src/client/version-check.ts
810
- var SDK_VERSION = "2.20.0";
810
+ var SDK_VERSION = "2.21.0";
811
811
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
812
812
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
813
813
  function sdkHeaders() {
@@ -1840,6 +1840,63 @@ function createOtpMethods(deps) {
1840
1840
  };
1841
1841
  }
1842
1842
 
1843
+ // src/client/analytics-methods.ts
1844
+ var EXT_ANALYTICS_CONFIG_ENDPOINT = "/api/v1/ext/analytics/config";
1845
+ function resolveAuthOverride2(options, createError) {
1846
+ if (!options || options.accessToken === void 0) {
1847
+ return {};
1848
+ }
1849
+ const token = options.accessToken;
1850
+ if (typeof token !== "string" || token.trim() === "") {
1851
+ return {
1852
+ error: createError(
1853
+ "VALIDATION_ERROR",
1854
+ "accessToken \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u5217\u3084\u7A7A\u767D\u306E\u307F\u306E\u5024\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"
1855
+ )
1856
+ };
1857
+ }
1858
+ return { override: { accessToken: token } };
1859
+ }
1860
+ var ANALYTICS_SERVICE_CODE_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
1861
+ function validateServiceCode(serviceCode, createError) {
1862
+ if (typeof serviceCode !== "string" || serviceCode.trim() === "") {
1863
+ return createError(
1864
+ "VALIDATION_ERROR",
1865
+ "serviceCode \u306F\u5FC5\u9808\u306E kebab-case \u6587\u5B57\u5217\u3067\u3059"
1866
+ );
1867
+ }
1868
+ if (!ANALYTICS_SERVICE_CODE_PATTERN.test(serviceCode)) {
1869
+ return createError(
1870
+ "VALIDATION_ERROR",
1871
+ "serviceCode \u306F kebab-case \u5F62\u5F0F (\u82F1\u5C0F\u6587\u5B57\u30FB\u6570\u5B57\u30FB\u30CF\u30A4\u30D5\u30F3) \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
1872
+ );
1873
+ }
1874
+ return null;
1875
+ }
1876
+ function createAnalyticsMethods(deps) {
1877
+ const { fetchWithAuth, createError } = deps;
1878
+ async function getAnalyticsConfig(serviceCode, options) {
1879
+ const validationError = validateServiceCode(serviceCode, createError);
1880
+ if (validationError) {
1881
+ return { error: validationError };
1882
+ }
1883
+ const { override, error: overrideError } = resolveAuthOverride2(
1884
+ options,
1885
+ createError
1886
+ );
1887
+ if (overrideError) {
1888
+ return { error: overrideError };
1889
+ }
1890
+ const endpoint = `${EXT_ANALYTICS_CONFIG_ENDPOINT}?service=${encodeURIComponent(serviceCode)}`;
1891
+ return fetchWithAuth(
1892
+ endpoint,
1893
+ { method: "GET" },
1894
+ override
1895
+ );
1896
+ }
1897
+ return { getAnalyticsConfig };
1898
+ }
1899
+
1843
1900
  // src/client/contract-wizard-methods.ts
1844
1901
  var CONTRACT_WIZARD_PATH = "/contract-wizard";
1845
1902
  function buildWizardUrl(baseUrl, flow, params) {
@@ -2362,6 +2419,10 @@ function createFFIDClient(config) {
2362
2419
  fetchWithAuth,
2363
2420
  createError
2364
2421
  });
2422
+ const { getAnalyticsConfig } = createAnalyticsMethods({
2423
+ fetchWithAuth,
2424
+ createError
2425
+ });
2365
2426
  const {
2366
2427
  requestPasswordReset,
2367
2428
  verifyPasswordResetToken,
@@ -2435,6 +2496,7 @@ function createFFIDClient(config) {
2435
2496
  removeMember,
2436
2497
  getProfile,
2437
2498
  updateProfile,
2499
+ getAnalyticsConfig,
2438
2500
  createCheckoutSession,
2439
2501
  createPortalSession,
2440
2502
  listPlans,
@@ -805,7 +805,7 @@ function createProfileMethods(deps) {
805
805
  }
806
806
 
807
807
  // src/client/version-check.ts
808
- var SDK_VERSION = "2.20.0";
808
+ var SDK_VERSION = "2.21.0";
809
809
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
810
810
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
811
811
  function sdkHeaders() {
@@ -1838,6 +1838,63 @@ function createOtpMethods(deps) {
1838
1838
  };
1839
1839
  }
1840
1840
 
1841
+ // src/client/analytics-methods.ts
1842
+ var EXT_ANALYTICS_CONFIG_ENDPOINT = "/api/v1/ext/analytics/config";
1843
+ function resolveAuthOverride2(options, createError) {
1844
+ if (!options || options.accessToken === void 0) {
1845
+ return {};
1846
+ }
1847
+ const token = options.accessToken;
1848
+ if (typeof token !== "string" || token.trim() === "") {
1849
+ return {
1850
+ error: createError(
1851
+ "VALIDATION_ERROR",
1852
+ "accessToken \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u5217\u3084\u7A7A\u767D\u306E\u307F\u306E\u5024\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"
1853
+ )
1854
+ };
1855
+ }
1856
+ return { override: { accessToken: token } };
1857
+ }
1858
+ var ANALYTICS_SERVICE_CODE_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
1859
+ function validateServiceCode(serviceCode, createError) {
1860
+ if (typeof serviceCode !== "string" || serviceCode.trim() === "") {
1861
+ return createError(
1862
+ "VALIDATION_ERROR",
1863
+ "serviceCode \u306F\u5FC5\u9808\u306E kebab-case \u6587\u5B57\u5217\u3067\u3059"
1864
+ );
1865
+ }
1866
+ if (!ANALYTICS_SERVICE_CODE_PATTERN.test(serviceCode)) {
1867
+ return createError(
1868
+ "VALIDATION_ERROR",
1869
+ "serviceCode \u306F kebab-case \u5F62\u5F0F (\u82F1\u5C0F\u6587\u5B57\u30FB\u6570\u5B57\u30FB\u30CF\u30A4\u30D5\u30F3) \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
1870
+ );
1871
+ }
1872
+ return null;
1873
+ }
1874
+ function createAnalyticsMethods(deps) {
1875
+ const { fetchWithAuth, createError } = deps;
1876
+ async function getAnalyticsConfig(serviceCode, options) {
1877
+ const validationError = validateServiceCode(serviceCode, createError);
1878
+ if (validationError) {
1879
+ return { error: validationError };
1880
+ }
1881
+ const { override, error: overrideError } = resolveAuthOverride2(
1882
+ options,
1883
+ createError
1884
+ );
1885
+ if (overrideError) {
1886
+ return { error: overrideError };
1887
+ }
1888
+ const endpoint = `${EXT_ANALYTICS_CONFIG_ENDPOINT}?service=${encodeURIComponent(serviceCode)}`;
1889
+ return fetchWithAuth(
1890
+ endpoint,
1891
+ { method: "GET" },
1892
+ override
1893
+ );
1894
+ }
1895
+ return { getAnalyticsConfig };
1896
+ }
1897
+
1841
1898
  // src/client/contract-wizard-methods.ts
1842
1899
  var CONTRACT_WIZARD_PATH = "/contract-wizard";
1843
1900
  function buildWizardUrl(baseUrl, flow, params) {
@@ -2360,6 +2417,10 @@ function createFFIDClient(config) {
2360
2417
  fetchWithAuth,
2361
2418
  createError
2362
2419
  });
2420
+ const { getAnalyticsConfig } = createAnalyticsMethods({
2421
+ fetchWithAuth,
2422
+ createError
2423
+ });
2363
2424
  const {
2364
2425
  requestPasswordReset,
2365
2426
  verifyPasswordResetToken,
@@ -2433,6 +2494,7 @@ function createFFIDClient(config) {
2433
2494
  removeMember,
2434
2495
  getProfile,
2435
2496
  updateProfile,
2497
+ getAnalyticsConfig,
2436
2498
  createCheckoutSession,
2437
2499
  createPortalSession,
2438
2500
  listPlans,
@@ -1,34 +1,34 @@
1
1
  'use strict';
2
2
 
3
- var chunkKNEZ5OUQ_cjs = require('../chunk-KNEZ5OUQ.cjs');
3
+ var chunkHUU4Q5VH_cjs = require('../chunk-HUU4Q5VH.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDInquiryForm", {
16
16
  enumerable: true,
17
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDInquiryForm; }
17
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDInquiryForm; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDLoginButton", {
20
20
  enumerable: true,
21
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDLoginButton; }
21
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDLoginButton; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
24
24
  enumerable: true,
25
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDOrganizationSwitcher; }
25
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDOrganizationSwitcher; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
28
28
  enumerable: true,
29
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDSubscriptionBadge; }
29
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDSubscriptionBadge; }
30
30
  });
31
31
  Object.defineProperty(exports, "FFIDUserMenu", {
32
32
  enumerable: true,
33
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDUserMenu; }
33
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDUserMenu; }
34
34
  });
@@ -1,3 +1,3 @@
1
- export { M as FFIDAnnouncementBadge, al as FFIDAnnouncementBadgeClassNames, am as FFIDAnnouncementBadgeProps, N as FFIDAnnouncementList, an as FFIDAnnouncementListClassNames, ao as FFIDAnnouncementListProps, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormOrganization, Z as FFIDInquiryFormPlaceholderContext, _ as FFIDInquiryFormPrefill, $ as FFIDInquiryFormProps, a0 as FFIDInquiryFormSubmitData, a1 as FFIDInquiryFormSubmitResult, a3 as FFIDLoginButton, ap as FFIDLoginButtonProps, a9 as FFIDOrganizationSwitcher, aq as FFIDOrganizationSwitcherClassNames, ar as FFIDOrganizationSwitcherProps, ac as FFIDSubscriptionBadge, as as FFIDSubscriptionBadgeClassNames, at as FFIDSubscriptionBadgeProps, ae as FFIDUserMenu, au as FFIDUserMenuClassNames, av as FFIDUserMenuProps } from '../index-0D2vYSLq.cjs';
1
+ export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-Dr5G9HQ4.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { M as FFIDAnnouncementBadge, al as FFIDAnnouncementBadgeClassNames, am as FFIDAnnouncementBadgeProps, N as FFIDAnnouncementList, an as FFIDAnnouncementListClassNames, ao as FFIDAnnouncementListProps, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormOrganization, Z as FFIDInquiryFormPlaceholderContext, _ as FFIDInquiryFormPrefill, $ as FFIDInquiryFormProps, a0 as FFIDInquiryFormSubmitData, a1 as FFIDInquiryFormSubmitResult, a3 as FFIDLoginButton, ap as FFIDLoginButtonProps, a9 as FFIDOrganizationSwitcher, aq as FFIDOrganizationSwitcherClassNames, ar as FFIDOrganizationSwitcherProps, ac as FFIDSubscriptionBadge, as as FFIDSubscriptionBadgeClassNames, at as FFIDSubscriptionBadgeProps, ae as FFIDUserMenu, au as FFIDUserMenuClassNames, av as FFIDUserMenuProps } from '../index-0D2vYSLq.js';
1
+ export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-Dr5G9HQ4.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-GCUVFSB2.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-I7NEMG52.js';
@@ -847,6 +847,29 @@ interface FFIDProfileCallOptions {
847
847
  */
848
848
  accessToken?: string;
849
849
  }
850
+ /**
851
+ * Response shape from `GET /api/v1/ext/analytics/config?service=<code>`.
852
+ *
853
+ * Returned by `FFIDClient.getAnalyticsConfig()`. Narrower than the admin-side
854
+ * `AnalyticsService` shape to avoid leaking internal columns
855
+ * (`ga4StreamId`, `lastSyncedAt`, `description`).
856
+ *
857
+ * @see Issue #2347
858
+ */
859
+ interface FFIDAnalyticsConfig {
860
+ /** Service slug (kebab-case) — echoed back so callers can sanity-check */
861
+ code: string;
862
+ /** GA4 Measurement ID (`G-XXXXXXX`) */
863
+ measurementId: string;
864
+ /** GA4 displayName at the time of the last sync */
865
+ displayName: string;
866
+ /**
867
+ * `false` when the GA4 data stream has been archived. The measurement id is
868
+ * still returned so in-flight events do not 5xx during a cutover window —
869
+ * the caller should disable tracking on the next deploy.
870
+ */
871
+ isActive: boolean;
872
+ }
850
873
  /**
851
874
  * Request payload for `updateProfile`.
852
875
  *
@@ -1064,6 +1087,7 @@ declare function createFFIDClient(config: FFIDConfig): {
1064
1087
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
1065
1088
  getProfile: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
1066
1089
  updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
1090
+ getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
1067
1091
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
1068
1092
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
1069
1093
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
@@ -847,6 +847,29 @@ interface FFIDProfileCallOptions {
847
847
  */
848
848
  accessToken?: string;
849
849
  }
850
+ /**
851
+ * Response shape from `GET /api/v1/ext/analytics/config?service=<code>`.
852
+ *
853
+ * Returned by `FFIDClient.getAnalyticsConfig()`. Narrower than the admin-side
854
+ * `AnalyticsService` shape to avoid leaking internal columns
855
+ * (`ga4StreamId`, `lastSyncedAt`, `description`).
856
+ *
857
+ * @see Issue #2347
858
+ */
859
+ interface FFIDAnalyticsConfig {
860
+ /** Service slug (kebab-case) — echoed back so callers can sanity-check */
861
+ code: string;
862
+ /** GA4 Measurement ID (`G-XXXXXXX`) */
863
+ measurementId: string;
864
+ /** GA4 displayName at the time of the last sync */
865
+ displayName: string;
866
+ /**
867
+ * `false` when the GA4 data stream has been archived. The measurement id is
868
+ * still returned so in-flight events do not 5xx during a cutover window —
869
+ * the caller should disable tracking on the next deploy.
870
+ */
871
+ isActive: boolean;
872
+ }
850
873
  /**
851
874
  * Request payload for `updateProfile`.
852
875
  *
@@ -1064,6 +1087,7 @@ declare function createFFIDClient(config: FFIDConfig): {
1064
1087
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
1065
1088
  getProfile: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
1066
1089
  updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
1090
+ getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
1067
1091
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
1068
1092
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
1069
1093
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
@@ -580,6 +580,29 @@ interface FFIDProfileCallOptions {
580
580
  */
581
581
  accessToken?: string;
582
582
  }
583
+ /**
584
+ * Response shape from `GET /api/v1/ext/analytics/config?service=<code>`.
585
+ *
586
+ * Returned by `FFIDClient.getAnalyticsConfig()`. Narrower than the admin-side
587
+ * `AnalyticsService` shape to avoid leaking internal columns
588
+ * (`ga4StreamId`, `lastSyncedAt`, `description`).
589
+ *
590
+ * @see Issue #2347
591
+ */
592
+ interface FFIDAnalyticsConfig {
593
+ /** Service slug (kebab-case) — echoed back so callers can sanity-check */
594
+ code: string;
595
+ /** GA4 Measurement ID (`G-XXXXXXX`) */
596
+ measurementId: string;
597
+ /** GA4 displayName at the time of the last sync */
598
+ displayName: string;
599
+ /**
600
+ * `false` when the GA4 data stream has been archived. The measurement id is
601
+ * still returned so in-flight events do not 5xx during a cutover window —
602
+ * the caller should disable tracking on the next deploy.
603
+ */
604
+ isActive: boolean;
605
+ }
583
606
  /**
584
607
  * Request payload for `updateProfile`.
585
608
  *
@@ -1386,4 +1409,4 @@ interface FFIDInquiryFormPlaceholderContext {
1386
1409
  }
1387
1410
  declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, separateLegalCheckboxes, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
1388
1411
 
1389
- export { type FFIDInquiryFormProps as $, type FFIDSubscription as A, type FFIDSubscriptionContextValue as B, type FFIDAnnouncementsClientConfig as C, type FFIDAnnouncementsApiResponse as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type AnnouncementListResponse as G, type FFIDAnnouncementsLogger as H, type Announcement as I, type AnnouncementStatus as J, type AnnouncementType as K, type ListAnnouncementsOptions as L, FFIDAnnouncementBadge as M, FFIDAnnouncementList as N, type FFIDAnnouncementsError as O, type FFIDAnnouncementsErrorCode as P, type FFIDAnnouncementsServerResponse as Q, type FFIDCacheConfig as R, type FFIDContextValue as S, type FFIDInquiryCategory as T, type FFIDInquiryCategorySite2026 as U, FFIDInquiryForm as V, type FFIDInquiryFormCategoryItem as W, type FFIDInquiryFormClassNames as X, type FFIDInquiryFormOrganization as Y, type FFIDInquiryFormPlaceholderContext as Z, type FFIDInquiryFormPrefill as _, type FFIDConfig as a, type FFIDInquiryFormSubmitData as a0, type FFIDInquiryFormSubmitResult as a1, type FFIDJwtClaims as a2, FFIDLoginButton as a3, type FFIDMemberStatus as a4, type FFIDOAuthTokenResponse as a5, type FFIDOAuthUserInfoMemberRole as a6, type FFIDOAuthUserInfoSubscription as a7, type FFIDOrganizationMember as a8, FFIDOrganizationSwitcher as a9, type FFIDRedirectErrorCode as aa, type FFIDSeatModel as ab, FFIDSubscriptionBadge as ac, type FFIDTokenIntrospectionResponse as ad, FFIDUserMenu as ae, FFID_INQUIRY_CATEGORIES as af, FFID_INQUIRY_CATEGORIES_SITE_2026 as ag, type UseFFIDAnnouncementsOptions as ah, type UseFFIDAnnouncementsReturn as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDProfileCallOptions as k, type FFIDUserProfile as l, type FFIDUpdateUserProfileRequest as m, type FFIDCreateCheckoutParams as n, type FFIDCheckoutSessionResponse as o, type FFIDCreatePortalParams as p, type FFIDPortalSessionResponse as q, type FFIDVerifyAccessTokenOptions as r, type FFIDOAuthUserInfo as s, type FFIDInquiryCreateParams as t, type FFIDInquiryCreateResponse as u, type FFIDAuthMode as v, type FFIDLogger as w, type FFIDCacheAdapter as x, type FFIDUser as y, type FFIDOrganization as z };
1412
+ export { type FFIDInquiryFormPrefill as $, type FFIDOrganization as A, type FFIDSubscription as B, type FFIDSubscriptionContextValue as C, type FFIDAnnouncementsClientConfig as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type FFIDAnnouncementsApiResponse as G, type AnnouncementListResponse as H, type FFIDAnnouncementsLogger as I, type Announcement as J, type AnnouncementStatus as K, type ListAnnouncementsOptions as L, type AnnouncementType as M, FFIDAnnouncementBadge as N, FFIDAnnouncementList as O, type FFIDAnnouncementsError as P, type FFIDAnnouncementsErrorCode as Q, type FFIDAnnouncementsServerResponse as R, type FFIDCacheConfig as S, type FFIDContextValue as T, type FFIDInquiryCategory as U, type FFIDInquiryCategorySite2026 as V, FFIDInquiryForm as W, type FFIDInquiryFormCategoryItem as X, type FFIDInquiryFormClassNames as Y, type FFIDInquiryFormOrganization as Z, type FFIDInquiryFormPlaceholderContext as _, type FFIDConfig as a, type FFIDInquiryFormProps as a0, type FFIDInquiryFormSubmitData as a1, type FFIDInquiryFormSubmitResult as a2, type FFIDJwtClaims as a3, FFIDLoginButton as a4, type FFIDMemberStatus as a5, type FFIDOAuthTokenResponse as a6, type FFIDOAuthUserInfoMemberRole as a7, type FFIDOAuthUserInfoSubscription as a8, type FFIDOrganizationMember as a9, FFIDOrganizationSwitcher as aa, type FFIDRedirectErrorCode as ab, type FFIDSeatModel as ac, FFIDSubscriptionBadge as ad, type FFIDTokenIntrospectionResponse as ae, FFIDUserMenu as af, FFID_INQUIRY_CATEGORIES as ag, FFID_INQUIRY_CATEGORIES_SITE_2026 as ah, type UseFFIDAnnouncementsOptions as ai, type UseFFIDAnnouncementsReturn as aj, isFFIDInquiryCategorySite2026 as ak, useFFIDAnnouncements as al, type FFIDAnnouncementBadgeClassNames as am, type FFIDAnnouncementBadgeProps as an, type FFIDAnnouncementListClassNames as ao, type FFIDAnnouncementListProps as ap, type FFIDLoginButtonProps as aq, type FFIDOrganizationSwitcherClassNames as ar, type FFIDOrganizationSwitcherProps as as, type FFIDSubscriptionBadgeClassNames as at, type FFIDSubscriptionBadgeProps as au, type FFIDUserMenuClassNames as av, type FFIDUserMenuProps as aw, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDProfileCallOptions as k, type FFIDUserProfile as l, type FFIDUpdateUserProfileRequest as m, type FFIDAnalyticsConfig as n, type FFIDCreateCheckoutParams as o, type FFIDCheckoutSessionResponse as p, type FFIDCreatePortalParams as q, type FFIDPortalSessionResponse as r, type FFIDVerifyAccessTokenOptions as s, type FFIDOAuthUserInfo as t, type FFIDInquiryCreateParams as u, type FFIDInquiryCreateResponse as v, type FFIDAuthMode as w, type FFIDLogger as x, type FFIDCacheAdapter as y, type FFIDUser as z };
@@ -580,6 +580,29 @@ interface FFIDProfileCallOptions {
580
580
  */
581
581
  accessToken?: string;
582
582
  }
583
+ /**
584
+ * Response shape from `GET /api/v1/ext/analytics/config?service=<code>`.
585
+ *
586
+ * Returned by `FFIDClient.getAnalyticsConfig()`. Narrower than the admin-side
587
+ * `AnalyticsService` shape to avoid leaking internal columns
588
+ * (`ga4StreamId`, `lastSyncedAt`, `description`).
589
+ *
590
+ * @see Issue #2347
591
+ */
592
+ interface FFIDAnalyticsConfig {
593
+ /** Service slug (kebab-case) — echoed back so callers can sanity-check */
594
+ code: string;
595
+ /** GA4 Measurement ID (`G-XXXXXXX`) */
596
+ measurementId: string;
597
+ /** GA4 displayName at the time of the last sync */
598
+ displayName: string;
599
+ /**
600
+ * `false` when the GA4 data stream has been archived. The measurement id is
601
+ * still returned so in-flight events do not 5xx during a cutover window —
602
+ * the caller should disable tracking on the next deploy.
603
+ */
604
+ isActive: boolean;
605
+ }
583
606
  /**
584
607
  * Request payload for `updateProfile`.
585
608
  *
@@ -1386,4 +1409,4 @@ interface FFIDInquiryFormPlaceholderContext {
1386
1409
  }
1387
1410
  declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, separateLegalCheckboxes, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
1388
1411
 
1389
- export { type FFIDInquiryFormProps as $, type FFIDSubscription as A, type FFIDSubscriptionContextValue as B, type FFIDAnnouncementsClientConfig as C, type FFIDAnnouncementsApiResponse as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type AnnouncementListResponse as G, type FFIDAnnouncementsLogger as H, type Announcement as I, type AnnouncementStatus as J, type AnnouncementType as K, type ListAnnouncementsOptions as L, FFIDAnnouncementBadge as M, FFIDAnnouncementList as N, type FFIDAnnouncementsError as O, type FFIDAnnouncementsErrorCode as P, type FFIDAnnouncementsServerResponse as Q, type FFIDCacheConfig as R, type FFIDContextValue as S, type FFIDInquiryCategory as T, type FFIDInquiryCategorySite2026 as U, FFIDInquiryForm as V, type FFIDInquiryFormCategoryItem as W, type FFIDInquiryFormClassNames as X, type FFIDInquiryFormOrganization as Y, type FFIDInquiryFormPlaceholderContext as Z, type FFIDInquiryFormPrefill as _, type FFIDConfig as a, type FFIDInquiryFormSubmitData as a0, type FFIDInquiryFormSubmitResult as a1, type FFIDJwtClaims as a2, FFIDLoginButton as a3, type FFIDMemberStatus as a4, type FFIDOAuthTokenResponse as a5, type FFIDOAuthUserInfoMemberRole as a6, type FFIDOAuthUserInfoSubscription as a7, type FFIDOrganizationMember as a8, FFIDOrganizationSwitcher as a9, type FFIDRedirectErrorCode as aa, type FFIDSeatModel as ab, FFIDSubscriptionBadge as ac, type FFIDTokenIntrospectionResponse as ad, FFIDUserMenu as ae, FFID_INQUIRY_CATEGORIES as af, FFID_INQUIRY_CATEGORIES_SITE_2026 as ag, type UseFFIDAnnouncementsOptions as ah, type UseFFIDAnnouncementsReturn as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDProfileCallOptions as k, type FFIDUserProfile as l, type FFIDUpdateUserProfileRequest as m, type FFIDCreateCheckoutParams as n, type FFIDCheckoutSessionResponse as o, type FFIDCreatePortalParams as p, type FFIDPortalSessionResponse as q, type FFIDVerifyAccessTokenOptions as r, type FFIDOAuthUserInfo as s, type FFIDInquiryCreateParams as t, type FFIDInquiryCreateResponse as u, type FFIDAuthMode as v, type FFIDLogger as w, type FFIDCacheAdapter as x, type FFIDUser as y, type FFIDOrganization as z };
1412
+ export { type FFIDInquiryFormPrefill as $, type FFIDOrganization as A, type FFIDSubscription as B, type FFIDSubscriptionContextValue as C, type FFIDAnnouncementsClientConfig as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type FFIDAnnouncementsApiResponse as G, type AnnouncementListResponse as H, type FFIDAnnouncementsLogger as I, type Announcement as J, type AnnouncementStatus as K, type ListAnnouncementsOptions as L, type AnnouncementType as M, FFIDAnnouncementBadge as N, FFIDAnnouncementList as O, type FFIDAnnouncementsError as P, type FFIDAnnouncementsErrorCode as Q, type FFIDAnnouncementsServerResponse as R, type FFIDCacheConfig as S, type FFIDContextValue as T, type FFIDInquiryCategory as U, type FFIDInquiryCategorySite2026 as V, FFIDInquiryForm as W, type FFIDInquiryFormCategoryItem as X, type FFIDInquiryFormClassNames as Y, type FFIDInquiryFormOrganization as Z, type FFIDInquiryFormPlaceholderContext as _, type FFIDConfig as a, type FFIDInquiryFormProps as a0, type FFIDInquiryFormSubmitData as a1, type FFIDInquiryFormSubmitResult as a2, type FFIDJwtClaims as a3, FFIDLoginButton as a4, type FFIDMemberStatus as a5, type FFIDOAuthTokenResponse as a6, type FFIDOAuthUserInfoMemberRole as a7, type FFIDOAuthUserInfoSubscription as a8, type FFIDOrganizationMember as a9, FFIDOrganizationSwitcher as aa, type FFIDRedirectErrorCode as ab, type FFIDSeatModel as ac, FFIDSubscriptionBadge as ad, type FFIDTokenIntrospectionResponse as ae, FFIDUserMenu as af, FFID_INQUIRY_CATEGORIES as ag, FFID_INQUIRY_CATEGORIES_SITE_2026 as ah, type UseFFIDAnnouncementsOptions as ai, type UseFFIDAnnouncementsReturn as aj, isFFIDInquiryCategorySite2026 as ak, useFFIDAnnouncements as al, type FFIDAnnouncementBadgeClassNames as am, type FFIDAnnouncementBadgeProps as an, type FFIDAnnouncementListClassNames as ao, type FFIDAnnouncementListProps as ap, type FFIDLoginButtonProps as aq, type FFIDOrganizationSwitcherClassNames as ar, type FFIDOrganizationSwitcherProps as as, type FFIDSubscriptionBadgeClassNames as at, type FFIDSubscriptionBadgeProps as au, type FFIDUserMenuClassNames as av, type FFIDUserMenuProps as aw, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDProfileCallOptions as k, type FFIDUserProfile as l, type FFIDUpdateUserProfileRequest as m, type FFIDAnalyticsConfig as n, type FFIDCreateCheckoutParams as o, type FFIDCheckoutSessionResponse as p, type FFIDCreatePortalParams as q, type FFIDPortalSessionResponse as r, type FFIDVerifyAccessTokenOptions as s, type FFIDOAuthUserInfo as t, type FFIDInquiryCreateParams as u, type FFIDInquiryCreateResponse as v, type FFIDAuthMode as w, type FFIDLogger as x, type FFIDCacheAdapter as y, type FFIDUser as z };
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkKNEZ5OUQ_cjs = require('./chunk-KNEZ5OUQ.cjs');
3
+ var chunkHUU4Q5VH_cjs = require('./chunk-HUU4Q5VH.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
@@ -53,8 +53,8 @@ function defaultRedirect(url) {
53
53
  }
54
54
  function useRequireActiveSubscription(options) {
55
55
  const { redirectTo, allowGrace = true, onRedirect } = options;
56
- const { isLoading, error } = chunkKNEZ5OUQ_cjs.useFFIDContext();
57
- const { effectiveStatus, isBlocked, isGrace } = chunkKNEZ5OUQ_cjs.useSubscription();
56
+ const { isLoading, error } = chunkHUU4Q5VH_cjs.useFFIDContext();
57
+ const { effectiveStatus, isBlocked, isGrace } = chunkHUU4Q5VH_cjs.useSubscription();
58
58
  const hasFetchError = error !== null && effectiveStatus === null;
59
59
  const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
60
60
  react.useEffect(() => {
@@ -75,7 +75,7 @@ function useRequireActiveSubscription(options) {
75
75
  }
76
76
  function withFFIDAuth(Component, options = {}) {
77
77
  const WrappedComponent = (props) => {
78
- const { isLoading, isAuthenticated, login } = chunkKNEZ5OUQ_cjs.useFFIDContext();
78
+ const { isLoading, isAuthenticated, login } = chunkHUU4Q5VH_cjs.useFFIDContext();
79
79
  const hasRedirected = react.useRef(false);
80
80
  react.useEffect(() => {
81
81
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -103,111 +103,111 @@ var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
103
103
 
104
104
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
105
105
  enumerable: true,
106
- get: function () { return chunkKNEZ5OUQ_cjs.DEFAULT_API_BASE_URL; }
106
+ get: function () { return chunkHUU4Q5VH_cjs.DEFAULT_API_BASE_URL; }
107
107
  });
108
108
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
109
109
  enumerable: true,
110
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDAnnouncementBadge; }
110
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDAnnouncementBadge; }
111
111
  });
112
112
  Object.defineProperty(exports, "FFIDAnnouncementList", {
113
113
  enumerable: true,
114
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDAnnouncementList; }
114
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDAnnouncementList; }
115
115
  });
116
116
  Object.defineProperty(exports, "FFIDInquiryForm", {
117
117
  enumerable: true,
118
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDInquiryForm; }
118
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDInquiryForm; }
119
119
  });
120
120
  Object.defineProperty(exports, "FFIDLoginButton", {
121
121
  enumerable: true,
122
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDLoginButton; }
122
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDLoginButton; }
123
123
  });
124
124
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
125
125
  enumerable: true,
126
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDOrganizationSwitcher; }
126
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDOrganizationSwitcher; }
127
127
  });
128
128
  Object.defineProperty(exports, "FFIDProvider", {
129
129
  enumerable: true,
130
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDProvider; }
130
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDProvider; }
131
131
  });
132
132
  Object.defineProperty(exports, "FFIDSDKError", {
133
133
  enumerable: true,
134
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDSDKError; }
134
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDSDKError; }
135
135
  });
136
136
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
137
137
  enumerable: true,
138
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDSubscriptionBadge; }
138
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDSubscriptionBadge; }
139
139
  });
140
140
  Object.defineProperty(exports, "FFIDUserMenu", {
141
141
  enumerable: true,
142
- get: function () { return chunkKNEZ5OUQ_cjs.FFIDUserMenu; }
142
+ get: function () { return chunkHUU4Q5VH_cjs.FFIDUserMenu; }
143
143
  });
144
144
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
145
145
  enumerable: true,
146
- get: function () { return chunkKNEZ5OUQ_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
146
+ get: function () { return chunkHUU4Q5VH_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
147
147
  });
148
148
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
149
149
  enumerable: true,
150
- get: function () { return chunkKNEZ5OUQ_cjs.FFID_INQUIRY_CATEGORIES; }
150
+ get: function () { return chunkHUU4Q5VH_cjs.FFID_INQUIRY_CATEGORIES; }
151
151
  });
152
152
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
153
153
  enumerable: true,
154
- get: function () { return chunkKNEZ5OUQ_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
154
+ get: function () { return chunkHUU4Q5VH_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
155
155
  });
156
156
  Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
157
157
  enumerable: true,
158
- get: function () { return chunkKNEZ5OUQ_cjs.computeEffectiveStatusFromSession; }
158
+ get: function () { return chunkHUU4Q5VH_cjs.computeEffectiveStatusFromSession; }
159
159
  });
160
160
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
161
161
  enumerable: true,
162
- get: function () { return chunkKNEZ5OUQ_cjs.createFFIDAnnouncementsClient; }
162
+ get: function () { return chunkHUU4Q5VH_cjs.createFFIDAnnouncementsClient; }
163
163
  });
164
164
  Object.defineProperty(exports, "createFFIDClient", {
165
165
  enumerable: true,
166
- get: function () { return chunkKNEZ5OUQ_cjs.createFFIDClient; }
166
+ get: function () { return chunkHUU4Q5VH_cjs.createFFIDClient; }
167
167
  });
168
168
  Object.defineProperty(exports, "createTokenStore", {
169
169
  enumerable: true,
170
- get: function () { return chunkKNEZ5OUQ_cjs.createTokenStore; }
170
+ get: function () { return chunkHUU4Q5VH_cjs.createTokenStore; }
171
171
  });
172
172
  Object.defineProperty(exports, "generateCodeChallenge", {
173
173
  enumerable: true,
174
- get: function () { return chunkKNEZ5OUQ_cjs.generateCodeChallenge; }
174
+ get: function () { return chunkHUU4Q5VH_cjs.generateCodeChallenge; }
175
175
  });
176
176
  Object.defineProperty(exports, "generateCodeVerifier", {
177
177
  enumerable: true,
178
- get: function () { return chunkKNEZ5OUQ_cjs.generateCodeVerifier; }
178
+ get: function () { return chunkHUU4Q5VH_cjs.generateCodeVerifier; }
179
179
  });
180
180
  Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
181
181
  enumerable: true,
182
- get: function () { return chunkKNEZ5OUQ_cjs.isFFIDInquiryCategorySite2026; }
182
+ get: function () { return chunkHUU4Q5VH_cjs.isFFIDInquiryCategorySite2026; }
183
183
  });
184
184
  Object.defineProperty(exports, "normalizeRedirectUri", {
185
185
  enumerable: true,
186
- get: function () { return chunkKNEZ5OUQ_cjs.normalizeRedirectUri; }
186
+ get: function () { return chunkHUU4Q5VH_cjs.normalizeRedirectUri; }
187
187
  });
188
188
  Object.defineProperty(exports, "retrieveCodeVerifier", {
189
189
  enumerable: true,
190
- get: function () { return chunkKNEZ5OUQ_cjs.retrieveCodeVerifier; }
190
+ get: function () { return chunkHUU4Q5VH_cjs.retrieveCodeVerifier; }
191
191
  });
192
192
  Object.defineProperty(exports, "storeCodeVerifier", {
193
193
  enumerable: true,
194
- get: function () { return chunkKNEZ5OUQ_cjs.storeCodeVerifier; }
194
+ get: function () { return chunkHUU4Q5VH_cjs.storeCodeVerifier; }
195
195
  });
196
196
  Object.defineProperty(exports, "useFFID", {
197
197
  enumerable: true,
198
- get: function () { return chunkKNEZ5OUQ_cjs.useFFID; }
198
+ get: function () { return chunkHUU4Q5VH_cjs.useFFID; }
199
199
  });
200
200
  Object.defineProperty(exports, "useFFIDAnnouncements", {
201
201
  enumerable: true,
202
- get: function () { return chunkKNEZ5OUQ_cjs.useFFIDAnnouncements; }
202
+ get: function () { return chunkHUU4Q5VH_cjs.useFFIDAnnouncements; }
203
203
  });
204
204
  Object.defineProperty(exports, "useSubscription", {
205
205
  enumerable: true,
206
- get: function () { return chunkKNEZ5OUQ_cjs.useSubscription; }
206
+ get: function () { return chunkHUU4Q5VH_cjs.useSubscription; }
207
207
  });
208
208
  Object.defineProperty(exports, "withSubscription", {
209
209
  enumerable: true,
210
- get: function () { return chunkKNEZ5OUQ_cjs.withSubscription; }
210
+ get: function () { return chunkHUU4Q5VH_cjs.withSubscription; }
211
211
  });
212
212
  exports.FFID_NEWSLETTER_TYPES = FFID_NEWSLETTER_TYPES;
213
213
  exports.createKVCacheAdapter = createKVCacheAdapter;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDCreateCheckoutParams, o as FFIDCheckoutSessionResponse, p as FFIDCreatePortalParams, q as FFIDPortalSessionResponse, r as FFIDVerifyAccessTokenOptions, s as FFIDOAuthUserInfo, t as FFIDInquiryCreateParams, u as FFIDInquiryCreateResponse, v as FFIDAuthMode, w as FFIDLogger, x as FFIDCacheAdapter, y as FFIDUser, z as FFIDOrganization, A as FFIDSubscription, B as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, G as AnnouncementListResponse, H as FFIDAnnouncementsLogger } from './index-0D2vYSLq.cjs';
2
- export { I as Announcement, J as AnnouncementStatus, K as AnnouncementType, M as FFIDAnnouncementBadge, N as FFIDAnnouncementList, O as FFIDAnnouncementsError, P as FFIDAnnouncementsErrorCode, Q as FFIDAnnouncementsServerResponse, R as FFIDCacheConfig, S as FFIDContextValue, T as FFIDInquiryCategory, U as FFIDInquiryCategorySite2026, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormOrganization, Z as FFIDInquiryFormPlaceholderContext, _ as FFIDInquiryFormPrefill, $ as FFIDInquiryFormProps, a0 as FFIDInquiryFormSubmitData, a1 as FFIDInquiryFormSubmitResult, a2 as FFIDJwtClaims, a3 as FFIDLoginButton, a4 as FFIDMemberStatus, a5 as FFIDOAuthTokenResponse, a6 as FFIDOAuthUserInfoMemberRole, a7 as FFIDOAuthUserInfoSubscription, a8 as FFIDOrganizationMember, a9 as FFIDOrganizationSwitcher, aa as FFIDRedirectErrorCode, ab as FFIDSeatModel, ac as FFIDSubscriptionBadge, ad as FFIDTokenIntrospectionResponse, ae as FFIDUserMenu, af as FFID_INQUIRY_CATEGORIES, ag as FFID_INQUIRY_CATEGORIES_SITE_2026, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-0D2vYSLq.cjs';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-Dr5G9HQ4.cjs';
2
+ export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-Dr5G9HQ4.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -505,6 +505,7 @@ declare function createFFIDClient(config: FFIDConfig): {
505
505
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
506
506
  getProfile: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
507
507
  updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
508
+ getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
508
509
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
509
510
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
510
511
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDCreateCheckoutParams, o as FFIDCheckoutSessionResponse, p as FFIDCreatePortalParams, q as FFIDPortalSessionResponse, r as FFIDVerifyAccessTokenOptions, s as FFIDOAuthUserInfo, t as FFIDInquiryCreateParams, u as FFIDInquiryCreateResponse, v as FFIDAuthMode, w as FFIDLogger, x as FFIDCacheAdapter, y as FFIDUser, z as FFIDOrganization, A as FFIDSubscription, B as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, G as AnnouncementListResponse, H as FFIDAnnouncementsLogger } from './index-0D2vYSLq.js';
2
- export { I as Announcement, J as AnnouncementStatus, K as AnnouncementType, M as FFIDAnnouncementBadge, N as FFIDAnnouncementList, O as FFIDAnnouncementsError, P as FFIDAnnouncementsErrorCode, Q as FFIDAnnouncementsServerResponse, R as FFIDCacheConfig, S as FFIDContextValue, T as FFIDInquiryCategory, U as FFIDInquiryCategorySite2026, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormOrganization, Z as FFIDInquiryFormPlaceholderContext, _ as FFIDInquiryFormPrefill, $ as FFIDInquiryFormProps, a0 as FFIDInquiryFormSubmitData, a1 as FFIDInquiryFormSubmitResult, a2 as FFIDJwtClaims, a3 as FFIDLoginButton, a4 as FFIDMemberStatus, a5 as FFIDOAuthTokenResponse, a6 as FFIDOAuthUserInfoMemberRole, a7 as FFIDOAuthUserInfoSubscription, a8 as FFIDOrganizationMember, a9 as FFIDOrganizationSwitcher, aa as FFIDRedirectErrorCode, ab as FFIDSeatModel, ac as FFIDSubscriptionBadge, ad as FFIDTokenIntrospectionResponse, ae as FFIDUserMenu, af as FFID_INQUIRY_CATEGORIES, ag as FFID_INQUIRY_CATEGORIES_SITE_2026, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-0D2vYSLq.js';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-Dr5G9HQ4.js';
2
+ export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-Dr5G9HQ4.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -505,6 +505,7 @@ declare function createFFIDClient(config: FFIDConfig): {
505
505
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
506
506
  getProfile: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
507
507
  updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
508
+ getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
508
509
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
509
510
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
510
511
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-GCUVFSB2.js';
2
- export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-GCUVFSB2.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-I7NEMG52.js';
2
+ export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-I7NEMG52.js';
3
3
  import { useEffect, useRef } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -803,7 +803,7 @@ function createProfileMethods(deps) {
803
803
  }
804
804
 
805
805
  // src/client/version-check.ts
806
- var SDK_VERSION = "2.20.0";
806
+ var SDK_VERSION = "2.21.0";
807
807
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
808
808
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
809
809
  function sdkHeaders() {
@@ -1797,6 +1797,63 @@ function createOtpMethods(deps) {
1797
1797
  };
1798
1798
  }
1799
1799
 
1800
+ // src/client/analytics-methods.ts
1801
+ var EXT_ANALYTICS_CONFIG_ENDPOINT = "/api/v1/ext/analytics/config";
1802
+ function resolveAuthOverride2(options, createError) {
1803
+ if (!options || options.accessToken === void 0) {
1804
+ return {};
1805
+ }
1806
+ const token = options.accessToken;
1807
+ if (typeof token !== "string" || token.trim() === "") {
1808
+ return {
1809
+ error: createError(
1810
+ "VALIDATION_ERROR",
1811
+ "accessToken \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u5217\u3084\u7A7A\u767D\u306E\u307F\u306E\u5024\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"
1812
+ )
1813
+ };
1814
+ }
1815
+ return { override: { accessToken: token } };
1816
+ }
1817
+ var ANALYTICS_SERVICE_CODE_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
1818
+ function validateServiceCode(serviceCode, createError) {
1819
+ if (typeof serviceCode !== "string" || serviceCode.trim() === "") {
1820
+ return createError(
1821
+ "VALIDATION_ERROR",
1822
+ "serviceCode \u306F\u5FC5\u9808\u306E kebab-case \u6587\u5B57\u5217\u3067\u3059"
1823
+ );
1824
+ }
1825
+ if (!ANALYTICS_SERVICE_CODE_PATTERN.test(serviceCode)) {
1826
+ return createError(
1827
+ "VALIDATION_ERROR",
1828
+ "serviceCode \u306F kebab-case \u5F62\u5F0F (\u82F1\u5C0F\u6587\u5B57\u30FB\u6570\u5B57\u30FB\u30CF\u30A4\u30D5\u30F3) \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
1829
+ );
1830
+ }
1831
+ return null;
1832
+ }
1833
+ function createAnalyticsMethods(deps) {
1834
+ const { fetchWithAuth, createError } = deps;
1835
+ async function getAnalyticsConfig(serviceCode, options) {
1836
+ const validationError = validateServiceCode(serviceCode, createError);
1837
+ if (validationError) {
1838
+ return { error: validationError };
1839
+ }
1840
+ const { override, error: overrideError } = resolveAuthOverride2(
1841
+ options,
1842
+ createError
1843
+ );
1844
+ if (overrideError) {
1845
+ return { error: overrideError };
1846
+ }
1847
+ const endpoint = `${EXT_ANALYTICS_CONFIG_ENDPOINT}?service=${encodeURIComponent(serviceCode)}`;
1848
+ return fetchWithAuth(
1849
+ endpoint,
1850
+ { method: "GET" },
1851
+ override
1852
+ );
1853
+ }
1854
+ return { getAnalyticsConfig };
1855
+ }
1856
+
1800
1857
  // src/client/contract-wizard-methods.ts
1801
1858
  var CONTRACT_WIZARD_PATH = "/contract-wizard";
1802
1859
  function buildWizardUrl(baseUrl, flow, params) {
@@ -2319,6 +2376,10 @@ function createFFIDClient(config) {
2319
2376
  fetchWithAuth,
2320
2377
  createError
2321
2378
  });
2379
+ const { getAnalyticsConfig } = createAnalyticsMethods({
2380
+ fetchWithAuth,
2381
+ createError
2382
+ });
2322
2383
  const {
2323
2384
  requestPasswordReset,
2324
2385
  verifyPasswordResetToken,
@@ -2392,6 +2453,7 @@ function createFFIDClient(config) {
2392
2453
  removeMember,
2393
2454
  getProfile,
2394
2455
  updateProfile,
2456
+ getAnalyticsConfig,
2395
2457
  createCheckoutSession,
2396
2458
  createPortalSession,
2397
2459
  listPlans,
@@ -1,5 +1,5 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-Cjm_TKUc.cjs';
2
- export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-Cjm_TKUc.cjs';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DgJRU-YZ.cjs';
2
+ export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-DgJRU-YZ.cjs';
3
3
  export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.cjs';
4
4
 
5
5
  /** Token verification - verifyAccessToken() implementation */
@@ -1,5 +1,5 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-Cjm_TKUc.js';
2
- export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-Cjm_TKUc.js';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DgJRU-YZ.js';
2
+ export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-DgJRU-YZ.js';
3
3
  export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.js';
4
4
 
5
5
  /** Token verification - verifyAccessToken() implementation */
@@ -802,7 +802,7 @@ function createProfileMethods(deps) {
802
802
  }
803
803
 
804
804
  // src/client/version-check.ts
805
- var SDK_VERSION = "2.20.0";
805
+ var SDK_VERSION = "2.21.0";
806
806
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
807
807
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
808
808
  function sdkHeaders() {
@@ -1796,6 +1796,63 @@ function createOtpMethods(deps) {
1796
1796
  };
1797
1797
  }
1798
1798
 
1799
+ // src/client/analytics-methods.ts
1800
+ var EXT_ANALYTICS_CONFIG_ENDPOINT = "/api/v1/ext/analytics/config";
1801
+ function resolveAuthOverride2(options, createError) {
1802
+ if (!options || options.accessToken === void 0) {
1803
+ return {};
1804
+ }
1805
+ const token = options.accessToken;
1806
+ if (typeof token !== "string" || token.trim() === "") {
1807
+ return {
1808
+ error: createError(
1809
+ "VALIDATION_ERROR",
1810
+ "accessToken \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u5217\u3084\u7A7A\u767D\u306E\u307F\u306E\u5024\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"
1811
+ )
1812
+ };
1813
+ }
1814
+ return { override: { accessToken: token } };
1815
+ }
1816
+ var ANALYTICS_SERVICE_CODE_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
1817
+ function validateServiceCode(serviceCode, createError) {
1818
+ if (typeof serviceCode !== "string" || serviceCode.trim() === "") {
1819
+ return createError(
1820
+ "VALIDATION_ERROR",
1821
+ "serviceCode \u306F\u5FC5\u9808\u306E kebab-case \u6587\u5B57\u5217\u3067\u3059"
1822
+ );
1823
+ }
1824
+ if (!ANALYTICS_SERVICE_CODE_PATTERN.test(serviceCode)) {
1825
+ return createError(
1826
+ "VALIDATION_ERROR",
1827
+ "serviceCode \u306F kebab-case \u5F62\u5F0F (\u82F1\u5C0F\u6587\u5B57\u30FB\u6570\u5B57\u30FB\u30CF\u30A4\u30D5\u30F3) \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
1828
+ );
1829
+ }
1830
+ return null;
1831
+ }
1832
+ function createAnalyticsMethods(deps) {
1833
+ const { fetchWithAuth, createError } = deps;
1834
+ async function getAnalyticsConfig(serviceCode, options) {
1835
+ const validationError = validateServiceCode(serviceCode, createError);
1836
+ if (validationError) {
1837
+ return { error: validationError };
1838
+ }
1839
+ const { override, error: overrideError } = resolveAuthOverride2(
1840
+ options,
1841
+ createError
1842
+ );
1843
+ if (overrideError) {
1844
+ return { error: overrideError };
1845
+ }
1846
+ const endpoint = `${EXT_ANALYTICS_CONFIG_ENDPOINT}?service=${encodeURIComponent(serviceCode)}`;
1847
+ return fetchWithAuth(
1848
+ endpoint,
1849
+ { method: "GET" },
1850
+ override
1851
+ );
1852
+ }
1853
+ return { getAnalyticsConfig };
1854
+ }
1855
+
1799
1856
  // src/client/contract-wizard-methods.ts
1800
1857
  var CONTRACT_WIZARD_PATH = "/contract-wizard";
1801
1858
  function buildWizardUrl(baseUrl, flow, params) {
@@ -2318,6 +2375,10 @@ function createFFIDClient(config) {
2318
2375
  fetchWithAuth,
2319
2376
  createError
2320
2377
  });
2378
+ const { getAnalyticsConfig } = createAnalyticsMethods({
2379
+ fetchWithAuth,
2380
+ createError
2381
+ });
2321
2382
  const {
2322
2383
  requestPasswordReset,
2323
2384
  verifyPasswordResetToken,
@@ -2391,6 +2452,7 @@ function createFFIDClient(config) {
2391
2452
  removeMember,
2392
2453
  getProfile,
2393
2454
  updateProfile,
2455
+ getAnalyticsConfig,
2394
2456
  createCheckoutSession,
2395
2457
  createPortalSession,
2396
2458
  listPlans,
@@ -1,4 +1,4 @@
1
- import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-Cjm_TKUc.cjs';
1
+ import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-DgJRU-YZ.cjs';
2
2
 
3
3
  /**
4
4
  * FFID SDK - Test mode client (E2E / integration test bypass)
@@ -1,4 +1,4 @@
1
- import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-Cjm_TKUc.js';
1
+ import { g as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-DgJRU-YZ.js';
2
2
 
3
3
  /**
4
4
  * FFID SDK - Test mode client (E2E / integration test bypass)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",