@frak-labs/core-sdk 0.2.1 → 1.0.0-beta.0cd79998

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.
Files changed (82) hide show
  1. package/README.md +1 -2
  2. package/cdn/bundle.js +3 -3
  3. package/dist/actions-BMTVobuH.js +1 -0
  4. package/dist/actions-ukNCM0d7.cjs +1 -0
  5. package/dist/actions.cjs +1 -1
  6. package/dist/actions.d.cts +3 -3
  7. package/dist/actions.d.ts +3 -3
  8. package/dist/actions.js +1 -1
  9. package/dist/bundle.cjs +1 -1
  10. package/dist/bundle.d.cts +4 -4
  11. package/dist/bundle.d.ts +4 -4
  12. package/dist/bundle.js +1 -1
  13. package/dist/{computeLegacyProductId-b5cUWdAm.d.ts → index-BCwGNRmk.d.cts} +144 -58
  14. package/dist/{computeLegacyProductId-CCAZvLa5.d.cts → index-BfmJnxzo.d.ts} +144 -58
  15. package/dist/{siweAuthenticate-CnCZ7mok.d.ts → index-CVnwk1E_.d.cts} +122 -8
  16. package/dist/{siweAuthenticate-CVigMOxz.d.cts → index-DZuYiI2M.d.ts} +122 -8
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +1 -1
  21. package/dist/{openSso-B0g7-807.d.cts → openSso-BQ-q-_Y9.d.ts} +373 -46
  22. package/dist/{openSso-CMzwvaCa.d.ts → openSso-CMBCbhvP.d.cts} +372 -45
  23. package/dist/src-Cx0RZEA3.js +13 -0
  24. package/dist/src-DmYZ4ZLk.cjs +13 -0
  25. package/dist/trackEvent-B5xo_5K3.cjs +1 -0
  26. package/dist/trackEvent-DdykyX0U.js +1 -0
  27. package/package.json +12 -13
  28. package/src/actions/displayEmbeddedWallet.ts +6 -2
  29. package/src/actions/displayModal.ts +6 -2
  30. package/src/actions/displaySharingPage.ts +49 -0
  31. package/src/actions/ensureIdentity.ts +2 -2
  32. package/src/actions/getMerchantInformation.test.ts +13 -1
  33. package/src/actions/getMerchantInformation.ts +20 -5
  34. package/src/actions/getMergeToken.ts +33 -0
  35. package/src/actions/getUserReferralStatus.ts +42 -0
  36. package/src/actions/index.ts +8 -1
  37. package/src/actions/referral/setupReferral.test.ts +79 -0
  38. package/src/actions/referral/setupReferral.ts +32 -0
  39. package/src/actions/trackPurchaseStatus.test.ts +32 -20
  40. package/src/actions/trackPurchaseStatus.ts +3 -5
  41. package/src/actions/wrapper/modalBuilder.test.ts +4 -2
  42. package/src/actions/wrapper/modalBuilder.ts +6 -8
  43. package/src/clients/createIFrameFrakClient.ts +162 -27
  44. package/src/clients/transports/iframeLifecycleManager.test.ts +14 -94
  45. package/src/clients/transports/iframeLifecycleManager.ts +35 -53
  46. package/src/index.ts +21 -4
  47. package/src/stubs/rrweb.ts +9 -0
  48. package/src/types/config.ts +19 -3
  49. package/src/types/index.ts +15 -1
  50. package/src/types/lifecycle/client.ts +22 -27
  51. package/src/types/lifecycle/iframe.ts +7 -8
  52. package/src/types/resolvedConfig.ts +138 -0
  53. package/src/types/rpc/displaySharingPage.ts +100 -0
  54. package/src/types/rpc/embedded/index.ts +1 -1
  55. package/src/types/rpc/interaction.ts +4 -0
  56. package/src/types/rpc/userReferralStatus.ts +20 -0
  57. package/src/types/rpc.ts +54 -5
  58. package/src/types/tracking.ts +36 -0
  59. package/src/utils/FrakContext.test.ts +144 -0
  60. package/src/utils/FrakContext.ts +67 -1
  61. package/src/utils/backendUrl.test.ts +2 -2
  62. package/src/utils/backendUrl.ts +1 -1
  63. package/src/utils/cache/index.ts +7 -0
  64. package/src/utils/cache/lruMap.test.ts +55 -0
  65. package/src/utils/cache/lruMap.ts +38 -0
  66. package/src/utils/cache/withCache.test.ts +168 -0
  67. package/src/utils/cache/withCache.ts +124 -0
  68. package/src/utils/inAppBrowser.ts +60 -0
  69. package/src/utils/index.ts +10 -4
  70. package/src/utils/mergeAttribution.test.ts +153 -0
  71. package/src/utils/mergeAttribution.ts +75 -0
  72. package/src/utils/sdkConfigStore.test.ts +405 -0
  73. package/src/utils/sdkConfigStore.ts +263 -0
  74. package/src/utils/sso.ts +3 -7
  75. package/dist/setupClient-BduY6Sym.cjs +0 -13
  76. package/dist/setupClient-ftmdQ-I8.js +0 -13
  77. package/dist/siweAuthenticate-BWmI2_TN.cjs +0 -1
  78. package/dist/siweAuthenticate-zczqxm0a.js +0 -1
  79. package/dist/trackEvent-CeLFVzZn.js +0 -1
  80. package/dist/trackEvent-Ew5r5zfI.cjs +0 -1
  81. package/src/utils/merchantId.test.ts +0 -653
  82. package/src/utils/merchantId.ts +0 -143
