Skip to content

Documentation / @frak-labs/core-sdk

Frak Wallet Core SDK

This SDK help any dApps, or gated content provider, use the Frak Wallet as a regular wallet, with smoother UX for your end-users (pay for his gas fees, check the paywall options, track his consumption etc.)

Checkout our documentation for more information's about the usage:

API Surface

The Core SDK exports 111 functions, types, and utilities organized into four categories:

Client

ExportPurpose
createIFrameFrakClientInitialize iframe-based Frak client for wallet communication
setupClientConfigure client with blockchain and transport settings
DebugInfoGathererUtility class for collecting debug information

Actions

ExportPurpose
displayModalShow wallet modal for user interactions
displayEmbeddedWalletRender embedded wallet view within your app
getMerchantInformationFetch merchant data including rewards and tiers
openSsoTrigger single sign-on flow in popup window
prepareSsoPrepare SSO parameters before opening popup
processReferralHandle referral code processing and validation
referralInteractionTrack referral-related user interactions
sendInteractionSend user interaction events to wallet
trackPurchaseStatusMonitor purchase completion status
watchWalletStatusSubscribe to wallet connection and balance updates
modalBuilderHelper to construct multi-step modal flows
sendTransactionWrapper for transaction signing and submission
siweAuthenticateSign-in with Ethereum authentication flow

Utilities

ExportPurpose
sdkConfigStoreReactive config singleton — resolve, cache, and subscribe to merchant config
computeLegacyProductIdConvert product ID to legacy format
triggerDeepLinkWithFallbackOpen deep link with mobile fallback
base64urlEncode / base64urlDecodeURL-safe base64 encoding/decoding
compressJsonToB64 / decompressJsonFromB64JSON compression utilities
trackEventSend analytics events
getClientIdRetrieve unique client identifier
getBackendUrlGet configured backend URL
formatAmountFormat token amounts with decimals
getCurrencyAmountKeyGenerate currency-specific cache key
getSupportedCurrencyCheck currency support
getSupportedLocaleValidate locale availability
createIframe / findIframeInOpenerIframe DOM helpers
FrakContextManagerManage SDK context lifecycle
generateSsoUrlBuild SSO redirect URL

Types

Core SDK exports 40+ TypeScript types including:

FrakClient, FrakWalletSdkConfig, SendInteractionParamsType, DisplayModalParamsType, WalletStatusReturnType, GetMerchantInformationReturnType, DisplayEmbeddedWalletParamsType, SendTransactionReturnType, SiweAuthenticateReturnType, OpenSsoParamsType, PrepareSsoParamsType, TrackArrivalParams, UtmParams, Currency, Language, FrakContext, IFrameRpcSchema, and more.

Modules