@frak-labs/core-sdk 0.1.1-beta.4dfea079 → 0.1.1-beta.caa04eda
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.d.cts +1 -1
- package/dist/actions.d.ts +1 -1
- package/dist/bundle.d.cts +2 -2
- package/dist/bundle.d.ts +2 -2
- package/dist/{computeLegacyProductId-WbD1gXV9.d.ts → computeLegacyProductId-DwVnZDGV.d.ts} +20 -2
- package/dist/{computeLegacyProductId-CscYhyUi.d.cts → computeLegacyProductId-Qt-DXyeo.d.cts} +20 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{siweAuthenticate-CR4Dpji6.d.cts → siweAuthenticate-BC-2Nm4i.d.cts} +8 -0
- package/dist/{siweAuthenticate-udoruuy9.d.ts → siweAuthenticate-DnLK9fre.d.ts} +8 -0
- package/package.json +2 -2
- package/src/actions/displayEmbeddedWallet.ts +1 -0
- package/src/actions/getMerchantInformation.ts +7 -0
- package/src/clients/createIFrameFrakClient.ts +2 -1
- package/src/clients/transports/iframeLifecycleManager.ts +9 -1
- package/src/utils/formatAmount.ts +6 -0
- package/src/utils/sso.ts +2 -1
- package/src/utils/trackEvent.ts +10 -0
package/dist/actions.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as openSso } from "./openSso-CC1-loUk.cjs";
|
|
2
|
-
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-
|
|
2
|
+
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-BC-2Nm4i.cjs";
|
|
3
3
|
export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, getMerchantInformation, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
|
package/dist/actions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as openSso } from "./openSso-tkqaDQLV.js";
|
|
2
|
-
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-
|
|
2
|
+
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-DnLK9fre.js";
|
|
3
3
|
export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, getMerchantInformation, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
|
package/dist/bundle.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { A as SiweAuthenticateReturnType, B as ModalStepMetadata, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, G as FrakWalletSdkConfig, H as IFrameLifecycleEvent, I as PrepareSsoReturnType, J as LocalizedI18nConfig, K as I18nConfig, L as SsoMetadata, M as LoginModalStepType, N as OpenSsoParamsType, O as SendTransactionTxType, P as OpenSsoReturnType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, U as ClientLifecycleEvent, V as InteractionTypeKey, W as Currency, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as GetMerchantInformationReturnType, f as RewardTier, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as SendInteractionParamsType, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as TokenAmountType, q as Language, r as ssoPopupName, s as IFrameTransport, t as openSso, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-CC1-loUk.cjs";
|
|
2
|
-
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-
|
|
3
|
-
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-
|
|
2
|
+
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-Qt-DXyeo.cjs";
|
|
3
|
+
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-BC-2Nm4i.cjs";
|
|
4
4
|
export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, RewardTier, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalInternalParams, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, resolveMerchantId, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
|
package/dist/bundle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { A as SiweAuthenticateReturnType, B as ModalStepMetadata, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, G as FrakWalletSdkConfig, H as IFrameLifecycleEvent, I as PrepareSsoReturnType, J as LocalizedI18nConfig, K as I18nConfig, L as SsoMetadata, M as LoginModalStepType, N as OpenSsoParamsType, O as SendTransactionTxType, P as OpenSsoReturnType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, U as ClientLifecycleEvent, V as InteractionTypeKey, W as Currency, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as GetMerchantInformationReturnType, f as RewardTier, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as SendInteractionParamsType, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as TokenAmountType, q as Language, r as ssoPopupName, s as IFrameTransport, t as openSso, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-tkqaDQLV.js";
|
|
2
|
-
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-
|
|
3
|
-
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-
|
|
2
|
+
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-DwVnZDGV.js";
|
|
3
|
+
import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction } from "./siweAuthenticate-DnLK9fre.js";
|
|
4
4
|
export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, RewardTier, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalInternalParams, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, resolveMerchantId, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
|
|
@@ -78,7 +78,8 @@ type TrackArrivalInternalParams = TrackArrivalParams & {
|
|
|
78
78
|
/**
|
|
79
79
|
* Create a new iframe Frak client
|
|
80
80
|
* @param args
|
|
81
|
-
* @param args.config - The configuration to use for the Frak Wallet SDK
|
|
81
|
+
* @param args.config - The configuration to use for the Frak Wallet SDK.
|
|
82
|
+
* When `config.domain` is set, it is forwarded to the iframe handshake so the listener resolves the correct merchant in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
|
|
82
83
|
* @param args.iframe - The iframe to use for the communication
|
|
83
84
|
* @returns The created Frak Client
|
|
84
85
|
*
|
|
@@ -333,6 +334,12 @@ declare const FrakContextManager: {
|
|
|
333
334
|
};
|
|
334
335
|
//#endregion
|
|
335
336
|
//#region src/utils/formatAmount.d.ts
|
|
337
|
+
/**
|
|
338
|
+
* Format a numeric amount as a localized currency string
|
|
339
|
+
* @param amount - The raw numeric amount to format
|
|
340
|
+
* @param currency - Optional currency config; defaults to EUR/fr-FR when omitted
|
|
341
|
+
* @returns Localized currency string (e.g. "1 500 €", "$1,500")
|
|
342
|
+
*/
|
|
336
343
|
declare function formatAmount(amount: number, currency?: Currency): string;
|
|
337
344
|
//#endregion
|
|
338
345
|
//#region src/utils/getCurrencyAmountKey.d.ts
|
|
@@ -471,9 +478,10 @@ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
|
|
|
471
478
|
*
|
|
472
479
|
* @param walletUrl - Base wallet URL (e.g., "https://wallet.frak.id")
|
|
473
480
|
* @param params - SSO parameters
|
|
474
|
-
* @param
|
|
481
|
+
* @param merchantId - Merchant identifier
|
|
475
482
|
* @param name - Application name
|
|
476
483
|
* @param css - Optional custom CSS
|
|
484
|
+
* @param clientId - Optional client identifier (auto-generated if omitted)
|
|
477
485
|
* @returns Complete SSO URL ready to open in popup or redirect
|
|
478
486
|
*
|
|
479
487
|
* @example
|
|
@@ -507,8 +515,18 @@ type CompressedSsoData = {
|
|
|
507
515
|
};
|
|
508
516
|
//#endregion
|
|
509
517
|
//#region src/utils/trackEvent.d.ts
|
|
518
|
+
/**
|
|
519
|
+
* Analytics event names emitted by the SDK
|
|
520
|
+
*/
|
|
510
521
|
type FrakEvent = "share_button_clicked" | "wallet_button_clicked" | "open_in_app_clicked" | "open_in_app_login_clicked" | "app_not_installed" | "share_modal_error" | "user_referred_started" | "user_referred_completed" | "user_referred_error";
|
|
511
522
|
type EventProps = Record<string, unknown>;
|
|
523
|
+
/**
|
|
524
|
+
* Track an analytics event via OpenPanel.
|
|
525
|
+
* Fire-and-forget: silently catches errors.
|
|
526
|
+
* @param client - The Frak client instance (no-op if undefined)
|
|
527
|
+
* @param event - The event name to track
|
|
528
|
+
* @param props - Optional event properties
|
|
529
|
+
*/
|
|
512
530
|
declare function trackEvent(client: FrakClient | undefined, event: FrakEvent, props?: EventProps): void;
|
|
513
531
|
//#endregion
|
|
514
532
|
//#region src/utils/computeLegacyProductId.d.ts
|
package/dist/{computeLegacyProductId-CscYhyUi.d.cts → computeLegacyProductId-Qt-DXyeo.d.cts}
RENAMED
|
@@ -78,7 +78,8 @@ type TrackArrivalInternalParams = TrackArrivalParams & {
|
|
|
78
78
|
/**
|
|
79
79
|
* Create a new iframe Frak client
|
|
80
80
|
* @param args
|
|
81
|
-
* @param args.config - The configuration to use for the Frak Wallet SDK
|
|
81
|
+
* @param args.config - The configuration to use for the Frak Wallet SDK.
|
|
82
|
+
* When `config.domain` is set, it is forwarded to the iframe handshake so the listener resolves the correct merchant in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
|
|
82
83
|
* @param args.iframe - The iframe to use for the communication
|
|
83
84
|
* @returns The created Frak Client
|
|
84
85
|
*
|
|
@@ -333,6 +334,12 @@ declare const FrakContextManager: {
|
|
|
333
334
|
};
|
|
334
335
|
//#endregion
|
|
335
336
|
//#region src/utils/formatAmount.d.ts
|
|
337
|
+
/**
|
|
338
|
+
* Format a numeric amount as a localized currency string
|
|
339
|
+
* @param amount - The raw numeric amount to format
|
|
340
|
+
* @param currency - Optional currency config; defaults to EUR/fr-FR when omitted
|
|
341
|
+
* @returns Localized currency string (e.g. "1 500 €", "$1,500")
|
|
342
|
+
*/
|
|
336
343
|
declare function formatAmount(amount: number, currency?: Currency): string;
|
|
337
344
|
//#endregion
|
|
338
345
|
//#region src/utils/getCurrencyAmountKey.d.ts
|
|
@@ -471,9 +478,10 @@ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
|
|
|
471
478
|
*
|
|
472
479
|
* @param walletUrl - Base wallet URL (e.g., "https://wallet.frak.id")
|
|
473
480
|
* @param params - SSO parameters
|
|
474
|
-
* @param
|
|
481
|
+
* @param merchantId - Merchant identifier
|
|
475
482
|
* @param name - Application name
|
|
476
483
|
* @param css - Optional custom CSS
|
|
484
|
+
* @param clientId - Optional client identifier (auto-generated if omitted)
|
|
477
485
|
* @returns Complete SSO URL ready to open in popup or redirect
|
|
478
486
|
*
|
|
479
487
|
* @example
|
|
@@ -507,8 +515,18 @@ type CompressedSsoData = {
|
|
|
507
515
|
};
|
|
508
516
|
//#endregion
|
|
509
517
|
//#region src/utils/trackEvent.d.ts
|
|
518
|
+
/**
|
|
519
|
+
* Analytics event names emitted by the SDK
|
|
520
|
+
*/
|
|
510
521
|
type FrakEvent = "share_button_clicked" | "wallet_button_clicked" | "open_in_app_clicked" | "open_in_app_login_clicked" | "app_not_installed" | "share_modal_error" | "user_referred_started" | "user_referred_completed" | "user_referred_error";
|
|
511
522
|
type EventProps = Record<string, unknown>;
|
|
523
|
+
/**
|
|
524
|
+
* Track an analytics event via OpenPanel.
|
|
525
|
+
* Fire-and-forget: silently catches errors.
|
|
526
|
+
* @param client - The Frak client instance (no-op if undefined)
|
|
527
|
+
* @param event - The event name to track
|
|
528
|
+
* @param props - Optional event properties
|
|
529
|
+
*/
|
|
512
530
|
declare function trackEvent(client: FrakClient | undefined, event: FrakEvent, props?: EventProps): void;
|
|
513
531
|
//#endregion
|
|
514
532
|
//#region src/utils/computeLegacyProductId.d.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { A as SiweAuthenticateReturnType, B as ModalStepMetadata, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, G as FrakWalletSdkConfig, H as IFrameLifecycleEvent, I as PrepareSsoReturnType, J as LocalizedI18nConfig, K as I18nConfig, L as SsoMetadata, M as LoginModalStepType, N as OpenSsoParamsType, O as SendTransactionTxType, P as OpenSsoReturnType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, U as ClientLifecycleEvent, V as InteractionTypeKey, W as Currency, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as GetMerchantInformationReturnType, f as RewardTier, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as SendInteractionParamsType, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as TokenAmountType, q as Language, r as ssoPopupName, s as IFrameTransport, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-CC1-loUk.cjs";
|
|
2
|
-
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-
|
|
2
|
+
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-Qt-DXyeo.cjs";
|
|
3
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 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 TrackArrivalInternalParams, 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, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { A as SiweAuthenticateReturnType, B as ModalStepMetadata, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, G as FrakWalletSdkConfig, H as IFrameLifecycleEvent, I as PrepareSsoReturnType, J as LocalizedI18nConfig, K as I18nConfig, L as SsoMetadata, M as LoginModalStepType, N as OpenSsoParamsType, O as SendTransactionTxType, P as OpenSsoReturnType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, U as ClientLifecycleEvent, V as InteractionTypeKey, W as Currency, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as GetMerchantInformationReturnType, f as RewardTier, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as SendInteractionParamsType, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as TokenAmountType, q as Language, r as ssoPopupName, s as IFrameTransport, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-tkqaDQLV.js";
|
|
2
|
-
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-
|
|
2
|
+
import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-DwVnZDGV.js";
|
|
3
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 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 TrackArrivalInternalParams, 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, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
|
|
@@ -5,6 +5,7 @@ import { A as SiweAuthenticateReturnType, D as SendTransactionReturnType, E as S
|
|
|
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
|
+
* @returns The embedded wallet display result
|
|
8
9
|
*/
|
|
9
10
|
declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbeddedWalletParamsType): Promise<DisplayEmbeddedWalletResultType>;
|
|
10
11
|
//#endregion
|
|
@@ -117,6 +118,13 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
|
|
|
117
118
|
}: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
|
|
118
119
|
//#endregion
|
|
119
120
|
//#region src/actions/getMerchantInformation.d.ts
|
|
121
|
+
/**
|
|
122
|
+
* Fetch the current merchant information (name, rewards, tiers) from the wallet iframe
|
|
123
|
+
* @param client - The current Frak Client
|
|
124
|
+
* @returns The merchant information including available reward tiers
|
|
125
|
+
*
|
|
126
|
+
* @see {@link @frak-labs/core-sdk!index.GetMerchantInformationReturnType | `GetMerchantInformationReturnType`} for the return type shape
|
|
127
|
+
*/
|
|
120
128
|
declare function getMerchantInformation(client: FrakClient): Promise<GetMerchantInformationReturnType>;
|
|
121
129
|
//#endregion
|
|
122
130
|
//#region src/actions/prepareSso.d.ts
|
|
@@ -5,6 +5,7 @@ import { A as SiweAuthenticateReturnType, D as SendTransactionReturnType, E as S
|
|
|
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
|
+
* @returns The embedded wallet display result
|
|
8
9
|
*/
|
|
9
10
|
declare function displayEmbeddedWallet(client: FrakClient, params: DisplayEmbeddedWalletParamsType): Promise<DisplayEmbeddedWalletResultType>;
|
|
10
11
|
//#endregion
|
|
@@ -117,6 +118,13 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
|
|
|
117
118
|
}: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
|
|
118
119
|
//#endregion
|
|
119
120
|
//#region src/actions/getMerchantInformation.d.ts
|
|
121
|
+
/**
|
|
122
|
+
* Fetch the current merchant information (name, rewards, tiers) from the wallet iframe
|
|
123
|
+
* @param client - The current Frak Client
|
|
124
|
+
* @returns The merchant information including available reward tiers
|
|
125
|
+
*
|
|
126
|
+
* @see {@link @frak-labs/core-sdk!index.GetMerchantInformationReturnType | `GetMerchantInformationReturnType`} for the return type shape
|
|
127
|
+
*/
|
|
120
128
|
declare function getMerchantInformation(client: FrakClient): Promise<GetMerchantInformationReturnType>;
|
|
121
129
|
//#endregion
|
|
122
130
|
//#region src/actions/prepareSso.d.ts
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.1.1-beta.
|
|
14
|
+
"version": "0.1.1-beta.caa04eda",
|
|
15
15
|
"description": "Core SDK of the Frak wallet, low level library to interact directly with the frak ecosystem.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"viem": "^2.x"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@frak-labs/frame-connector": "0.1.0-beta.
|
|
94
|
+
"@frak-labs/frame-connector": "0.1.0-beta.caa04eda",
|
|
95
95
|
"@openpanel/web": "^1.0.7"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
* Function used to display the Frak embedded wallet popup
|
|
9
9
|
* @param client - The current Frak Client
|
|
10
10
|
* @param params - The parameter used to customise the embedded wallet
|
|
11
|
+
* @returns The embedded wallet display result
|
|
11
12
|
*/
|
|
12
13
|
export async function displayEmbeddedWallet(
|
|
13
14
|
client: FrakClient,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { FrakClient, GetMerchantInformationReturnType } from "../types";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Fetch the current merchant information (name, rewards, tiers) from the wallet iframe
|
|
5
|
+
* @param client - The current Frak Client
|
|
6
|
+
* @returns The merchant information including available reward tiers
|
|
7
|
+
*
|
|
8
|
+
* @see {@link @frak-labs/core-sdk!index.GetMerchantInformationReturnType | `GetMerchantInformationReturnType`} for the return type shape
|
|
9
|
+
*/
|
|
3
10
|
export async function getMerchantInformation(
|
|
4
11
|
client: FrakClient
|
|
5
12
|
): Promise<GetMerchantInformationReturnType> {
|
|
@@ -23,7 +23,8 @@ type SdkRpcClient = RpcClient<IFrameRpcSchema, FrakLifecycleEvent>;
|
|
|
23
23
|
/**
|
|
24
24
|
* Create a new iframe Frak client
|
|
25
25
|
* @param args
|
|
26
|
-
* @param args.config - The configuration to use for the Frak Wallet SDK
|
|
26
|
+
* @param args.config - The configuration to use for the Frak Wallet SDK.
|
|
27
|
+
* When `config.domain` is set, it is forwarded to the iframe handshake so the listener resolves the correct merchant in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
|
|
27
28
|
* @param args.iframe - The iframe to use for the communication
|
|
28
29
|
* @returns The created Frak Client
|
|
29
30
|
*
|
|
@@ -26,7 +26,11 @@ function handleBackup(backup: string | undefined): void {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Handle handshake with iframe
|
|
29
|
+
* Handle handshake with iframe — sends client metadata so the listener can resolve the correct merchant
|
|
30
|
+
* @param iframe - The iframe element to post the handshake response to
|
|
31
|
+
* @param token - The handshake token received from the iframe
|
|
32
|
+
* @param targetOrigin - The target origin for postMessage security
|
|
33
|
+
* @param configDomain - Optional override domain for merchant resolution in tunneled/proxied environments
|
|
30
34
|
*/
|
|
31
35
|
function handleHandshake(
|
|
32
36
|
iframe: HTMLIFrameElement,
|
|
@@ -113,6 +117,10 @@ function handleRedirect(
|
|
|
113
117
|
|
|
114
118
|
/**
|
|
115
119
|
* Create a new iframe lifecycle handler
|
|
120
|
+
* @param args
|
|
121
|
+
* @param args.iframe - The iframe element used for wallet communication
|
|
122
|
+
* @param args.targetOrigin - The wallet URL origin for postMessage security
|
|
123
|
+
* @param args.configDomain - Optional domain override forwarded during handshake for tunneled/proxied environments
|
|
116
124
|
* @ignore
|
|
117
125
|
*/
|
|
118
126
|
export function createIFrameLifecycleManager({
|
|
@@ -2,6 +2,12 @@ import type { Currency } from "../types";
|
|
|
2
2
|
import { getSupportedCurrency } from "./getSupportedCurrency";
|
|
3
3
|
import { getSupportedLocale } from "./getSupportedLocale";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Format a numeric amount as a localized currency string
|
|
7
|
+
* @param amount - The raw numeric amount to format
|
|
8
|
+
* @param currency - Optional currency config; defaults to EUR/fr-FR when omitted
|
|
9
|
+
* @returns Localized currency string (e.g. "1 500 €", "$1,500")
|
|
10
|
+
*/
|
|
5
11
|
export function formatAmount(amount: number, currency?: Currency) {
|
|
6
12
|
// Get the supported locale (e.g. "fr-FR")
|
|
7
13
|
const supportedLocale = getSupportedLocale(currency);
|
package/src/utils/sso.ts
CHANGED
|
@@ -23,9 +23,10 @@ export type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
|
|
|
23
23
|
*
|
|
24
24
|
* @param walletUrl - Base wallet URL (e.g., "https://wallet.frak.id")
|
|
25
25
|
* @param params - SSO parameters
|
|
26
|
-
* @param
|
|
26
|
+
* @param merchantId - Merchant identifier
|
|
27
27
|
* @param name - Application name
|
|
28
28
|
* @param css - Optional custom CSS
|
|
29
|
+
* @param clientId - Optional client identifier (auto-generated if omitted)
|
|
29
30
|
* @returns Complete SSO URL ready to open in popup or redirect
|
|
30
31
|
*
|
|
31
32
|
* @example
|
package/src/utils/trackEvent.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { FrakClient } from "../types";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Analytics event names emitted by the SDK
|
|
5
|
+
*/
|
|
3
6
|
export type FrakEvent =
|
|
4
7
|
| "share_button_clicked"
|
|
5
8
|
| "wallet_button_clicked"
|
|
@@ -13,6 +16,13 @@ export type FrakEvent =
|
|
|
13
16
|
|
|
14
17
|
type EventProps = Record<string, unknown>;
|
|
15
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Track an analytics event via OpenPanel.
|
|
21
|
+
* Fire-and-forget: silently catches errors.
|
|
22
|
+
* @param client - The Frak client instance (no-op if undefined)
|
|
23
|
+
* @param event - The event name to track
|
|
24
|
+
* @param props - Optional event properties
|
|
25
|
+
*/
|
|
16
26
|
export function trackEvent(
|
|
17
27
|
client: FrakClient | undefined,
|
|
18
28
|
event: FrakEvent,
|