@@ -1,13 +1,14 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, E as ModalRpcMetadata, F as SiweAuthenticationParams, H as FinalActionType, I as LoginModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, T as DisplayModalParamsType, U as FinalModalStepType, b as DisplayEmbeddedWalletResultType, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, p as WalletStatusReturnType, v as SendInteractionParamsType, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-CMzwvaCa.js";
1
+ import { A as ModalRpcMetadata, B as LoginModalStepType, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, K as FinalActionType, M as ModalRpcStepsResultType, N as ModalStepTypes, P as SendTransactionModalStepType, R as SiweAuthenticateReturnType, U as PrepareSsoParamsType, W as PrepareSsoReturnType, b as DisplayEmbeddedWalletParamsType, g as GetMerchantInformationReturnType, i as FrakContext, k as DisplayModalParamsType, l as FrakClient, m as UserReferralStatusType, p as WalletStatusReturnType, q as FinalModalStepType, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-CMBCbhvP.cjs";
2
2
 
3
3
  //#region src/actions/displayEmbeddedWallet.d.ts
4
4
  /**
5
5
  * Function used to display the Frak embedded wallet popup
6
6
  * @param client - The current Frak Client
7
7
  * @param params - The parameter used to customise the embedded wallet
8
+ * @param placement - Optional placement ID to associate with this display request
8
9
  * @returns The embedded wallet display result
9
10
  */
10
- declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbeddedWalletParamsType): Promise<DisplayEmbeddedWalletResultType>;
11
+ declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbeddedWalletParamsType, placement?: string): Promise<DisplayEmbeddedWalletResultType>;
11
12
  //#endregion
12
13
  //#region src/actions/displayModal.d.ts
13
14
  /**
@@ -16,6 +17,7 @@ declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbedd
16
17
  * @param args
17
18
  * @param args.steps - The different steps of the modal
18
19
  * @param args.metadata - The metadata for the modal (customization, etc)
20
+ * @param placement - Optional placement ID to associate with this modal display
19
21
  * @returns The result of each modal steps
20
22
  *
21
23
  * @description This function will display a modal to the user with the provided steps and metadata.
@@ -115,7 +117,41 @@ declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbedd
115
117
  declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(client: FrakClient, {
116
118
  steps,
117
119
  metadata
118
- }: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
120
+ }: DisplayModalParamsType<T>, placement?: string): Promise<ModalRpcStepsResultType<T>>;
121
+ //#endregion
122
+ //#region src/actions/displaySharingPage.d.ts
123
+ /**
124
+ * Function used to display a sharing page
125
+ * @param client - The current Frak Client
126
+ * @param params - The parameters to customize the sharing page (products, link override, metadata)
127
+ * @param placement - Optional placement ID to associate with this display request
128
+ * @returns The result indicating the user's action (shared, copied, or dismissed)
129
+ *
130
+ * @description This function will display a full-page sharing UI to the user,
131
+ * showing product info, estimated rewards, sharing steps, FAQ, and share/copy buttons.
132
+ * The sharing link is generated from the user's wallet context + merchant info.
133
+ *
134
+ * @remarks
135
+ * - The promise resolves on the first user action (share or copy) but the page stays visible
136
+ * - The user can continue to share/copy multiple times after the initial resolution
137
+ * - Dismissing the page after a share/copy action is a no-op (promise already resolved)
138
+ * - If the user dismisses without any action, the promise resolves with `{ action: "dismissed" }`
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * const result = await displaySharingPage(frakClient, {
143
+ * products: [
144
+ * {
145
+ * title: "Babies camel cuir velours bout carré",
146
+ * imageUrl: "https://example.com/product.jpg",
147
+ * },
148
+ * ],
149
+ * });
150
+ *
151
+ * console.log("User action:", result.action); // "shared" | "copied" | "dismissed"
152
+ * ```
153
+ */
154
+ declare function displaySharingPage(client: FrakClient, params: DisplaySharingPageParamsType, placement?: string): Promise<DisplaySharingPageResultType>;
119
155
  //#endregion
120
156
  //#region src/actions/ensureIdentity.d.ts
121
157
  /**
@@ -144,13 +180,70 @@ declare function ensureIdentity(interactionToken: string): Promise<void>;
144
180
  //#endregion
145
181
  //#region src/actions/getMerchantInformation.d.ts
146
182
  /**
147
- * Fetch the current merchant information (name, rewards, tiers) from the wallet iframe
183
+ * Fetch the current merchant information (name, rewards, tiers) from the wallet iframe.
184
+ *
185
+ * Results are cached in memory for 30 seconds by default. Concurrent calls
186
+ * while a request is in-flight are deduplicated automatically.
187
+ *
148
188
  * @param client - The current Frak Client
189
+ * @param options - Optional cache configuration
190
+ * @param options.cacheTime - Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
149
191
  * @returns The merchant information including available reward tiers
150
192
  *
151
193
  * @see {@link @frak-labs/core-sdk!index.GetMerchantInformationReturnType | `GetMerchantInformationReturnType`} for the return type shape
152
194
  */
153
- declare function getMerchantInformation(client: FrakClient): Promise<GetMerchantInformationReturnType>;
195
+ declare function getMerchantInformation(client: FrakClient, options?: {
196
+ cacheTime?: number;
197
+ }): Promise<GetMerchantInformationReturnType>;
198
+ //#endregion
199
+ //#region src/actions/getMergeToken.d.ts
200
+ /**
201
+ * Fetch a merge token for the current anonymous identity.
202
+ *
203
+ * Used by in-app browser redirect flows to preserve identity
204
+ * when switching from a WebView to the system browser.
205
+ * The token is appended as `?fmt=` to the redirect URL.
206
+ *
207
+ * Results are cached in memory for 30 seconds by default. Concurrent calls
208
+ * while a request is in-flight are deduplicated automatically.
209
+ *
210
+ * @param client - The current Frak Client
211
+ * @param options - Optional cache configuration
212
+ * @param options.cacheTime - Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
213
+ * @returns The merge token string, or null if unavailable
214
+ */
215
+ declare function getMergeToken(client: FrakClient, options?: {
216
+ cacheTime?: number;
217
+ }): Promise<string | null>;
218
+ //#endregion
219
+ //#region src/actions/getUserReferralStatus.d.ts
220
+ /**
221
+ * Fetch the current user's referral status on the current merchant.
222
+ *
223
+ * The listener resolves the user's identity (via clientId or wallet session)
224
+ * and checks whether a referral link exists where the user is the referee.
225
+ *
226
+ * Results are cached in memory for 30 seconds by default. Concurrent calls
227
+ * while a request is in-flight are deduplicated automatically.
228
+ *
229
+ * Returns `null` when the user's identity cannot be resolved.
230
+ *
231
+ * @param client - The current Frak Client
232
+ * @param options - Optional cache configuration
233
+ * @param options.cacheTime - Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
234
+ * @returns The user's referral status, or `null` if identity cannot be resolved
235
+ *
236
+ * @example
237
+ * ```ts
238
+ * const status = await getUserReferralStatus(client);
239
+ * if (status?.isReferred) {
240
+ * console.log("User was referred to this merchant");
241
+ * }
242
+ * ```
243
+ */
244
+ declare function getUserReferralStatus(client: FrakClient, options?: {
245
+ cacheTime?: number;
246
+ }): Promise<UserReferralStatusType | null>;
154
247
  //#endregion
