@feelflow/ffid-sdk 5.31.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -18,13 +18,16 @@ declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
18
18
  *
19
19
  * Coverage:
20
20
  * - `openid email profile` — OIDC standard claims (always required)
21
- * - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
21
+ * - `subscription:read` — `/api/v1/subscriptions/ext/*` 系の **読み取り**
22
+ * (`check` / `plans` / 契約詳細・シート参照。プラン / 課金 gate)
22
23
  * - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
23
24
  *
24
25
  * Add feature-specific scopes on top of this when needed (browser SDK):
25
26
  * - `analytics:read` for `/api/v1/ext/analytics/config`
26
27
  * - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
27
- * - `subscription:write` for self-serve plan changes
28
+ * - `subscription:write` for every subscription **mutation** — `subscribe()`
29
+ * (`POST /ext/subscribe`), plan changes, and cancellation. `subscription:read`
30
+ * does NOT cover these despite the shared `/ext/*` prefix (FFID #4744)
28
31
  * - `legal:write` for recording user consent
29
32
  * - `profile:read` / `profile:write` for profile UI
30
33
  * - `organization:api-key` for org-level API key issuance
@@ -633,10 +636,31 @@ interface FFIDProvisionUserDryRun {
633
636
  * response. This mirrors how `FFIDApiResponse` is narrowed on `data` / `error`.
634
637
  */
635
638
  type FFIDProvisionUserResponse = FFIDProvisionUserOutcome | FFIDProvisionUserDryRun;
636
- /** Parameters for `sendProvisionWelcomeEmail` (#4449). */
639
+ /**
640
+ * Copy variant for `sendProvisionWelcomeEmail` (#5035).
641
+ *
642
+ * Both variants carry the same password-setup link; only the wording differs.
643
+ * Mirrors the server's `provisionEmailTemplateSchema` — the API rejects unknown
644
+ * values rather than defaulting, so a typo here surfaces as a 400 instead of
645
+ * mailing the wrong copy.
646
+ */
647
+ type FFIDProvisionEmailTemplate = 'account-provisioned' | 'password-reset';
648
+ /** Parameters for `sendProvisionWelcomeEmail` (#4449, #4470, #5035). */
637
649
  interface FFIDProvisionWelcomeEmailParams {
638
650
  /** Email of the provisioned FFID user to notify (must already exist). */
639
651
  email: string;
652
+ /**
653
+ * Which copy to send (#5035). Omit for the historical
654
+ * `account-provisioned`(「アカウント発行のお知らせ」); pass `'password-reset'`
655
+ * for an already-active member whose admin requested a reset
656
+ * (「パスワード再設定のご案内」).
657
+ */
658
+ template?: FFIDProvisionEmailTemplate;
659
+ /**
660
+ * Post-setup landing URL (#4470). Validated against the calling service's
661
+ * `allowed_redirect_uris` server-side. Omit to keep the FFID login page.
662
+ */
663
+ returnTo?: string;
640
664
  }
641
665
  /**
642
666
  * Response from `sendProvisionWelcomeEmail` (#4449).
@@ -1303,8 +1327,8 @@ declare const FFID_CATALOG_ENVIRONMENTS: readonly ["staging", "production"];
1303
1327
  type FFIDCatalogEnvironment = (typeof FFID_CATALOG_ENVIRONMENTS)[number];
1304
1328
  /**
1305
1329
  * Tax behavior of a published price.
1306
- * `inclusive`: displayed price contains Stripe-calculated tax (Personal/Pro).
1307
- * `exclusive`: tax is added on top of the base price (Team).
1330
+ * `inclusive`: displayed price contains Stripe-calculated tax.
1331
+ * `exclusive`: tax is added on top of the base price.
1308
1332
  */
1309
1333
  type FFIDTaxBehavior = 'inclusive' | 'exclusive';
1310
1334
  /**
package/dist/index.d.ts CHANGED
@@ -18,13 +18,16 @@ declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
18
18
  *
19
19
  * Coverage:
20
20
  * - `openid email profile` — OIDC standard claims (always required)
21
- * - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
21
+ * - `subscription:read` — `/api/v1/subscriptions/ext/*` 系の **読み取り**
22
+ * (`check` / `plans` / 契約詳細・シート参照。プラン / 課金 gate)
22
23
  * - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
23
24
  *
24
25
  * Add feature-specific scopes on top of this when needed (browser SDK):
25
26
  * - `analytics:read` for `/api/v1/ext/analytics/config`
26
27
  * - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
27
- * - `subscription:write` for self-serve plan changes
28
+ * - `subscription:write` for every subscription **mutation** — `subscribe()`
29
+ * (`POST /ext/subscribe`), plan changes, and cancellation. `subscription:read`
30
+ * does NOT cover these despite the shared `/ext/*` prefix (FFID #4744)
28
31
  * - `legal:write` for recording user consent
29
32
  * - `profile:read` / `profile:write` for profile UI
30
33
  * - `organization:api-key` for org-level API key issuance
@@ -633,10 +636,31 @@ interface FFIDProvisionUserDryRun {
633
636
  * response. This mirrors how `FFIDApiResponse` is narrowed on `data` / `error`.
634
637
  */
635
638
  type FFIDProvisionUserResponse = FFIDProvisionUserOutcome | FFIDProvisionUserDryRun;
636
- /** Parameters for `sendProvisionWelcomeEmail` (#4449). */
639
+ /**
640
+ * Copy variant for `sendProvisionWelcomeEmail` (#5035).
641
+ *
642
+ * Both variants carry the same password-setup link; only the wording differs.
643
+ * Mirrors the server's `provisionEmailTemplateSchema` — the API rejects unknown
644
+ * values rather than defaulting, so a typo here surfaces as a 400 instead of
645
+ * mailing the wrong copy.
646
+ */
647
+ type FFIDProvisionEmailTemplate = 'account-provisioned' | 'password-reset';
648
+ /** Parameters for `sendProvisionWelcomeEmail` (#4449, #4470, #5035). */
637
649
  interface FFIDProvisionWelcomeEmailParams {
638
650
  /** Email of the provisioned FFID user to notify (must already exist). */
639
651
  email: string;
652
+ /**
653
+ * Which copy to send (#5035). Omit for the historical
654
+ * `account-provisioned`(「アカウント発行のお知らせ」); pass `'password-reset'`
655
+ * for an already-active member whose admin requested a reset
656
+ * (「パスワード再設定のご案内」).
657
+ */
658
+ template?: FFIDProvisionEmailTemplate;
659
+ /**
660
+ * Post-setup landing URL (#4470). Validated against the calling service's
661
+ * `allowed_redirect_uris` server-side. Omit to keep the FFID login page.
662
+ */
663
+ returnTo?: string;
640
664
  }
641
665
  /**
642
666
  * Response from `sendProvisionWelcomeEmail` (#4449).
@@ -1303,8 +1327,8 @@ declare const FFID_CATALOG_ENVIRONMENTS: readonly ["staging", "production"];
1303
1327
  type FFIDCatalogEnvironment = (typeof FFID_CATALOG_ENVIRONMENTS)[number];
1304
1328
  /**
1305
1329
  * Tax behavior of a published price.
1306
- * `inclusive`: displayed price contains Stripe-calculated tax (Personal/Pro).
1307
- * `exclusive`: tax is added on top of the base price (Team).
1330
+ * `inclusive`: displayed price contains Stripe-calculated tax.
1331
+ * `exclusive`: tax is added on top of the base price.
1308
1332
  */
1309
1333
  type FFIDTaxBehavior = 'inclusive' | 'exclusive';
1310
1334
  /**
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-SLYSWV4S.js';
2
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_ERROR_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, canonicalizeCatalogValue, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, validatePublishedCatalog, withSubscription } from './chunk-SLYSWV4S.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-NBBHMLXO.js';
2
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_ERROR_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, canonicalizeCatalogValue, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, validatePublishedCatalog, withSubscription } from './chunk-NBBHMLXO.js';
3
3
  export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, CONSENT_DISMISSAL_TIMESTAMP_KEY, COOKIE_VERSION, DEFAULT_CONSENT_ERROR_MESSAGES, FFIDAnalyticsProvider, FFIDConsentError, FFIDCookieBanner, FFIDCookieLink, FFIDCookieSettings, FFID_CONSENT_ERROR_CODES, clearConsentDismissalTimestamp, decodeConsentCookie, encodeConsentCookie, readConsentCookie, readConsentDismissalTimestamp, useFFIDConsent, useFFIDConsentPreferences, writeConsentCookie, writeConsentDismissalTimestamp } from './chunk-G7VOX64X.js';
4
4
  import { useEffect, useRef } from 'react';
5
5
  import { jsx, Fragment } from 'react/jsx-runtime';
@@ -16,7 +16,14 @@ var FFID_LEGAL_ERROR_CODES = {
16
16
  /** Server returned error without structured error body */
17
17
  UNKNOWN_ERROR: "UNKNOWN_ERROR",
18
18
  /** Input validation failed (empty required parameters) */
19
- VALIDATION_ERROR: "VALIDATION_ERROR"
19
+ VALIDATION_ERROR: "VALIDATION_ERROR",
20
+ /**
21
+ * `externalUserEmail` was missing or blank (since 6.0.0).
22
+ *
23
+ * The same code the API returns with HTTP 422, so a consumer can branch on
24
+ * one value whether the request was refused locally or by the server.
25
+ */
26
+ EXTERNAL_USER_EMAIL_REQUIRED: "EXTERNAL_USER_EMAIL_REQUIRED"
20
27
  };
21
28
  var noopLogger = {
22
29
  debug: () => {
@@ -125,6 +132,14 @@ function createFFIDLegalClient(config) {
125
132
  }
126
133
  };
127
134
  }
135
+ if (typeof request.externalUserEmail !== "string" || !request.externalUserEmail.trim()) {
136
+ return {
137
+ error: {
138
+ code: FFID_LEGAL_ERROR_CODES.EXTERNAL_USER_EMAIL_REQUIRED,
139
+ message: "externalUserEmail is required"
140
+ }
141
+ };
142
+ }
128
143
  return fetchWithApiKey("/agreements", {
129
144
  method: "POST",
130
145
  body: JSON.stringify(request)
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_API_BASE_URL } from '../constants-D61jqRIO.cjs';
1
+ export { D as DEFAULT_API_BASE_URL } from '../constants-Ce2eXQtB.cjs';
2
2
 
3
3
  /**
4
4
  * FFID Legal SDK Type Definitions
@@ -79,10 +79,21 @@ interface FFIDServiceUserAgreement {
79
79
  id: string;
80
80
  /** Service ID (UUID) */
81
81
  serviceId: string;
82
- /** External user ID (from the calling service) */
82
+ /**
83
+ * Opaque user identifier owned by the calling service (its own primary key,
84
+ * or the upstream IdP's `sub`).
85
+ *
86
+ * Do **not** put an FFID user ID here — FFID resolves its own linkage from
87
+ * `externalUserEmail` and exposes it as {@link FFIDServiceUserAgreement.userId}.
88
+ */
83
89
  externalUserId: string;
84
- /** External user email (optional) */
90
+ /** External user email recorded at agreement time */
85
91
  externalUserEmail: string | null;
92
+ /**
93
+ * FFID user this consent resolved to, or `null` when no FFID account matched
94
+ * `externalUserEmail`. The consent record is kept either way.
95
+ */
96
+ userId: string | null;
86
97
  /** Document ID (UUID) */
87
98
  documentId: string;
88
99
  /** Agreement timestamp (ISO 8601) */
@@ -108,10 +119,19 @@ interface FFIDServiceUserAgreement {
108
119
  * Request to record an agreement
109
120
  */
110
121
  interface FFIDRecordAgreementRequest {
111
- /** External user ID (from the calling service, e.g., Google OAuth ID) */
122
+ /**
123
+ * Opaque user identifier owned by the calling service (its own primary key,
124
+ * or the upstream IdP's `sub`). Do **not** send an FFID user ID.
125
+ */
112
126
  externalUserId: string;
113
- /** External user email (optional) */
114
- externalUserEmail?: string;
127
+ /**
128
+ * External user email. **Required.**
129
+ *
130
+ * FFID uses it as the only input for resolving this consent to an FFID user,
131
+ * and rejects the request with HTTP 422 (`EXTERNAL_USER_EMAIL_REQUIRED`) when
132
+ * it is missing or blank.
133
+ */
134
+ externalUserEmail: string;
115
135
  /** Document ID to agree to */
116
136
  documentId: string;
117
137
  /** Method of agreement (defaults to 'click_through') */
@@ -295,6 +315,13 @@ declare const FFID_LEGAL_ERROR_CODES: {
295
315
  readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
296
316
  /** Input validation failed (empty required parameters) */
297
317
  readonly VALIDATION_ERROR: "VALIDATION_ERROR";
318
+ /**
319
+ * `externalUserEmail` was missing or blank (since 6.0.0).
320
+ *
321
+ * The same code the API returns with HTTP 422, so a consumer can branch on
322
+ * one value whether the request was refused locally or by the server.
323
+ */
324
+ readonly EXTERNAL_USER_EMAIL_REQUIRED: "EXTERNAL_USER_EMAIL_REQUIRED";
298
325
  };
299
326
  /**
300
327
  * Creates an FFID Legal API client instance
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_API_BASE_URL } from '../constants-D61jqRIO.js';
1
+ export { D as DEFAULT_API_BASE_URL } from '../constants-Ce2eXQtB.js';
2
2
 
3
3
  /**
4
4
  * FFID Legal SDK Type Definitions
@@ -79,10 +79,21 @@ interface FFIDServiceUserAgreement {
79
79
  id: string;
80
80
  /** Service ID (UUID) */
81
81
  serviceId: string;
82
- /** External user ID (from the calling service) */
82
+ /**
83
+ * Opaque user identifier owned by the calling service (its own primary key,
84
+ * or the upstream IdP's `sub`).
85
+ *
86
+ * Do **not** put an FFID user ID here — FFID resolves its own linkage from
87
+ * `externalUserEmail` and exposes it as {@link FFIDServiceUserAgreement.userId}.
88
+ */
83
89
  externalUserId: string;
84
- /** External user email (optional) */
90
+ /** External user email recorded at agreement time */
85
91
  externalUserEmail: string | null;
92
+ /**
93
+ * FFID user this consent resolved to, or `null` when no FFID account matched
94
+ * `externalUserEmail`. The consent record is kept either way.
95
+ */
96
+ userId: string | null;
86
97
  /** Document ID (UUID) */
87
98
  documentId: string;
88
99
  /** Agreement timestamp (ISO 8601) */
@@ -108,10 +119,19 @@ interface FFIDServiceUserAgreement {
108
119
  * Request to record an agreement
109
120
  */
110
121
  interface FFIDRecordAgreementRequest {
111
- /** External user ID (from the calling service, e.g., Google OAuth ID) */
122
+ /**
123
+ * Opaque user identifier owned by the calling service (its own primary key,
124
+ * or the upstream IdP's `sub`). Do **not** send an FFID user ID.
125
+ */
112
126
  externalUserId: string;
113
- /** External user email (optional) */
114
- externalUserEmail?: string;
127
+ /**
128
+ * External user email. **Required.**
129
+ *
130
+ * FFID uses it as the only input for resolving this consent to an FFID user,
131
+ * and rejects the request with HTTP 422 (`EXTERNAL_USER_EMAIL_REQUIRED`) when
132
+ * it is missing or blank.
133
+ */
134
+ externalUserEmail: string;
115
135
  /** Document ID to agree to */
116
136
  documentId: string;
117
137
  /** Method of agreement (defaults to 'click_through') */
@@ -295,6 +315,13 @@ declare const FFID_LEGAL_ERROR_CODES: {
295
315
  readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
296
316
  /** Input validation failed (empty required parameters) */
297
317
  readonly VALIDATION_ERROR: "VALIDATION_ERROR";
318
+ /**
319
+ * `externalUserEmail` was missing or blank (since 6.0.0).
320
+ *
321
+ * The same code the API returns with HTTP 422, so a consumer can branch on
322
+ * one value whether the request was refused locally or by the server.
323
+ */
324
+ readonly EXTERNAL_USER_EMAIL_REQUIRED: "EXTERNAL_USER_EMAIL_REQUIRED";
298
325
  };
299
326
  /**
300
327
  * Creates an FFID Legal API client instance
@@ -15,7 +15,14 @@ var FFID_LEGAL_ERROR_CODES = {
15
15
  /** Server returned error without structured error body */
16
16
  UNKNOWN_ERROR: "UNKNOWN_ERROR",
17
17
  /** Input validation failed (empty required parameters) */
18
- VALIDATION_ERROR: "VALIDATION_ERROR"
18
+ VALIDATION_ERROR: "VALIDATION_ERROR",
19
+ /**
20
+ * `externalUserEmail` was missing or blank (since 6.0.0).
21
+ *
22
+ * The same code the API returns with HTTP 422, so a consumer can branch on
23
+ * one value whether the request was refused locally or by the server.
24
+ */
25
+ EXTERNAL_USER_EMAIL_REQUIRED: "EXTERNAL_USER_EMAIL_REQUIRED"
19
26
  };
20
27
  var noopLogger = {
21
28
  debug: () => {
@@ -124,6 +131,14 @@ function createFFIDLegalClient(config) {
124
131
  }
125
132
  };
126
133
  }
134
+ if (typeof request.externalUserEmail !== "string" || !request.externalUserEmail.trim()) {
135
+ return {
136
+ error: {
137
+ code: FFID_LEGAL_ERROR_CODES.EXTERNAL_USER_EMAIL_REQUIRED,
138
+ message: "externalUserEmail is required"
139
+ }
140
+ };
141
+ }
127
142
  return fetchWithApiKey("/agreements", {
128
143
  method: "POST",
129
144
  body: JSON.stringify(request)
@@ -1342,7 +1342,11 @@ function createProvisioningMethods(deps) {
1342
1342
  }
1343
1343
  return fetchWithAuth(USER_WELCOME_EMAIL_ENDPOINT, {
1344
1344
  method: "POST",
1345
- body: JSON.stringify({ email: params.email.trim() })
1345
+ body: JSON.stringify({
1346
+ email: params.email.trim(),
1347
+ ...params.template !== void 0 ? { template: params.template } : {},
1348
+ ...params.returnTo !== void 0 ? { returnTo: params.returnTo } : {}
1349
+ })
1346
1350
  });
1347
1351
  }
1348
1352
  async function provisionOrganization(params) {
@@ -1668,7 +1672,7 @@ function validateTokenResponse(tokenResponse) {
1668
1672
  }
1669
1673
 
1670
1674
  // src/client/version-check.ts
1671
- var SDK_VERSION = "5.31.1";
1675
+ var SDK_VERSION = "6.0.0";
1672
1676
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1673
1677
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1674
1678
  function sdkHeaders() {
@@ -1,6 +1,6 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-BTTbDVj7.cjs';
2
- export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAssignableMemberRole, n as FFIDCacheConfig, o as FFIDCatalogPublication, p as FFIDCatalogPublicationStatus, q as FFIDClient, r as FFIDConfig, s as FFIDListMembersResponse, t as FFIDMemberRole, u as FFIDOrganization, v as FFIDOrganizationMember, w as FFIDOtpSendResponse, x as FFIDOtpVerifyResponse, y as FFIDPasswordResetConfirmResponse, z as FFIDPasswordResetResponse, A as FFIDPasswordResetVerifyResponse, B as FFIDProfileCallOptions, C as FFIDProvisionMemberPlan, D as FFIDProvisionMemberPlanStatus, E as FFIDProvisionMemberResult, G as FFIDProvisionMemberStatus, H as FFIDProvisionOrganizationDryRun, I as FFIDProvisionOrganizationMemberInput, J as FFIDProvisionOrganizationOutcome, K as FFIDProvisionOrganizationParams, L as FFIDProvisionOrganizationResponse, M as FFIDProvisionUserDryRun, N as FFIDProvisionUserOutcome, O as FFIDProvisionUserParams, P as FFIDProvisionUserProfileInput, Q as FFIDProvisionUserResponse, R as FFIDProvisionedOrganization, S as FFIDProvisionedUser, T as FFIDPublishedPlan, U as FFIDRemoveMemberResponse, V as FFIDResetSessionResponse, W as FFIDSubscription, X as FFIDUpdateMemberRoleResponse, Y as FFIDUpdateUserProfileRequest, Z as FFIDUser, _ as FFIDUserProfile, $ as FFID_CATALOG_ENVIRONMENTS, a0 as FFID_CATALOG_PUBLICATION_STATUSES, a1 as TokenData, a2 as TokenStore, a3 as createFFIDClient, a4 as createTokenStore } from '../ffid-client-BTTbDVj7.cjs';
3
- export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-C8XV7lUt.cjs';
2
+ export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAssignableMemberRole, n as FFIDCacheConfig, o as FFIDCatalogPublication, p as FFIDCatalogPublicationStatus, q as FFIDClient, r as FFIDConfig, s as FFIDListMembersResponse, t as FFIDMemberRole, u as FFIDOrganization, v as FFIDOrganizationMember, w as FFIDOtpSendResponse, x as FFIDOtpVerifyResponse, y as FFIDPasswordResetConfirmResponse, z as FFIDPasswordResetResponse, A as FFIDPasswordResetVerifyResponse, B as FFIDProfileCallOptions, C as FFIDProvisionMemberPlan, D as FFIDProvisionMemberPlanStatus, E as FFIDProvisionMemberResult, G as FFIDProvisionMemberStatus, H as FFIDProvisionOrganizationDryRun, I as FFIDProvisionOrganizationMemberInput, J as FFIDProvisionOrganizationOutcome, K as FFIDProvisionOrganizationParams, L as FFIDProvisionOrganizationResponse, M as FFIDProvisionUserDryRun, N as FFIDProvisionUserOutcome, O as FFIDProvisionUserParams, P as FFIDProvisionUserProfileInput, Q as FFIDProvisionUserResponse, R as FFIDProvisionedOrganization, S as FFIDProvisionedUser, T as FFIDPublishedPlan, U as FFIDRemoveMemberResponse, V as FFIDResetSessionResponse, W as FFIDSubscription, X as FFIDUpdateMemberRoleResponse, Y as FFIDUpdateUserProfileRequest, Z as FFIDUser, _ as FFIDUserProfile, $ as FFID_CATALOG_ENVIRONMENTS, a0 as FFID_CATALOG_PUBLICATION_STATUSES, a1 as TokenData, a2 as TokenStore, a3 as createFFIDClient, a4 as createTokenStore } from '../ffid-client-C8XV7lUt.cjs';
3
+ export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.cjs';
4
4
  import { z } from 'zod';
5
5
  import '../types-Cjb9J0rL.cjs';
6
6
 
@@ -1,6 +1,6 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-C5lc7SkY.js';
2
- export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAssignableMemberRole, n as FFIDCacheConfig, o as FFIDCatalogPublication, p as FFIDCatalogPublicationStatus, q as FFIDClient, r as FFIDConfig, s as FFIDListMembersResponse, t as FFIDMemberRole, u as FFIDOrganization, v as FFIDOrganizationMember, w as FFIDOtpSendResponse, x as FFIDOtpVerifyResponse, y as FFIDPasswordResetConfirmResponse, z as FFIDPasswordResetResponse, A as FFIDPasswordResetVerifyResponse, B as FFIDProfileCallOptions, C as FFIDProvisionMemberPlan, D as FFIDProvisionMemberPlanStatus, E as FFIDProvisionMemberResult, G as FFIDProvisionMemberStatus, H as FFIDProvisionOrganizationDryRun, I as FFIDProvisionOrganizationMemberInput, J as FFIDProvisionOrganizationOutcome, K as FFIDProvisionOrganizationParams, L as FFIDProvisionOrganizationResponse, M as FFIDProvisionUserDryRun, N as FFIDProvisionUserOutcome, O as FFIDProvisionUserParams, P as FFIDProvisionUserProfileInput, Q as FFIDProvisionUserResponse, R as FFIDProvisionedOrganization, S as FFIDProvisionedUser, T as FFIDPublishedPlan, U as FFIDRemoveMemberResponse, V as FFIDResetSessionResponse, W as FFIDSubscription, X as FFIDUpdateMemberRoleResponse, Y as FFIDUpdateUserProfileRequest, Z as FFIDUser, _ as FFIDUserProfile, $ as FFID_CATALOG_ENVIRONMENTS, a0 as FFID_CATALOG_PUBLICATION_STATUSES, a1 as TokenData, a2 as TokenStore, a3 as createFFIDClient, a4 as createTokenStore } from '../ffid-client-C5lc7SkY.js';
3
- export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.js';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-CpVixUM3.js';
2
+ export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAssignableMemberRole, n as FFIDCacheConfig, o as FFIDCatalogPublication, p as FFIDCatalogPublicationStatus, q as FFIDClient, r as FFIDConfig, s as FFIDListMembersResponse, t as FFIDMemberRole, u as FFIDOrganization, v as FFIDOrganizationMember, w as FFIDOtpSendResponse, x as FFIDOtpVerifyResponse, y as FFIDPasswordResetConfirmResponse, z as FFIDPasswordResetResponse, A as FFIDPasswordResetVerifyResponse, B as FFIDProfileCallOptions, C as FFIDProvisionMemberPlan, D as FFIDProvisionMemberPlanStatus, E as FFIDProvisionMemberResult, G as FFIDProvisionMemberStatus, H as FFIDProvisionOrganizationDryRun, I as FFIDProvisionOrganizationMemberInput, J as FFIDProvisionOrganizationOutcome, K as FFIDProvisionOrganizationParams, L as FFIDProvisionOrganizationResponse, M as FFIDProvisionUserDryRun, N as FFIDProvisionUserOutcome, O as FFIDProvisionUserParams, P as FFIDProvisionUserProfileInput, Q as FFIDProvisionUserResponse, R as FFIDProvisionedOrganization, S as FFIDProvisionedUser, T as FFIDPublishedPlan, U as FFIDRemoveMemberResponse, V as FFIDResetSessionResponse, W as FFIDSubscription, X as FFIDUpdateMemberRoleResponse, Y as FFIDUpdateUserProfileRequest, Z as FFIDUser, _ as FFIDUserProfile, $ as FFID_CATALOG_ENVIRONMENTS, a0 as FFID_CATALOG_PUBLICATION_STATUSES, a1 as TokenData, a2 as TokenStore, a3 as createFFIDClient, a4 as createTokenStore } from '../ffid-client-CpVixUM3.js';
3
+ export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.js';
4
4
  import { z } from 'zod';
5
5
  import '../types-Cjb9J0rL.js';
6
6
 
@@ -1341,7 +1341,11 @@ function createProvisioningMethods(deps) {
1341
1341
  }
1342
1342
  return fetchWithAuth(USER_WELCOME_EMAIL_ENDPOINT, {
1343
1343
  method: "POST",
1344
- body: JSON.stringify({ email: params.email.trim() })
1344
+ body: JSON.stringify({
1345
+ email: params.email.trim(),
1346
+ ...params.template !== void 0 ? { template: params.template } : {},
1347
+ ...params.returnTo !== void 0 ? { returnTo: params.returnTo } : {}
1348
+ })
1345
1349
  });
1346
1350
  }
1347
1351
  async function provisionOrganization(params) {
@@ -1667,7 +1671,7 @@ function validateTokenResponse(tokenResponse) {
1667
1671
  }
1668
1672
 
1669
1673
  // src/client/version-check.ts
1670
- var SDK_VERSION = "5.31.1";
1674
+ var SDK_VERSION = "6.0.0";
1671
1675
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1672
1676
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1673
1677
  function sdkHeaders() {
@@ -1,4 +1,4 @@
1
- import { q as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-BTTbDVj7.cjs';
1
+ import { q as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-C8XV7lUt.cjs';
2
2
  import '../../types-Cjb9J0rL.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { q as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-C5lc7SkY.js';
1
+ import { q as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-CpVixUM3.js';
2
2
  import '../../types-Cjb9J0rL.js';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "5.31.1",
3
+ "version": "6.0.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",