@frak-labs/core-sdk 0.2.1 → 1.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/README.md +1 -2
- package/cdn/bundle.js +3 -3
- package/dist/actions-D4aBXbdp.cjs +1 -0
- package/dist/actions-Dq_uN-wn.js +1 -0
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.cts +3 -3
- package/dist/actions.d.ts +3 -3
- package/dist/actions.js +1 -1
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.d.cts +4 -4
- package/dist/bundle.d.ts +4 -4
- package/dist/bundle.js +1 -1
- package/dist/{computeLegacyProductId-CCAZvLa5.d.cts → index-BV5D9DsW.d.ts} +91 -37
- package/dist/{siweAuthenticate-CnCZ7mok.d.ts → index-BphwTmKA.d.cts} +122 -8
- package/dist/{computeLegacyProductId-b5cUWdAm.d.ts → index-Dwmo109y.d.cts} +91 -37
- package/dist/{siweAuthenticate-CVigMOxz.d.cts → index-_f8EuN_1.d.ts} +122 -8
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{openSso-B0g7-807.d.cts → openSso-BwEK2M98.d.cts} +283 -44
- package/dist/{openSso-CMzwvaCa.d.ts → openSso-C1Wzl5-i.d.ts} +283 -44
- package/dist/src-B1eliIi6.cjs +13 -0
- package/dist/src-C0UH1GsN.js +13 -0
- package/dist/trackEvent-BqJqRZ-u.cjs +1 -0
- package/dist/trackEvent-Bqq4jd6R.js +1 -0
- package/package.json +11 -12
- package/src/actions/displayEmbeddedWallet.ts +6 -2
- package/src/actions/displayModal.ts +6 -2
- package/src/actions/displaySharingPage.ts +49 -0
- package/src/actions/ensureIdentity.ts +2 -2
- package/src/actions/getMerchantInformation.test.ts +13 -1
- package/src/actions/getMerchantInformation.ts +20 -5
- package/src/actions/getMergeToken.ts +33 -0
- package/src/actions/getUserReferralStatus.ts +42 -0
- package/src/actions/index.ts +8 -1
- package/src/actions/referral/setupReferral.test.ts +79 -0
- package/src/actions/referral/setupReferral.ts +32 -0
- package/src/actions/trackPurchaseStatus.test.ts +32 -20
- package/src/actions/trackPurchaseStatus.ts +3 -5
- package/src/actions/wrapper/modalBuilder.test.ts +4 -2
- package/src/actions/wrapper/modalBuilder.ts +6 -8
- package/src/clients/createIFrameFrakClient.ts +151 -27
- package/src/clients/transports/iframeLifecycleManager.test.ts +14 -94
- package/src/clients/transports/iframeLifecycleManager.ts +35 -53
- package/src/index.ts +17 -4
- package/src/stubs/rrweb.ts +9 -0
- package/src/types/config.ts +10 -3
- package/src/types/index.ts +13 -1
- package/src/types/lifecycle/client.ts +22 -27
- package/src/types/lifecycle/iframe.ts +7 -8
- package/src/types/resolvedConfig.ts +128 -0
- package/src/types/rpc/displaySharingPage.ts +82 -0
- package/src/types/rpc/embedded/index.ts +1 -1
- package/src/types/rpc/interaction.ts +4 -0
- package/src/types/rpc/userReferralStatus.ts +20 -0
- package/src/types/rpc.ts +54 -5
- package/src/utils/backendUrl.test.ts +2 -2
- package/src/utils/backendUrl.ts +1 -1
- package/src/utils/cache/index.ts +7 -0
- package/src/utils/cache/lruMap.test.ts +55 -0
- package/src/utils/cache/lruMap.ts +38 -0
- package/src/utils/cache/withCache.test.ts +168 -0
- package/src/utils/cache/withCache.ts +124 -0
- package/src/utils/inAppBrowser.ts +60 -0
- package/src/utils/index.ts +6 -4
- package/src/utils/sdkConfigStore.test.ts +405 -0
- package/src/utils/sdkConfigStore.ts +263 -0
- package/src/utils/sso.ts +3 -7
- package/dist/setupClient-BduY6Sym.cjs +0 -13
- package/dist/setupClient-ftmdQ-I8.js +0 -13
- package/dist/siweAuthenticate-BWmI2_TN.cjs +0 -1
- package/dist/siweAuthenticate-zczqxm0a.js +0 -1
- package/dist/trackEvent-CeLFVzZn.js +0 -1
- package/dist/trackEvent-Ew5r5zfI.cjs +0 -1
- package/src/utils/merchantId.test.ts +0 -653
- package/src/utils/merchantId.ts +0 -143
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { A as
|
|
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-BwEK2M98.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
|
|
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
|
|
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`, `
|
|
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,
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Address, Hex } from "viem";
|
|
1
|
+
import { G as SsoMetadata, Q as MerchantConfigResponse, U as PrepareSsoParamsType, a as FrakContextV1, at as Language, i as FrakContext, l as FrakClient, nt as Currency, o as FrakContextV2, rt as FrakWalletSdkConfig, tt as SdkResolvedConfig, v as TokenAmountType } from "./openSso-BwEK2M98.cjs";
|
|
3
2
|
import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
|
|
3
|
+
import { Address, Hex } from "viem";
|
|
4
4
|
|
|
5
5
|
//#region src/types/compression.d.ts
|
|
6
6
|
/**
|
|
@@ -50,7 +50,7 @@ type TrackArrivalResult = {
|
|
|
50
50
|
* Create a new iframe Frak client
|
|
51
51
|
* @param args
|
|
52
52
|
* @param args.config - The configuration to use for the Frak Wallet SDK.
|
|
53
|
-
* When `config.domain` is set, it is
|
|
53
|
+
* When `config.domain` is set, it is used to resolve the correct merchant config in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
|
|
54
54
|
* @param args.iframe - The iframe to use for the communication
|
|
55
55
|
* @returns The created Frak Client
|
|
56
56
|
*
|
|
@@ -143,6 +143,50 @@ declare const locales: {
|
|
|
143
143
|
*/
|
|
144
144
|
declare function getBackendUrl(walletUrl?: string): string;
|
|
145
145
|
//#endregion
|
|
146
|
+
//#region src/utils/cache/withCache.d.ts
|
|
147
|
+
type WithCacheOptions = {
|
|
148
|
+
/** The key to cache the data against */cacheKey: string; /** Time in ms that cached data will remain valid. Default: 30_000 (30s). Set to 0 to disable caching. */
|
|
149
|
+
cacheTime?: number;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Returns the result of a given promise, and caches the result for
|
|
153
|
+
* subsequent invocations against a provided cache key.
|
|
154
|
+
*
|
|
155
|
+
* Also deduplicates concurrent calls — if multiple callers request the same
|
|
156
|
+
* cache key while the promise is pending, they share the same promise.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* // First call fetches, subsequent calls return cached data for 30s
|
|
161
|
+
* const data = await withCache(
|
|
162
|
+
* () => client.request({ method: "frak_getMerchantInformation" }),
|
|
163
|
+
* { cacheKey: "merchantInfo", cacheTime: 30_000 }
|
|
164
|
+
* );
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
declare function withCache<TData>(fn: () => Promise<TData>, {
|
|
168
|
+
cacheKey,
|
|
169
|
+
cacheTime
|
|
170
|
+
}: WithCacheOptions): Promise<TData>;
|
|
171
|
+
/**
|
|
172
|
+
* Get a cache handle for a specific key, useful for manual invalidation.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* // Invalidate merchant info cache after a mutation
|
|
177
|
+
* getCache("frak_getMerchantInformation").clear();
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
declare function getCache(cacheKey: string): {
|
|
181
|
+
/** Clear both the pending promise and the cached response */clear: () => void; /** Check if a non-expired response exists */
|
|
182
|
+
has: (cacheTime?: number) => boolean;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Clear all cached data (both pending promises and resolved responses).
|
|
186
|
+
* Called automatically when the client is destroyed.
|
|
187
|
+
*/
|
|
188
|
+
declare function clearAllCache(): void;
|
|
189
|
+
//#endregion
|
|
146
190
|
//#region src/utils/clientId.d.ts
|
|
147
191
|
/**
|
|
148
192
|
* Client ID utilities for anonymous tracking
|
|
@@ -415,47 +459,57 @@ declare function createIframe({
|
|
|
415
459
|
*/
|
|
416
460
|
declare function findIframeInOpener(pathname?: string): Window | null;
|
|
417
461
|
//#endregion
|
|
418
|
-
//#region src/utils/
|
|
419
|
-
/**
|
|
420
|
-
* Merchant ID utilities for auto-fetching from backend
|
|
421
|
-
*/
|
|
462
|
+
//#region src/utils/inAppBrowser.d.ts
|
|
422
463
|
/**
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* @param domain - The domain to lookup (defaults to current hostname)
|
|
426
|
-
* @param walletUrl - Optional wallet URL to derive backend URL
|
|
427
|
-
* @returns The merchantId if found, undefined otherwise
|
|
428
|
-
*
|
|
429
|
-
* @example
|
|
430
|
-
* ```ts
|
|
431
|
-
* const merchantId = await fetchMerchantId("shop.example.com");
|
|
432
|
-
* if (merchantId) {
|
|
433
|
-
* // Use merchantId for tracking
|
|
434
|
-
* }
|
|
435
|
-
* ```
|
|
464
|
+
* Whether the current device runs iOS (including iPadOS 13+).
|
|
436
465
|
*/
|
|
437
|
-
declare
|
|
466
|
+
declare const isIOS: boolean;
|
|
438
467
|
/**
|
|
439
|
-
*
|
|
440
|
-
*
|
|
468
|
+
* Whether the current browser is a social media in-app browser
|
|
469
|
+
* (Instagram, Facebook).
|
|
441
470
|
*/
|
|
442
|
-
declare
|
|
471
|
+
declare const isInAppBrowser: boolean;
|
|
443
472
|
/**
|
|
444
|
-
*
|
|
473
|
+
* Redirect to external browser from in-app WebView.
|
|
474
|
+
*
|
|
475
|
+
* - **iOS**: Uses `x-safari-https://` scheme — server-side 302 redirects
|
|
476
|
+
* to custom URL schemes are silently swallowed by WKWebView.
|
|
477
|
+
* Direct `window.location.href` assignment works (confirmed iOS 17+).
|
|
445
478
|
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
479
|
+
* - **Android**: Uses backend `/common/social` endpoint which returns a PDF
|
|
480
|
+
* Content-Type response, forcing the WebView to hand off to the default browser.
|
|
481
|
+
*
|
|
482
|
+
* @param targetUrl - The URL to open in the external browser
|
|
449
483
|
*/
|
|
450
|
-
declare function
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
484
|
+
declare function redirectToExternalBrowser(targetUrl: string): void;
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/utils/sdkConfigStore.d.ts
|
|
487
|
+
declare const GLOBAL_KEY = "__frakSdkConfig";
|
|
488
|
+
declare global {
|
|
489
|
+
interface Window {
|
|
490
|
+
[GLOBAL_KEY]?: SdkResolvedConfig;
|
|
491
|
+
}
|
|
492
|
+
interface WindowEventMap {
|
|
493
|
+
"frak:config": CustomEvent<SdkResolvedConfig>;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
declare function getConfig(): SdkResolvedConfig;
|
|
497
|
+
declare const sdkConfigStore: {
|
|
498
|
+
getConfig: typeof getConfig;
|
|
499
|
+
readonly isResolved: boolean;
|
|
500
|
+
readonly isCacheFresh: boolean;
|
|
501
|
+
setCacheScope(domain: string, lang?: string): void;
|
|
502
|
+
setConfig(config: SdkResolvedConfig): void;
|
|
503
|
+
reset(): void;
|
|
504
|
+
clearCache(): void;
|
|
505
|
+
resolve(domain?: string, walletUrl?: string, lang?: Language): Promise<MerchantConfigResponse | undefined>;
|
|
506
|
+
getMerchantId(): string | undefined;
|
|
507
|
+
resolveMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
|
|
508
|
+
};
|
|
455
509
|
//#endregion
|
|
456
510
|
//#region src/utils/sso.d.ts
|
|
457
511
|
type AppSpecificSsoMetadata = SsoMetadata & {
|
|
458
|
-
name
|
|
512
|
+
name?: string;
|
|
459
513
|
css?: string;
|
|
460
514
|
};
|
|
461
515
|
/**
|
|
@@ -489,7 +543,7 @@ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
|
|
|
489
543
|
* // Returns: https://wallet.frak.id/sso?p=<compressed_base64>
|
|
490
544
|
* ```
|
|
491
545
|
*/
|
|
492
|
-
declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string, clientId: string, css?: string): string;
|
|
546
|
+
declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string | undefined, clientId: string, css?: string): string;
|
|
493
547
|
/**
|
|
494
548
|
* Type of compressed the sso data
|
|
495
549
|
*/
|
|
@@ -501,7 +555,7 @@ type CompressedSsoData = {
|
|
|
501
555
|
l?: "en" | "fr";
|
|
502
556
|
m: string;
|
|
503
557
|
md: {
|
|
504
|
-
n
|
|
558
|
+
n?: string;
|
|
505
559
|
css?: string;
|
|
506
560
|
l?: string;
|
|
507
561
|
h?: string;
|
|
@@ -534,4 +588,4 @@ declare function computeLegacyProductId({
|
|
|
534
588
|
domain?: string;
|
|
535
589
|
}): `0x${string}`;
|
|
536
590
|
//#endregion
|
|
537
|
-
export {
|
|
591
|
+
export { getClientId as A, TrackArrivalParams as B, toAndroidIntentUrl as C, compressJsonToB64 as D, decompressJsonFromB64 as E, LocalesKey as F, KeyProvider as G, UtmParams as H, locales as I, setupClient as L, getCache as M, withCache as N, base64urlDecode as O, getBackendUrl as P, DebugInfoGatherer as R, isFrakDeepLink as S, DEEP_LINK_SCHEME as T, CompressedData as U, TrackArrivalResult as V, HashProtectedData as W, getCurrencyAmountKey as _, CompressedSsoData as a, DeepLinkFallbackOptions as b, sdkConfigStore as c, redirectToExternalBrowser as d, baseIframeProps as f, getSupportedCurrency as g, getSupportedLocale as h, AppSpecificSsoMetadata as i, clearAllCache as j, base64urlEncode as k, isIOS as l, findIframeInOpener as m, FrakEvent as n, FullSsoParams as o, createIframe as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, isInAppBrowser as u, formatAmount as v, triggerDeepLinkWithFallback as w, isChromiumAndroid as x, FrakContextManager as y, createIFrameFrakClient as z };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { A as
|
|
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-C1Wzl5-i.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
|
|
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
|
|
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`, `
|
|
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,
|
|
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-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-BqJqRZ-u.cjs`),t=require(`./src-B1eliIi6.cjs`);exports.DEEP_LINK_SCHEME=t.y,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.r,exports.base64urlDecode=e.g,exports.base64urlEncode=e._,exports.baseIframeProps=t.s,exports.clearAllCache=e.s,exports.compressJsonToB64=e.h,exports.computeLegacyProductId=e.v,exports.createIFrameFrakClient=t.n,exports.createIframe=t.c,exports.decompressJsonFromB64=e.o,exports.findIframeInOpener=t.l,exports.formatAmount=t.d,exports.generateSsoUrl=e.m,exports.getBackendUrl=e.u,exports.getCache=e.c,exports.getClientId=e.y,exports.getCurrencyAmountKey=t.u,exports.getSupportedCurrency=t.p,exports.getSupportedLocale=t.f,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.isIOS=t.i,exports.isInAppBrowser=t.a,exports.isV1Context=e.i,exports.isV2Context=e.a,exports.locales=t.m,exports.redirectToExternalBrowser=t.o,exports.sdkConfigStore=e.n,exports.setupClient=t.t,exports.ssoPopupFeatures=e.f,exports.ssoPopupName=e.p,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.v,exports.withCache=e.l;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
3
|
-
export {
|
|
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, d as IFrameTransport, 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, 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, tt as SdkResolvedConfig, u as FrakLifecycleEvent, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-BwEK2M98.cjs";
|
|
2
|
+
import { A as getClientId, B as TrackArrivalParams, C as toAndroidIntentUrl, D as compressJsonToB64, E as decompressJsonFromB64, F as LocalesKey, G as KeyProvider, H as UtmParams, I as locales, L as setupClient, M as getCache, N as withCache, O as base64urlDecode, P as getBackendUrl, R as DebugInfoGatherer, S as isFrakDeepLink, T as DEEP_LINK_SCHEME, U as CompressedData, V as TrackArrivalResult, W as HashProtectedData, _ as getCurrencyAmountKey, a as CompressedSsoData, b as DeepLinkFallbackOptions, c as sdkConfigStore, d as redirectToExternalBrowser, f as baseIframeProps, g as getSupportedCurrency, h as getSupportedLocale, i as AppSpecificSsoMetadata, j as clearAllCache, k as base64urlEncode, l as isIOS, m as findIframeInOpener, n as FrakEvent, o as FullSsoParams, p as createIframe, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as isInAppBrowser, v as formatAmount, w as triggerDeepLinkWithFallback, x as isChromiumAndroid, y as FrakContextManager, z as createIFrameFrakClient } from "./index-Dwmo109y.cjs";
|
|
3
|
+
export { AppSpecificSsoMetadata, 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, 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, redirectToExternalBrowser, sdkConfigStore, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback, withCache };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
3
|
-
export {
|
|
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, d as IFrameTransport, 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, 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, tt as SdkResolvedConfig, u as FrakLifecycleEvent, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-C1Wzl5-i.js";
|
|
2
|
+
import { A as getClientId, B as TrackArrivalParams, C as toAndroidIntentUrl, D as compressJsonToB64, E as decompressJsonFromB64, F as LocalesKey, G as KeyProvider, H as UtmParams, I as locales, L as setupClient, M as getCache, N as withCache, O as base64urlDecode, P as getBackendUrl, R as DebugInfoGatherer, S as isFrakDeepLink, T as DEEP_LINK_SCHEME, U as CompressedData, V as TrackArrivalResult, W as HashProtectedData, _ as getCurrencyAmountKey, a as CompressedSsoData, b as DeepLinkFallbackOptions, c as sdkConfigStore, d as redirectToExternalBrowser, f as baseIframeProps, g as getSupportedCurrency, h as getSupportedLocale, i as AppSpecificSsoMetadata, j as clearAllCache, k as base64urlEncode, l as isIOS, m as findIframeInOpener, n as FrakEvent, o as FullSsoParams, p as createIframe, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as isInAppBrowser, v as formatAmount, w as triggerDeepLinkWithFallback, x as isChromiumAndroid, y as FrakContextManager, z as createIFrameFrakClient } from "./index-BV5D9DsW.js";
|
|
3
|
+
export { AppSpecificSsoMetadata, 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, 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, redirectToExternalBrowser, sdkConfigStore, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback, withCache };
|