155
248
  //#region src/actions/prepareSso.d.ts
156
249
  /**
@@ -256,6 +349,26 @@ declare function referralInteraction(client: FrakClient, {
256
349
  options?: ProcessReferralOptions;
257
350
  }): Promise<("idle" | "processing" | "success" | "no-referrer" | "self-referral") | undefined>;
258
351
  //#endregion
352
+ //#region src/actions/referral/setupReferral.d.ts
353
+ /**
354
+ * Custom event name dispatched on successful referral processing.
355
+ *
356
+ * Fired once per page load when a valid referral context is found in the URL
357
+ * and successfully tracked. Consumers (e.g. `<frak-banner>`) listen for this
358
+ * to display a referral success message.
359
+ */
360
+ declare const REFERRAL_SUCCESS_EVENT = "frak:referral-success";
361
+ /**
362
+ * Process referral context and emit a DOM event on success.
363
+ *
364
+ * - Calls {@link referralInteraction} to detect and track any referral in the URL
365
+ * - On `"success"`, dispatches a bare {@link REFERRAL_SUCCESS_EVENT} on `window`
366
+ * - Silently swallows errors (fire-and-forget during SDK init)
367
+ *
368
+ * @param client - The initialized Frak client
369
+ */
370
+ declare function setupReferral(client: FrakClient): Promise<void>;
371
+ //#endregion
259
372
  //#region src/actions/sendInteraction.d.ts
260
373
  /**
261
374
  * Send an interaction to the backend via the listener RPC.
@@ -322,7 +435,7 @@ declare function sendInteraction(client: FrakClient, params: SendInteractionPara
322
435
  * }
323
436
  *
324
437
  * @remarks
325
- * - Merchant id is resolved in this order: explicit `args.merchantId`, `frak-merchant-id` from session storage, then `fetchMerchantId()`.
438
+ * - Merchant id is resolved in this order: explicit `args.merchantId`, then `sdkConfigStore.resolveMerchantId()` (config store sessionStorage → backend fetch).
326
439
  * - This function supports anonymous users and will use the `x-frak-client-id` header when available.
327
440
  * - At least one identity source must exist (`frak-wallet-interaction-token` or `x-frak-client-id`), otherwise the tracking request is skipped.
328
441
  * - This function will print a warning if used in a non-browser environment or if no identity / merchant id can be resolved.
@@ -380,8 +493,9 @@ type ModalStepBuilder<Steps extends ModalStepTypes[] = ModalStepTypes[]> = {
380
493
  /**
381
494
  * Display the modal
382
495
  * @param metadataOverride - Function returning optional metadata to override the current modal metadata
496
+ * @param placement - Optional placement ID to associate with this modal display
383
497
  */
384
- display: (metadataOverride?: (current?: ModalRpcMetadata) => ModalRpcMetadata | undefined) => Promise<ModalRpcStepsResultType<Steps>>;
498
+ display: (metadataOverride?: (current?: ModalRpcMetadata) => ModalRpcMetadata | undefined, placement?: string) => Promise<ModalRpcStepsResultType<Steps>>;
385
499
  };
386
500
  /**
387
501
  * Represent the output type of the modal builder
@@ -529,4 +643,4 @@ declare function siweAuthenticate(client: FrakClient, {
529
643
  metadata
530
644
  }: SiweAuthenticateModalParams): Promise<SiweAuthenticateReturnType>;
531
645
  //#endregion
532
- export { displayModal as _, ModalBuilder as a, watchWalletStatus as c, referralInteraction as d, ProcessReferralOptions as f, ensureIdentity as g, getMerchantInformation as h, sendTransaction as i, trackPurchaseStatus as l, prepareSso as m, siweAuthenticate as n, ModalStepBuilder as o, processReferral as p, SendTransactionParams as r, modalBuilder as s, SiweAuthenticateModalParams as t, sendInteraction as u, displayEmbeddedWallet as v };
646
+ export { displayEmbeddedWallet as C, displayModal as S, getUserReferralStatus as _, ModalBuilder as a, ensureIdentity as b, watchWalletStatus as c, REFERRAL_SUCCESS_EVENT as d, setupReferral as f, prepareSso as g, processReferral as h, sendTransaction as i, trackPurchaseStatus as l, ProcessReferralOptions as m, siweAuthenticate as n, ModalStepBuilder as o, referralInteraction as p, SendTransactionParams as r, modalBuilder as s, SiweAuthenticateModalParams as t, sendInteraction as u, getMergeToken as v, displaySharingPage as x, getMerchantInformation as y };
@@ -1,13 +1,14 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, E as ModalRpcMetadata, F as SiweAuthenticationParams, H as FinalActionType, I as LoginModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, T as DisplayModalParamsType, U as FinalModalStepType, b as DisplayEmbeddedWalletResultType, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, p as WalletStatusReturnType, v as SendInteractionParamsType, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-B0g7-807.cjs";
1
+ import { A as ModalRpcMetadata, B as LoginModalStepType, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, K as FinalActionType, M as ModalRpcStepsResultType, N as ModalStepTypes, P as SendTransactionModalStepType, R as SiweAuthenticateReturnType, U as PrepareSsoParamsType, W as PrepareSsoReturnType, b as DisplayEmbeddedWalletParamsType, g as GetMerchantInformationReturnType, i as FrakContext, k as DisplayModalParamsType, l as FrakClient, m as UserReferralStatusType, p as WalletStatusReturnType, q as FinalModalStepType, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-BQ-q-_Y9.js";
2
2
 
3
3
  //#region src/actions/displayEmbeddedWallet.d.ts
4
4
  /**
5
5
  * Function used to display the Frak embedded wallet popup
6
6
  * @param client - The current Frak Client
7
7
  * @param params - The parameter used to customise the embedded wallet
8
+ * @param placement - Optional placement ID to associate with this display request
8
9
  * @returns The embedded wallet display result
9
10
  */
10
- declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbeddedWalletParamsType): Promise<DisplayEmbeddedWalletResultType>;
11
+ declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbeddedWalletParamsType, placement?: string): Promise<DisplayEmbeddedWalletResultType>;
11
12
  //#endregion
12
13
  //#region src/actions/displayModal.d.ts
13
14
  /**
@@ -16,6 +17,7 @@ declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbedd
16
17
  * @param args
17
18
  * @param args.steps - The different steps of the modal
18
19
  * @param args.metadata - The metadata for the modal (customization, etc)
20
+ * @param placement - Optional placement ID to associate with this modal display
19
21
  * @returns The result of each modal steps
20
22
  *
21
23
  * @description This function will display a modal to the user with the provided steps and metadata.
@@ -115,7 +117,41 @@ declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbedd
115
117
  declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(client: FrakClient, {
116
118
  steps,
117
119
  metadata
118
- }: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
120
+ }: DisplayModalParamsType<T>, placement?: string): Promise<ModalRpcStepsResultType<T>>;
121
+ //#endregion
122
+ //#region src/actions/displaySharingPage.d.ts
123
+ /**
124
+ * Function used to display a sharing page
125
+ * @param client - The current Frak Client
126
+ * @param params - The parameters to customize the sharing page (products, link override, metadata)
127
+ * @param placement - Optional placement ID to associate with this display request
128
+ * @returns The result indicating the user's action (shared, copied, or dismissed)
129
+ *
130
+ * @description This function will display a full-page sharing UI to the user,
131
+ * showing product info, estimated rewards, sharing steps, FAQ, and share/copy buttons.
132
+ * The sharing link is generated from the user's wallet context + merchant info.
133
+ *
134
+ * @remarks
135
+ * - The promise resolves on the first user action (share or copy) but the page stays visible
136
+ * - The user can continue to share/copy multiple times after the initial resolution
137
+ * - Dismissing the page after a share/copy action is a no-op (promise already resolved)
138
+ * - If the user dismisses without any action, the promise resolves with `{ action: "dismissed" }`
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * const result = await displaySharingPage(frakClient, {
143
+ * products: [
144
+ * {
145
+ * title: "Babies camel cuir velours bout carré",
146
+ * imageUrl: "https://example.com/product.jpg",
147
+ * },
148
+ * ],
149
+ * });
150
+ *
151
+ * console.log("User action:", result.action); // "shared" | "copied" | "dismissed"
152
+ * ```
153
+ */
154
+ declare function displaySharingPage(client: FrakClient, params: DisplaySharingPageParamsType, placement?: string): Promise<DisplaySharingPageResultType>;
119
155
  //#endregion
120
156
  //#region src/actions/ensureIdentity.d.ts
121
157
  /**
@@ -144,13 +180,70 @@ declare function ensureIdentity(interactionToken: string): Promise<void>;
144
180
  //#endregion
145
181
  //#region src/actions/getMerchantInformation.d.ts
146
182
  /**
147
- * Fetch the current merchant information (name, rewards, tiers) from the wallet iframe
183
+ * Fetch the current merchant information (name, rewards, tiers) from the wallet iframe.
184
+ *
185
+ * Results are cached in memory for 30 seconds by default. Concurrent calls
186
+ * while a request is in-flight are deduplicated automatically.
187
+ *
148
188
  * @param client - The current Frak Client
189
+ * @param options - Optional cache configuration
190
+ * @param options.cacheTime - Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
149
191
  * @returns The merchant information including available reward tiers
150
192
  *
151
193
  * @see {@link @frak-labs/core-sdk!index.GetMerchantInformationReturnType | `GetMerchantInformationReturnType`} for the return type shape
152
194
  */
153
- declare function getMerchantInformation(client: FrakClient): Promise<GetMerchantInformationReturnType>;
195
+ declare function getMerchantInformation(client: FrakClient, options?: {
196
+ cacheTime?: number;
197
+ }): Promise<GetMerchantInformationReturnType>;
198
+ //#endregion
199
+ //#region src/actions/getMergeToken.d.ts
200
+ /**
201
+ * Fetch a merge token for the current anonymous identity.
202
+ *
203
+ * Used by in-app browser redirect flows to preserve identity
204
+ * when switching from a WebView to the system browser.
205
+ * The token is appended as `?fmt=` to the redirect URL.
206
+ *
207
+ * Results are cached in memory for 30 seconds by default. Concurrent calls
208
+ * while a request is in-flight are deduplicated automatically.
209
+ *
210
+ * @param client - The current Frak Client
211
+ * @param options - Optional cache configuration
212
+ * @param options.cacheTime - Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
213
+ * @returns The merge token string, or null if unavailable
214
+ */
215
+ declare function getMergeToken(client: FrakClient, options?: {
216
+ cacheTime?: number;
217
+ }): Promise<string | null>;
218
+ //#endregion
219
+ //#region src/actions/getUserReferralStatus.d.ts
220
+ /**
221
+ * Fetch the current user's referral status on the current merchant.
222
+ *
223
+ * The listener resolves the user's identity (via clientId or wallet session)
224
+ * and checks whether a referral link exists where the user is the referee.
225
+ *
226
+ * Results are cached in memory for 30 seconds by default. Concurrent calls
227
+ * while a request is in-flight are deduplicated automatically.
228
+ *
229
+ * Returns `null` when the user's identity cannot be resolved.
230
+ *
231
+ * @param client - The current Frak Client
232
+ * @param options - Optional cache configuration
233
+ * @param options.cacheTime - Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
234
+ * @returns The user's referral status, or `null` if identity cannot be resolved
235
+ *
236
+ * @example
237
+ * ```ts
238
+ * const status = await getUserReferralStatus(client);
239
+ * if (status?.isReferred) {
240
+ * console.log("User was referred to this merchant");
241
+ * }
242
+ * ```
243
+ */
244
+ declare function getUserReferralStatus(client: FrakClient, options?: {
245
+ cacheTime?: number;
246
+ }): Promise<UserReferralStatusType | null>;
154
247
  //#endregion
155
248
  //#region src/actions/prepareSso.d.ts
156
249
  /**
@@ -256,6 +349,26 @@ declare function referralInteraction(client: FrakClient, {
256
349
  options?: ProcessReferralOptions;
257
350
  }): Promise<("idle" | "processing" | "success" | "no-referrer" | "self-referral") | undefined>;
258
351
  //#endregion
352
+ //#region src/actions/referral/setupReferral.d.ts
353
+ /**
354
+ * Custom event name dispatched on successful referral processing.
355
+ *
356
+ * Fired once per page load when a valid referral context is found in the URL
357
+ * and successfully tracked. Consumers (e.g. `<frak-banner>`) listen for this
358
+ * to display a referral success message.
359
+ */
360
+ declare const REFERRAL_SUCCESS_EVENT = "frak:referral-success";
361
+ /**
362
+ * Process referral context and emit a DOM event on success.
363
+ *
364
+ * - Calls {@link referralInteraction} to detect and track any referral in the URL
365
+ * - On `"success"`, dispatches a bare {@link REFERRAL_SUCCESS_EVENT} on `window`
366
+ * - Silently swallows errors (fire-and-forget during SDK init)
367
+ *
368
+ * @param client - The initialized Frak client
369
+ */
370
+ declare function setupReferral(client: FrakClient): Promise<void>;
371
+ //#endregion
259
372
  //#region src/actions/sendInteraction.d.ts
260
373
  /**
261
374
  * Send an interaction to the backend via the listener RPC.
@@ -322,7 +435,7 @@ declare function sendInteraction(client: FrakClient, params: SendInteractionPara
322
435
  * }
323
436
  *
324
437
  * @remarks
325
- * - Merchant id is resolved in this order: explicit `args.merchantId`, `frak-merchant-id` from session storage, then `fetchMerchantId()`.
438
+ * - Merchant id is resolved in this order: explicit `args.merchantId`, then `sdkConfigStore.resolveMerchantId()` (config store sessionStorage → backend fetch).
326
439
  * - This function supports anonymous users and will use the `x-frak-client-id` header when available.
327
440
  * - At least one identity source must exist (`frak-wallet-interaction-token` or `x-frak-client-id`), otherwise the tracking request is skipped.
328
441
  * - This function will print a warning if used in a non-browser environment or if no identity / merchant id can be resolved.
@@ -380,8 +493,9 @@ type ModalStepBuilder<Steps extends ModalStepTypes[] = ModalStepTypes[]> = {
380
493
  /**
381
494
  * Display the modal
382
495
  * @param metadataOverride - Function returning optional metadata to override the current modal metadata
496
+ * @param placement - Optional placement ID to associate with this modal display
383
497
  */
384
- display: (metadataOverride?: (current?: ModalRpcMetadata) => ModalRpcMetadata | undefined) => Promise<ModalRpcStepsResultType<Steps>>;
498
+ display: (metadataOverride?: (current?: ModalRpcMetadata) => ModalRpcMetadata | undefined, placement?: string) => Promise<ModalRpcStepsResultType<Steps>>;
385
499
  };
386
500
  /**
387
501
  * Represent the output type of the modal builder
@@ -529,4 +643,4 @@ declare function siweAuthenticate(client: FrakClient, {
529
643
  metadata
530
644
  }: SiweAuthenticateModalParams): Promise<SiweAuthenticateReturnType>;
531
645
  //#endregion
532
- export { displayModal as _, ModalBuilder as a, watchWalletStatus as c, referralInteraction as d, ProcessReferralOptions as f, ensureIdentity as g, getMerchantInformation as h, sendTransaction as i, trackPurchaseStatus as l, prepareSso as m, siweAuthenticate as n, ModalStepBuilder as o, processReferral as p, SendTransactionParams as r, modalBuilder as s, SiweAuthenticateModalParams as t, sendInteraction as u, displayEmbeddedWallet as v };
646
+ export { displayEmbeddedWallet as C, displayModal as S, getUserReferralStatus as _, ModalBuilder as a, ensureIdentity as b, watchWalletStatus as c, REFERRAL_SUCCESS_EVENT as d, setupReferral as f, prepareSso as g, processReferral as h, sendTransaction as i, trackPurchaseStatus as l, ProcessReferralOptions as m, siweAuthenticate as n, ModalStepBuilder as o, referralInteraction as p, SendTransactionParams as r, modalBuilder as s, SiweAuthenticateModalParams as t, sendInteraction as u, getMergeToken as v, displaySharingPage as x, getMerchantInformation as y };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-Ew5r5zfI.cjs`),t=require(`./setupClient-BduY6Sym.cjs`);exports.DEEP_LINK_SCHEME=t.g,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.a,exports.base64urlDecode=e.h,exports.base64urlEncode=e.g,exports.baseIframeProps=t.i,exports.clearMerchantIdCache=e.n,exports.compressJsonToB64=e.m,exports.computeLegacyProductId=e._,exports.createIFrameFrakClient=t.n,exports.createIframe=t.a,exports.decompressJsonFromB64=e.c,exports.fetchMerchantId=e.r,exports.findIframeInOpener=t.o,exports.formatAmount=t.c,exports.generateSsoUrl=e.p,exports.getBackendUrl=e.l,exports.getClientId=e.v,exports.getCurrencyAmountKey=t.s,exports.getSupportedCurrency=t.u,exports.getSupportedLocale=t.l,exports.isChromiumAndroid=t.f,exports.isFrakDeepLink=t.p,exports.isV1Context=e.o,exports.isV2Context=e.s,exports.locales=t.d,exports.resolveMerchantId=e.i,exports.setupClient=t.t,exports.ssoPopupFeatures=e.d,exports.ssoPopupName=e.f,exports.toAndroidIntentUrl=t.m,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.h;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-B5xo_5K3.cjs`),t=require(`./src-DmYZ4ZLk.cjs`);exports.DEEP_LINK_SCHEME=t.b,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.r,exports.base64urlDecode=e.g,exports.base64urlEncode=e._,exports.baseIframeProps=t.c,exports.clearAllCache=e.s,exports.compressJsonToB64=e.h,exports.computeLegacyProductId=e.v,exports.createIFrameFrakClient=t.n,exports.createIframe=t.l,exports.decompressJsonFromB64=e.o,exports.findIframeInOpener=t.u,exports.formatAmount=t.f,exports.generateSsoUrl=e.m,exports.getBackendUrl=e.u,exports.getCache=e.c,exports.getClientId=e.y,exports.getCurrencyAmountKey=t.d,exports.getSupportedCurrency=t.m,exports.getSupportedLocale=t.p,exports.isChromiumAndroid=t.g,exports.isFrakDeepLink=t._,exports.isIOS=t.a,exports.isInAppBrowser=t.o,exports.isV1Context=e.i,exports.isV2Context=e.a,exports.locales=t.h,exports.mergeAttribution=t.i,exports.redirectToExternalBrowser=t.s,exports.sdkConfigStore=e.n,exports.setupClient=t.t,exports.ssoPopupFeatures=e.f,exports.ssoPopupName=e.p,exports.toAndroidIntentUrl=t.v,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.y,exports.withCache=e.l;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, C as EmbeddedViewActionSharing, D as ModalRpcStepsInput, E as ModalRpcMetadata, F as SiweAuthenticationParams, G as InteractionTypeKey, H as FinalActionType, I as LoginModalStepType, J as Currency, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as LocalizedI18nConfig, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, f as IFrameRpcSchema, g as RewardTier, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, m as EstimatedReward, n as ssoPopupFeatures, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-B0g7-807.cjs";
2
- import { A as getBackendUrl, B as HashProtectedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, I as TrackArrivalParams, L as TrackArrivalResult, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as UtmParams, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as KeyProvider, _ as formatAmount, a as CompressedSsoData, b as isChromiumAndroid, c as clearMerchantIdCache, d as baseIframeProps, f as createIframe, g as getCurrencyAmountKey, h as getSupportedCurrency, i as AppSpecificSsoMetadata, j as LocalesKey, k as getClientId, l as fetchMerchantId, m as getSupportedLocale, n as FrakEvent, o as FullSsoParams, p as findIframeInOpener, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as resolveMerchantId, v as FrakContextManager, w as DEEP_LINK_SCHEME, x as isFrakDeepLink, y as DeepLinkFallbackOptions, z as CompressedData } from "./computeLegacyProductId-CCAZvLa5.cjs";
3
- export { type AppSpecificSsoMetadata, type ClientLifecycleEvent, type CompressedData, type CompressedSsoData, type Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, type DeepLinkFallbackOptions, type DisplayEmbeddedWalletParamsType, type DisplayEmbeddedWalletResultType, type DisplayModalParamsType, type EmbeddedViewActionReferred, type EmbeddedViewActionSharing, type EstimatedReward, type FinalActionType, type FinalModalStepType, type FrakClient, type FrakContext, FrakContextManager, type FrakContextV1, type FrakContextV2, type FrakEvent, type FrakLifecycleEvent, type FrakWalletSdkConfig, type FullSsoParams, type GetMerchantInformationReturnType, type HashProtectedData, type I18nConfig, type IFrameLifecycleEvent, type IFrameRpcSchema, type IFrameTransport, type InteractionTypeKey, type KeyProvider, type Language, type LocalesKey, type LocalizedI18nConfig, type LoggedInEmbeddedView, type LoggedOutEmbeddedView, type LoginModalStepType, type ModalRpcMetadata, type ModalRpcStepsInput, type ModalRpcStepsResultType, type ModalStepMetadata, type ModalStepTypes, type OpenSsoParamsType, type OpenSsoReturnType, type PrepareSsoParamsType, type PrepareSsoReturnType, type RewardTier, type SendInteractionParamsType, type SendTransactionModalStepType, type SendTransactionReturnType, type SendTransactionTxType, type SiweAuthenticateModalStepType, type SiweAuthenticateReturnType, type SiweAuthenticationParams, type SsoMetadata, type TokenAmountType, type TrackArrivalParams, type TrackArrivalResult, type UtmParams, type WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
1
+ import { $ as ResolvedPlacement, A as ModalRpcMetadata, B as LoginModalStepType, C as EmbeddedViewActionReferred, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, G as SsoMetadata, H as OpenSsoReturnType, I as SendTransactionTxType, J as ModalStepMetadata, K as FinalActionType, L as SiweAuthenticateModalStepType, M as ModalRpcStepsResultType, N as ModalStepTypes, O as SharingPageProduct, P as SendTransactionModalStepType, Q as MerchantConfigResponse, R as SiweAuthenticateReturnType, S as LoggedOutEmbeddedView, T as LoggedInEmbeddedView, U as PrepareSsoParamsType, V as OpenSsoParamsType, W as PrepareSsoReturnType, X as IFrameLifecycleEvent, Y as InteractionTypeKey, Z as ClientLifecycleEvent, _ as RewardTier, a as FrakContextV1, at as Language, b as DisplayEmbeddedWalletParamsType, c as isV2Context, ct as AttributionParams, d as IFrameTransport, dt as UtmParams, et as ResolvedSdkConfig, f as IFrameRpcSchema, g as GetMerchantInformationReturnType, h as EstimatedReward, i as FrakContext, it as I18nConfig, j as ModalRpcStepsInput, k as DisplayModalParamsType, l as FrakClient, lt as TrackArrivalParams, m as UserReferralStatusType, n as ssoPopupFeatures, nt as Currency, o as FrakContextV2, ot as LocalizedI18nConfig, p as WalletStatusReturnType, q as FinalModalStepType, r as ssoPopupName, rt as FrakWalletSdkConfig, s as isV1Context, st as AttributionDefaults, tt as SdkResolvedConfig, u as FrakLifecycleEvent, ut as TrackArrivalResult, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-CMBCbhvP.cjs";
2
+ import { A as base64urlDecode, B as DebugInfoGatherer, C as isChromiumAndroid, D as DEEP_LINK_SCHEME, E as triggerDeepLinkWithFallback, F as withCache, H as CompressedData, I as getBackendUrl, L as LocalesKey, M as getClientId, N as clearAllCache, O as decompressJsonFromB64, P as getCache, R as locales, S as DeepLinkFallbackOptions, T as toAndroidIntentUrl, U as HashProtectedData, V as createIFrameFrakClient, W as KeyProvider, _ as getSupportedLocale, a as CompressedSsoData, b as formatAmount, c as sdkConfigStore, d as isIOS, f as isInAppBrowser, g as findIframeInOpener, h as createIframe, i as AppSpecificSsoMetadata, j as base64urlEncode, k as compressJsonToB64, l as MergeAttributionInput, m as baseIframeProps, n as FrakEvent, o as FullSsoParams, p as redirectToExternalBrowser, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as mergeAttribution, v as getSupportedCurrency, w as isFrakDeepLink, x as FrakContextManager, y as getCurrencyAmountKey, z as setupClient } from "./index-BCwGNRmk.cjs";
3
+ export { AppSpecificSsoMetadata, AttributionDefaults, AttributionParams, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, DisplaySharingPageParamsType, DisplaySharingPageResultType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakContextV1, FrakContextV2, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, MerchantConfigResponse, MergeAttributionInput, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ResolvedPlacement, ResolvedSdkConfig, RewardTier, SdkResolvedConfig, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionReturnType, SendTransactionTxType, SharingPageProduct, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UserReferralStatusType, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearAllCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getCache, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isIOS, isInAppBrowser, isV1Context, isV2Context, locales, mergeAttribution, redirectToExternalBrowser, sdkConfigStore, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback, withCache };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, C as EmbeddedViewActionSharing, D as ModalRpcStepsInput, E as ModalRpcMetadata, F as SiweAuthenticationParams, G as InteractionTypeKey, H as FinalActionType, I as LoginModalStepType, J as Currency, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as LocalizedI18nConfig, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, f as IFrameRpcSchema, g as RewardTier, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, m as EstimatedReward, n as ssoPopupFeatures, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-CMzwvaCa.js";
2
- import { A as getBackendUrl, B as HashProtectedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, I as TrackArrivalParams, L as TrackArrivalResult, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as UtmParams, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as KeyProvider, _ as formatAmount, a as CompressedSsoData, b as isChromiumAndroid, c as clearMerchantIdCache, d as baseIframeProps, f as createIframe, g as getCurrencyAmountKey, h as getSupportedCurrency, i as AppSpecificSsoMetadata, j as LocalesKey, k as getClientId, l as fetchMerchantId, m as getSupportedLocale, n as FrakEvent, o as FullSsoParams, p as findIframeInOpener, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as resolveMerchantId, v as FrakContextManager, w as DEEP_LINK_SCHEME, x as isFrakDeepLink, y as DeepLinkFallbackOptions, z as CompressedData } from "./computeLegacyProductId-b5cUWdAm.js";
3
- export { type AppSpecificSsoMetadata, type ClientLifecycleEvent, type CompressedData, type CompressedSsoData, type Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, type DeepLinkFallbackOptions, type DisplayEmbeddedWalletParamsType, type DisplayEmbeddedWalletResultType, type DisplayModalParamsType, type EmbeddedViewActionReferred, type EmbeddedViewActionSharing, type EstimatedReward, type FinalActionType, type FinalModalStepType, type FrakClient, type FrakContext, FrakContextManager, type FrakContextV1, type FrakContextV2, type FrakEvent, type FrakLifecycleEvent, type FrakWalletSdkConfig, type FullSsoParams, type GetMerchantInformationReturnType, type HashProtectedData, type I18nConfig, type IFrameLifecycleEvent, type IFrameRpcSchema, type IFrameTransport, type InteractionTypeKey, type KeyProvider, type Language, type LocalesKey, type LocalizedI18nConfig, type LoggedInEmbeddedView, type LoggedOutEmbeddedView, type LoginModalStepType, type ModalRpcMetadata, type ModalRpcStepsInput, type ModalRpcStepsResultType, type ModalStepMetadata, type ModalStepTypes, type OpenSsoParamsType, type OpenSsoReturnType, type PrepareSsoParamsType, type PrepareSsoReturnType, type RewardTier, type SendInteractionParamsType, type SendTransactionModalStepType, type SendTransactionReturnType, type SendTransactionTxType, type SiweAuthenticateModalStepType, type SiweAuthenticateReturnType, type SiweAuthenticationParams, type SsoMetadata, type TokenAmountType, type TrackArrivalParams, type TrackArrivalResult, type UtmParams, type WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
1
+ import { $ as ResolvedPlacement, A as ModalRpcMetadata, B as LoginModalStepType, C as EmbeddedViewActionReferred, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, G as SsoMetadata, H as OpenSsoReturnType, I as SendTransactionTxType, J as ModalStepMetadata, K as FinalActionType, L as SiweAuthenticateModalStepType, M as ModalRpcStepsResultType, N as ModalStepTypes, O as SharingPageProduct, P as SendTransactionModalStepType, Q as MerchantConfigResponse, R as SiweAuthenticateReturnType, S as LoggedOutEmbeddedView, T as LoggedInEmbeddedView, U as PrepareSsoParamsType, V as OpenSsoParamsType, W as PrepareSsoReturnType, X as IFrameLifecycleEvent, Y as InteractionTypeKey, Z as ClientLifecycleEvent, _ as RewardTier, a as FrakContextV1, at as Language, b as DisplayEmbeddedWalletParamsType, c as isV2Context, ct as AttributionParams, d as IFrameTransport, dt as UtmParams, et as ResolvedSdkConfig, f as IFrameRpcSchema, g as GetMerchantInformationReturnType, h as EstimatedReward, i as FrakContext, it as I18nConfig, j as ModalRpcStepsInput, k as DisplayModalParamsType, l as FrakClient, lt as TrackArrivalParams, m as UserReferralStatusType, n as ssoPopupFeatures, nt as Currency, o as FrakContextV2, ot as LocalizedI18nConfig, p as WalletStatusReturnType, q as FinalModalStepType, r as ssoPopupName, rt as FrakWalletSdkConfig, s as isV1Context, st as AttributionDefaults, tt as SdkResolvedConfig, u as FrakLifecycleEvent, ut as TrackArrivalResult, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-BQ-q-_Y9.js";
2
+ import { A as base64urlDecode, B as DebugInfoGatherer, C as isChromiumAndroid, D as DEEP_LINK_SCHEME, E as triggerDeepLinkWithFallback, F as withCache, H as CompressedData, I as getBackendUrl, L as LocalesKey, M as getClientId, N as clearAllCache, O as decompressJsonFromB64, P as getCache, R as locales, S as DeepLinkFallbackOptions, T as toAndroidIntentUrl, U as HashProtectedData, V as createIFrameFrakClient, W as KeyProvider, _ as getSupportedLocale, a as CompressedSsoData, b as formatAmount, c as sdkConfigStore, d as isIOS, f as isInAppBrowser, g as findIframeInOpener, h as createIframe, i as AppSpecificSsoMetadata, j as base64urlEncode, k as compressJsonToB64, l as MergeAttributionInput, m as baseIframeProps, n as FrakEvent, o as FullSsoParams, p as redirectToExternalBrowser, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as mergeAttribution, v as getSupportedCurrency, w as isFrakDeepLink, x as FrakContextManager, y as getCurrencyAmountKey, z as setupClient } from "./index-BfmJnxzo.js";
3
+ export { AppSpecificSsoMetadata, AttributionDefaults, AttributionParams, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, DisplaySharingPageParamsType, DisplaySharingPageResultType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakContextV1, FrakContextV2, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, MerchantConfigResponse, MergeAttributionInput, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ResolvedPlacement, ResolvedSdkConfig, RewardTier, SdkResolvedConfig, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionReturnType, SendTransactionTxType, SharingPageProduct, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UserReferralStatusType, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearAllCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getCache, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isIOS, isInAppBrowser, isV1Context, isV2Context, locales, mergeAttribution, redirectToExternalBrowser, sdkConfigStore, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback, withCache };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,v as g}from"./trackEvent-CeLFVzZn.js";import{a as _,c as v,d as y,f as b,g as x,h as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M}from"./setupClient-ftmdQ-I8.js";export{x as DEEP_LINK_SCHEME,k as DebugInfoGatherer,t as FrakContextManager,o as base64urlDecode,a as base64urlEncode,C as baseIframeProps,u as clearMerchantIdCache,l as compressJsonToB64,e as computeLegacyProductId,E as createIFrameFrakClient,_ as createIframe,n as decompressJsonFromB64,p as fetchMerchantId,D as findIframeInOpener,v as formatAmount,f as generateSsoUrl,c as getBackendUrl,g as getClientId,A as getCurrencyAmountKey,M as getSupportedCurrency,w as getSupportedLocale,b as isChromiumAndroid,O as isFrakDeepLink,d as isV1Context,m as isV2Context,y as locales,s as resolveMerchantId,j as setupClient,r as ssoPopupFeatures,i as ssoPopupName,T as toAndroidIntentUrl,h as trackEvent,S as triggerDeepLinkWithFallback};
1
+ import{_ as e,a as t,c as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,v as g,y as _}from"./trackEvent-DdykyX0U.js";import{_ as v,a as y,b,c as x,d as S,f as C,g as w,h as T,i as E,l as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P,u as F,v as I,y as L}from"./src-Cx0RZEA3.js";export{b as DEEP_LINK_SCHEME,M as DebugInfoGatherer,f as FrakContextManager,i as base64urlDecode,e as base64urlEncode,x as baseIframeProps,p as clearAllCache,a as compressJsonToB64,g as computeLegacyProductId,k as createIFrameFrakClient,D as createIframe,u as decompressJsonFromB64,F as findIframeInOpener,C as formatAmount,c as generateSsoUrl,h as getBackendUrl,n as getCache,_ as getClientId,S as getCurrencyAmountKey,O as getSupportedCurrency,j as getSupportedLocale,w as isChromiumAndroid,v as isFrakDeepLink,y as isIOS,A as isInAppBrowser,o as isV1Context,t as isV2Context,T as locales,E as mergeAttribution,N as redirectToExternalBrowser,l as sdkConfigStore,P as setupClient,r as ssoPopupFeatures,d as ssoPopupName,I as toAndroidIntentUrl,m as trackEvent,L as triggerDeepLinkWithFallback,s as withCache};