This is the full developer documentation for Wallet SDK by Frak # Wallet SDK by Frak > Seamlessly integrate Web3 functionality into your applications with user-friendly wallet interactions, engagement tracking, and reward systems. import IntegrationCards from "@/components/IntegrationCards.astro"; ## Key Features - Seamless on-chain user interactions - Delegated sessions for gas-less transactions - Customizable reward and referral systems - React and vanilla JavaScript support - Native Android and iOS SDKs - Sign-In with Ethereum (SIWE) authentication ## Demos - [JS SDK Integration](https://vanilla.frak-labs.com/): Very simple example with modals, interactions, and more. ## Community - Twitter: [@frak_defi](https://twitter.com/frak_defi) - Team: [@srod](https://twitter.com/srod), [@MViala](https://twitter.com/MViala), [@VirginieMaire](https://twitter.com/VirginieMaire), [@qnivelais](https://twitter.com/QNivelais) - [Medium](https://medium.com/frak-defi) - [GitHub](https://github.com/frak-id/wallet) Join us in revolutionizing digital content engagement with Web3! # Page not found > That page does not exist, or it moved. The links below cover most of what people are looking for. import { CardGrid, LinkCard } from '@astrojs/starlight/components'; If you followed a link from somewhere on this site, please [open an issue](https://github.com/frak-id/wallet/issues/new) so we can fix it. # Wallet SDK > Seamless Web3 interactions for your applications # Overview Welcome to the Wallet SDK documentation! The Wallet SDK provides developers with powerful tools to integrate seamless Web3 interactions into their applications, leveraging the user-friendly Frak Wallet. ## Frak Wallet The Frak Wallet is a cutting-edge cryptocurrency wallet designed with a strong emphasis on user experience. Built using the latest technologies, including [Account Abstraction](https://eips.ethereum.org/EIPS/eip-4337) and [WebAuthn](https://w3c.github.io/webauthn/), the Frak Wallet simplifies the onboarding process and enhances Web3 interactions. ![The Frak Wallet running on a mobile phone](/img/wallet/wallet-on-phone.webp) With the Frak Wallet, users can create an account using biometric authentication (fingerprint, facial recognition, etc.) and then seamlessly interact with decentralized applications (dApps). It eliminates the need for recovery phrases, pre-funded wallets for gas fees, and clunky browser extensions, providing a smooth and intuitive experience. The Frak Wallet is fully compatible with the WalletConnect standard, ensuring compatibility with a wide range of dApps and Web3 services. ## Wallet SDK The Wallet SDK is designed to streamline the integration of Web3 interactions into your applications, providing a comprehensive set of tools and features for various use cases. ### Key Features 1. **Seamless User Interactions**: Easily trigger on-chain events based on user actions within your application. 2. **Delegated User Sessions**: Implement gas-less transactions for your users, improving their experience. 3. **Reward Systems**: Set up and manage reward campaigns based on user interactions. 4. **Referral Tracking**: Implement and track referral-based campaigns with automatic reward distribution. 5. **Flexible Integration**: Works with React, vanilla JavaScript, and native [Android](/developers/integration/android/) and [iOS](/developers/integration/ios/) apps. 6. **Advanced Authentication**: Utilize Sign-In with Ethereum (SIWE) for secure, blockchain-based authentication. ### Use Cases #### For Content Platforms - **Engagement Tracking**: Record on-chain interactions when users engage with your content. - **Reward Programs**: Automatically distribute rewards (tokens, NFTs, etc.) based on user engagement. - **Referral Systems**: Implement blockchain-based referral programs, rewarding users for sharing your platform. - **Community Building**: Use on-chain interactions to build a verifiable community around your content. #### For dApp Developers - **Smooth Onboarding**: Leverage Account Abstraction for a frictionless user onboarding experience. - **Gasless Transactions**: Optionally cover gas fees for your users, reducing barriers to interaction. - **Interaction Tracking**: Record user interactions on-chain for transparent and verifiable user activity. - **Custom Reward Mechanisms**: Implement token or NFT-based rewards tied directly to in-app actions. ### Integration Benefits By integrating the Wallet SDK, you can: 1. **Enhance User Experience**: Provide a seamless Web3 experience without the typical blockchain complexities. 2. **Increase Engagement**: Implement reward systems that encourage user participation and sharing. 3. **Build Trust**: Utilize blockchain technology for transparent and verifiable user interactions. 4. **Flexible Implementation**: Easily incorporate Wallet SDK into your existing Web3 setup, compatible with popular libraries like Wagmi. 5. **Future-Proof**: Stay ahead with the latest in blockchain technology, including Account Abstraction and WebAuthn. The Wallet SDK empowers you to create decentralized, trustless, and user-friendly experiences while leveraging cutting-edge blockchain technologies. Whether you're building a content platform, a dApp, or any Web3-enabled application, the Wallet SDK provides the tools you need to implement robust, blockchain-based user interactions and reward systems. # Track Purchase Endpoint > API endpoint to register a purchase event for tracking # Track Purchase Endpoint ## Summary The track purchase endpoint registers a purchase event so the Frak backend can send `PurchaseCompleted` interactions automatically once the purchase is confirmed via webhook. ## Requirements - At least one identity source: a Frak Wallet session (`x-wallet-sdk-auth`) **or** a client id (`x-frak-client-id`). Anonymous users are supported. - A `merchantId` — resolved explicitly, from session storage, or via the merchant lookup API. - Purchase details: `customerId`, `orderId`, and `token`. ## Endpoint ```http POST /user/track/purchase ``` ### Headers - `Accept`: `application/json` - `Content-Type`: `application/json` - `x-wallet-sdk-auth` (optional): JWT token from the user SDK session. Obtain via [`watchWalletStatus`](/developers/references/core-sdk/actions/functions/watchwalletstatus/) (`status.interactionToken`). - `x-frak-client-id` (optional): Unique client identifier for anonymous user tracking. At least one of `x-wallet-sdk-auth` or `x-frak-client-id` must be present. ### Request Body The request body should be a JSON object with the following properties: - `customerId` (`string | number`): The ID of the customer making the purchase. Should match the value sent during purchase validation. - `orderId` (`string | number`): The ID of the order being placed. Should match the value sent during purchase validation. - `token` (`string`): A unique token related to the purchase. - `merchantId` (`string`): The merchant identifier. Resolved from the explicit parameter, `frak-merchant-id` in session storage, or the merchant lookup API. #### Example Request Body ```json { "customerId": "123456", "orderId": "987654", "token": "unique-token-value", "merchantId": "your-merchant-id" } ``` ## Usage Example Using the SDK (recommended): ```js import { trackPurchaseStatus } from "@frak-labs/core-sdk/actions"; await trackPurchaseStatus({ customerId: checkout.order.customer.id, orderId: checkout.order.id, token: checkout.token, merchantId: "your-merchant-id", }); ``` Direct `fetch` call: ```js const interactionToken = window.sessionStorage.getItem("frak-wallet-interaction-token"); const clientId = localStorage.getItem("frak-client-id"); const headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', }; if (interactionToken) headers['x-wallet-sdk-auth'] = interactionToken; if (clientId) headers['x-frak-client-id'] = clientId; const payload = { customerId: checkout.order.customer.id, orderId: checkout.order.id, token: checkout.token, merchantId: "your-merchant-id", }; fetch('https://backend.frak.id/user/track/purchase', { method: 'POST', headers, body: JSON.stringify(payload), }); ``` ## Response The endpoint responds with an acknowledgment of whether the purchase registration was successful. ## Related SDK Method - [`trackPurchaseStatus`](/developers/references/core-sdk/actions/functions/trackpurchasestatus/) — wrapper around this endpoint with automatic merchant id resolution and identity header management. ## Notes - `merchantId` is required. The SDK resolves it automatically from: explicit param → `frak-merchant-id` in session storage → backend lookup. - At least one identity header (`x-wallet-sdk-auth` or `x-frak-client-id`) must be present. The SDK skips the request if neither is available. - Ensure `customerId`, `orderId`, and `token` values match between the client and the purchase validation webhooks. # Purchase Webhooks > API webhooks to track and validate purchase events import { Tabs, TabItem } from "@astrojs/starlight/components"; # Purchase Webhooks ## Summary The purchase webhooks allow your application to validate purchase events and automatically trigger the `PurchaseCompleted` interaction, which could potentially lead to user rewards based on active campaigns. The webhooks also update the on-chain purchase oracle for your merchant, allowing you to know whether a purchase has been finalized. All purchase data is anonymized, and the oracle is updated with a Merkle tree root where each leaf contains a hashed `purchaseId`, `userId`, and the purchase finality status. ## Available Webhooks We provide three types of webhooks to handle purchase tracking: 1. **Shopify Webhook** 2. **WooCommerce Webhook** 3. **Custom Webhook** ### Shopify Webhook The Shopify webhook should be set up to trigger on order updates, allowing the backend to validate purchases and update the oracle. It is provisioned automatically by the official Frak Shopify app during onboarding — see the [Shopify Integration Guide](/guides/shopify) for details. ### WooCommerce Webhook Similar to the Shopify webhook, the WooCommerce webhook is provisioned automatically by the Frak WordPress plugin once the webhook secret is pasted in. Follow the [WordPress integration guide](/guides/platforms/wordpress/details/#order-tracking-with-woocommerce) to properly set it up. ### Custom Webhook The Custom webhook is designed for applications that use a custom eCommerce solution or need more flexibility. This webhook requires specific headers and a payload to register the purchase event. #### Endpoint The specific endpoint URL for each webhook type is visible in the business dashboard under the `Purchase Tracker` section of your merchant. #### Headers - **`x-hmac-sha256`**: A HMAC SHA-256 digest of the entire request body. The HMAC is computed using the secret available in your business dashboard. - **`x-test`**: Indicates if the webhook call is for a test order. This is useful for development environments. #### Request Body The body of the Custom webhook should be a JSON object that follows the `CustomWebhookDto` type: ```ts type CustomWebhookDto = Readonly<{ /** * Id of the order on your side (external order id) */ id: string; /** * Id of the customer on your side (external customer id) */ customerId: string; /** * Status of the order */ status: "pending" | "confirmed" | "cancelled" | "refunded"; /** * Custom token for this order * - Should be the same one as the one exposed to the end user and submitted through the `listenForPurchase` API method */ token: string; /** * Currency code (ISO 4217) * - Optional, could be empty * - Recommended for the UX in the members space */ currency?: string; /** * The total price of the order, in the currency provided * - Optional, could be empty * - Recommended for the UX in the members space */ totalPrice?: string; /** * All the items in the order * - Optional * - Will be used in the wallet members space, to display additional data to the end user, e.g. which product they referee bought the most */ items?: { /** * The product id on your side */ productId: string; /** * The quantity of the product in the order */ quantity: number; /** * The price of the product */ price: string; /** * An internal name for the product, used in url slug */ name: string; /** * The displayable title of the product */ title: string; /** * The SKU of the product, if you have one * - Optional * - Used for SKU-based campaign product-scope matching */ sku?: string; /** * A potential image URL for the product */ image?: string; }[]; }>; ``` :::tip[Product-scoped campaigns] Provide `sku` on each item whenever you can. It is the identifier used to match a purchase against product-scoped campaigns, so items sent without a SKU cannot be matched by SKU-based campaign rules. ::: ### Example Here is a few custom webhook calls in different languages: ```ts import crypto from 'crypto'; type Purchase = { id: string; customerId: string; status: "pending" | "confirmed" | "cancelled" | "refunded"; token: string; currency?: string; totalPrice?: string; items?: { productId: string; quantity: number; price: string; name: string; title: string; sku?: string; image?: string; }[]; } async function sendPurchaseWebhook( purchase: Purchase ): Promise { const body = JSON.stringify(purchase); const hmac = await crypto .createHmac('sha256', process.env.FRAK_PURCHASE_WEBHOOK_SECRET) .update(body) .digest('hex'); await fetch(process.env.FRAK_PURCHASE_WEBHOOK, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-hmac-sha256': hmac, 'x-test': process.env.NODE_ENV === 'production' ? 'false' : 'true' }, body }); } // Usage example const purchase = { id: 'order_123', customerId: 'cust_456', status: 'confirmed', token: 'purchase_token_789', currency: 'USD', totalPrice: '99.99', items: [{ productId: 'prod_001', quantity: 1, price: '99.99', name: 'premium-subscription', title: 'Premium Subscription', sku: 'SKU-PREMIUM-001' }] }; sendPurchaseWebhook(purchase) .then(response => console.log('Webhook sent successfully:', response)) .catch(error => console.error('Error sending webhook:', error)); ``` ```php function sendPurchaseWebhook(array $purchase): void { $webhookUrl = 'your_webhook_url_from_dashboard'; $secretKey = 'your_secret_key_from_dashboard'; $isTest = true; // Set to false in production $body = json_encode($purchase); $hmac = hash_hmac('sha256', $body, $secretKey); $ch = curl_init($webhookUrl); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => false, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-hmac-sha256: ' . $hmac, 'x-test: ' . ($isTest ? 'true' : 'false') ] ]); curl_exec($ch); curl_close($ch); } // Usage example $purchase = [ 'id' => 'order_123', 'customerId' => 'cust_456', 'status' => 'confirmed', 'token' => 'purchase_token_789', 'currency' => 'USD', 'totalPrice' => '99.99', 'items' => [ [ 'productId' => 'prod_001', 'quantity' => 1, 'price' => '99.99', 'name' => 'premium-subscription', 'title' => 'Premium Subscription', 'sku' => 'SKU-PREMIUM-001' ] ] ]; sendPurchaseWebhook($purchase); ``` ## HMAC Signature Each webhook request should include a valid HMAC signature of the entire body payload, ensuring the request's integrity and authenticity. The secret used to generate this HMAC signature is available in your business dashboard. ## Response All webhook types expect a JSON response indicating whether the request was successfully processed. ## Notes - Ensure that the `id`, `customerId`, `status`, and `token` fields are consistent between the client and the server to ensure successful tracking. - The webhooks automatically update the on-chain purchase oracle, which anonymously tracks the purchase finality status. - You can find the specific webhook URL for your merchant in the business dashboard, under the `Purchase Tracker` section of your merchant. # Getting Started with Frak Components > Learn how to set up and start using Frak Components in your project # Getting Started with Frak Components This guide will walk you through the process of setting up and using Frak Components in your project. You can find examples of Frak Components at [https://showcase.frak.id/](https://showcase.frak.id/). ## Prerequisites Before you begin, ensure you have: - A modern web browser - Basic knowledge of HTML and JavaScript ## 1. Register Your Merchant :::note Merchant registration is a crucial step that enables key functionalities of Frak Components. ::: Before using Frak Components, you need a merchant account on the Frak Business Platform: 1. Visit [https://business.frak.id/](https://business.frak.id/) 2. Sign up or log in to your account — your main storefront domain is registered automatically at sign-up. 3. (Optional) If your site lives on a subdomain different from the registered main domain, add it under **Allowed Domains** on the dashboard. For a detailed walkthrough, see our [Business Registration Guide](/guides/dashboard/register/). ## 2. Setup the Frak Components Once your merchant is set up, install Frak Components in your project. Add the following script tag to your HTML file. `sdk.frak.id` is Frak's first-party CDN pointer; see the [CDN / Browser integration guide](/developers/integration/cdn/) for the full setup with preconnect hints and a jsDelivr fallback: ```html ``` ## 3. Basic Configuration After setup, you need to add a `config` object by assigning a global variable `FrakSetup`. You can generate a config object using the [Frak SDK Builder](https://showcase.frak.id/configuration). ```html ``` More information about the [FrakSetup](/developers/components/frak-setup) object. ## 4. Add Components Now you can start adding Frak Components to your project. Here's an example of how to add a share button: ```html ``` That's it! You've successfully set up and started using Frak Components in your project. ## Next Steps Now that you're set up, you can explore components and customize them to fit your project requirements: - [Share Button](/developers/components/share-button) - [Banner](/developers/components/banner) - [Post-Purchase](/developers/components/post-purchase) - [Open In App](/developers/components/open-in-app) - [FrakSetup Configuration](/developers/components/frak-setup) You can also explore our [Wallet SDK](/developers) documentation for more advanced features and customization options. # Banner Component > Display referral and in-app browser banners on your website # Banner ## Summary The `` component displays contextual banners on your website. It automatically detects the user's context and shows one of two variants: - **Referral banner** — Promotes sharing and rewards to eligible users. - **In-app browser banner** — Prompts users browsing in an in-app browser (Instagram, TikTok, etc.) to open the page in their default browser for a better experience. This variant is opt-in: enable it with the `allowInappRedirect` attribute. ## Requirements - An initialized `FrakSetup` configuration object More information about the [FrakSetup](/developers/components/frak-setup) object. ## Parameters | Attribute | Type | Description | |-----------|------|-------------| | `placement` | `string` | Placement ID for [backend-driven configuration](/developers/concepts/placements). | | `classname` | `string` | CSS class names applied to the root element. | | `interaction` | `string` | Filter rewards by interaction type (e.g. `"purchase"`, `"referral"`). When omitted, the best reward across all types is shown. | | `referralTitle` | `string` | Override the referral banner title. | | `referralDescription` | `string` | Override the referral banner description. | | `referralCta` | `string` | Override the referral banner CTA button text. | | `inappTitle` | `string` | Override the in-app browser banner title. | | `inappDescription` | `string` | Override the in-app browser banner description. | | `inappCta` | `string` | Override the in-app browser banner CTA button text. | | `imageUrl` | `string` | Override the image shown on the left of the referral banner. Falls back to the built-in gift icon when omitted. | | `preview` | `string` | When set, forces the banner to render in preview mode (e.g. in Shopify theme editor). | | `previewMode` | `"referral"` \| `"inapp"` | Which variant to preview. Only used when `preview` is set. Defaults to `"referral"`. | | `allowInappRedirect` | `boolean` \| `"true"` \| `"false"` | Allow the banner to switch to in-app browser mode and prompt users to open the system browser. Opt-in, defaults to `false`. | ## Usage Examples ### Basic Banner ```html ``` ### With Custom Referral Text ```html ``` ### With In-App Browser Text ```html ``` ### With Placement ```html ``` Banner text and styling are resolved from the [placement configuration](/developers/concepts/placements) set in the business dashboard. ### With Custom Class ```html ``` ### Preview Mode (Theme Editors) When building a theme editor integration (e.g. Shopify), use `preview` to render static content without requiring an active SDK connection: ```html ``` ## CSS Target the component using the `frak-banner` selector: ```css frak-banner .override { background-color: #f5f5f5; border-radius: 8px; } ``` Component-specific CSS can also be configured via [placements](/developers/concepts/placements) in the business dashboard. # FrakSetup object > Learn how to configure the Frak Setup object in your project # `FrakSetup` object The `FrakSetup` object is used to configure the Frak Components library in your project. It allows you to set up metadata and other configuration options for your application. It is required to initialize the Frak Components library and should be passed as a global variable in your project. You can generate a config object using the [Frak SDK Builder](https://showcase.frak.id/configuration). ## `config` object The `config` object is used to configure the Frak Components library. It allows you to set up metadata about your application, such as the name and CSS styles. ```ts twoslash title="TypeScript" // @noErrors // [!include ~/snippets/types/FrakWalletSdkConfig.ts] window.FrakSetup = { config: FrakWalletSdkConfig; } ``` ### Example ```js twoslash title="JavaScript" window.FrakSetup = { config: { metadata: { name: "My Awesome dApp", merchantId: "550e8400-e29b-41d4-a716-446655440000", lang: "fr", currency: "eur" }, customizations: { css: "https://my-app.com/frak-styles.css", }, domain: "my-app.com" }, }; ``` For more detailed `config` options, see our [FrakWalletSdkConfig](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/). ## `modalWalletConfig` object :::caution[Deprecated in components 1.2.0] `modalWalletConfig` configured the embedded wallet drawer, a surface removed in components 1.2.0. The object is still read, but narrowed to one property: `metadata.position`, which anchors `` to one side. Everything else is ignored. ::: ```js twoslash title="JavaScript" window.FrakSetup = { config: { metadata: { name: "My Awesome dApp", }, }, modalWalletConfig: { // [!code focus] metadata: { position: "right" }, // [!code focus] }, // [!code focus] }; ``` It is kept because integrations in the wild — notably the Magento module — still inject it to pick the button side. New integrations should set the position through the [placement configuration](/developers/concepts/placements) instead. # Open In App Component > Redirect users from in-app browsers to the system browser # Open In App ## Summary The `` component renders a button that redirects users from in-app browsers (Instagram, TikTok, Facebook, etc.) to the device's default browser. This ensures a better user experience for features like WebAuthn authentication that don't work well in WebViews. :::note This component only renders on mobile devices. On desktop, it returns nothing. ::: ## Requirements - An initialized `FrakSetup` configuration object More information about the [FrakSetup](/developers/components/frak-setup) object. ## Parameters | Attribute | Type | Default | Description | |-----------|------|---------|-------------| | `text` | `string` | `"Open in App"` | Text to display on the button. | | `placement` | `string` | — | Placement ID for [backend-driven configuration](/developers/concepts/placements). | | `classname` | `string` | — | CSS class names applied to the root element. | ## Usage Examples ### Basic Button ```html ``` ### With Custom Text ```html ``` ### With Placement ```html ``` ### With Custom Class ```html ``` ## CSS Target the component using the `frak-open-in-app` selector: ```css frak-open-in-app .override { background-color: #1a1a1a; color: #fff; border-radius: 8px; } ``` Component-specific CSS can also be configured via [placements](/developers/concepts/placements) in the business dashboard. # Post-Purchase Component > Display a sharing prompt after a purchase to drive referrals # Post-Purchase ## Summary The `` component is designed for checkout confirmation pages. It displays a sharing prompt to buyers, encouraging them to share the product with friends. The component adapts its message based on whether the user is a **referrer** (existing advocate) or a **referee** (was referred by someone). ## Requirements - An initialized `FrakSetup` configuration object - Purchase tracking data (customer ID, order ID, and token) for attribution More information about the [FrakSetup](/developers/components/frak-setup) object. ## Parameters | Attribute | Type | Description | |-----------|------|-------------| | `customerId` | `string` | Merchant customer ID for purchase tracking. All three tracking props (`customerId`, `orderId`, `token`) must be present for tracking to fire. | | `orderId` | `string` | Merchant order ID for purchase tracking. | | `token` | `string` | Checkout token for purchase tracking. | | `sharingUrl` | `string` | Base URL to share. Falls back to the merchant domain when omitted. | | `merchantId` | `string` | Override the merchant ID resolved from SDK config. | | `placement` | `string` | Placement ID for [backend-driven configuration](/developers/concepts/placements). | | `classname` | `string` | CSS class names applied to the root element. | | `variant` | `"referrer"` \| `"referee"` | Force a display variant instead of relying on backend evaluation. | | `badgeText` | `string` | Label for the badge pill above the message. Hidden when omitted. | | `referrerText` | `string` | Override the message shown to referrers. Use `{REWARD}` as placeholder. | | `refereeText` | `string` | Override the message shown to referees. Use `{REWARD}` as placeholder. | | `ctaText` | `string` | Override the CTA button text. Use `{REWARD}` as placeholder. | | `imageUrl` | `string` | Override the image shown on the left of the card. Falls back to the built-in gift icon when omitted. | | `products` | `string` | JSON-stringified array of product cards forwarded to the sharing page when the CTA is clicked (set the JS `products` property for a real array). | | `preview` | `string` | Render in preview mode (e.g. Shopify/WordPress theme editor): bypasses the client-ready gate and no-ops the click handler. | | `previewVariant` | `"referrer"` \| `"referee"` | Which variant to show when `preview` is set. Defaults to `"referrer"`. | ## Usage Examples ### Basic Post-Purchase ```html ``` ### With Custom Text ```html ``` ### With Placement ```html ``` Text and styling are resolved from the [placement configuration](/developers/concepts/placements) set in the business dashboard. ### With Custom Sharing URL ```html ``` ### Force a Variant ```html ``` ## Purchase Tracking The component supports automatic purchase tracking when all three tracking attributes are provided: - `customerId` — Your internal customer identifier - `orderId` — The order/transaction identifier - `token` — A checkout token for verification :::tip All three attributes must be present for purchase tracking to fire. If any is missing, the component still renders the sharing prompt but doesn't track the purchase. ::: ## CSS Target the component using the `frak-post-purchase` selector: ```css frak-post-purchase .override { background-color: #f0fdf4; border-radius: 12px; padding: 24px; } ``` Component-specific CSS can also be configured via [placements](/developers/concepts/placements) in the business dashboard. # Share Button Component > Learn how to use the Share Button component in your web project # Share Button ## Summary The `` component opens a modal in the Frak Wallet interface with configurable steps, allowing for complex user interactions such as login, opening session and share. ## Requirements - An initialized `FrakSetup` configuration object More information about the [FrakSetup](/developers/components/frak-setup) object. ### Parameters | Attribute | Type | Default | Description | |-----------|------|---------|-------------| | `text` | `string` | `"Share and earn!"` | Text to display on the button. Include the `{REWARD}` placeholder to opt into the live reward flow (the SDK substitutes the estimated reward amount). | | `classname` | `string` | — | CSS class names applied to the button. | | `placement` | `string` | — | Placement ID for [backend-driven configuration](/developers/concepts/placements). | | `clickAction` | `string` | `"sharing-page"` | Kept for backwards compatibility; every click opens the sharing page. Legacy values (`"embedded-wallet"`, `"share-modal"`) are accepted and routed there, and the resolved value is reported on the `share_button_clicked` event. | | `noRewardText` | `string` | — | Fallback text used when `text` contains `{REWARD}` but no reward is available. | | `targetInteraction` | `string` | — | Target interaction type used to calculate the displayed reward. | | `preview` | `string` | — | Render in preview mode (e.g. Shopify/WordPress theme editor): the button stays visually enabled and the click handler is a no-op. | ## Usage Examples ### Basic Share Button ```html ``` ### With Custom Text ```html ``` ### With Custom Class ```html ``` ### With Reward Display Include the `{REWARD}` placeholder in `text` to display the live estimated reward. Provide `noRewardText` as a fallback for when no reward is available. ```html ``` ### With Click Action Every click opens the sharing page. `clickAction` no longer selects a surface — the embedded wallet and the share modal were both retired in components 1.2.0 — but it stays accepted so a stored merchant config keeps working: ```html ``` ### With Placement ```html ``` Button text, click action, and styling are resolved from the [placement configuration](/developers/concepts/placements) set in the business dashboard. HTML attributes override placement settings. ## CSS CSS can be used to style the button. Some default styles are applied to the button, but they can be overridden with custom CSS. Target the component using the `frak-button-share .override` selector. ```css frak-button-share .override { background-color: #000; color: #fff; } ``` Component-specific CSS can also be configured via [placements](/developers/concepts/placements) in the business dashboard. # Core Concepts of Wallet SDK > Understanding the fundamental concepts and components of the Wallet SDK # Core Concepts The Wallet SDK provides a powerful set of tools for integrating Web3 functionality into your applications. To effectively use the SDK, it's important to understand its core concepts. This section will introduce you to the key ideas behind the Wallet SDK. ## Key Concepts 1. [Configuration](/developers/concepts/configuration) Learn how to set up and customize the Wallet SDK for your specific needs. 2. [Interactions](/developers/concepts/interactions) Explore the concept of user interactions and how they form the basis of the Wallet SDK's functionality. 3. [Backend-Driven Configuration](/developers/concepts/backend-configuration) Learn how the SDK automatically resolves merchant configuration from the Frak backend. 4. [Placements](/developers/concepts/placements) Understand how to use placements to customize SDK behavior per page or section of your website. ## Understanding the Flow The Wallet SDK operates on a simple yet powerful flow: 1. **Configuration**: You set up the SDK with your specific parameters. 2. **Delegated Session**: A session is created, allowing for gasless transactions. 3. **User Interactions**: As users interact with your application, you track these interactions using the SDK. 4. **On-chain Recording**: These interactions are recorded on the blockchain, providing a transparent and verifiable record. 5. **Rewards and Campaigns**: Based on these interactions, you can trigger rewards or manage campaigns. ## Key Features - **Seamless Integration**: The SDK is designed to work smoothly with both React and vanilla JavaScript applications. - **Interaction Tracking**: Easily record user engagements and actions on the blockchain. - **Reward Systems**: Implement token or NFT-based reward programs tied to user interactions. - **Gasless Transactions**: Cover gas fees for your users, reducing barriers to interaction. - **Referral Programs**: Set up and manage blockchain-based referral systems. By understanding these core concepts, you'll be well-equipped to leverage the full power of the Wallet SDK in your applications. Dive into each concept to learn more about how they work and how to implement them in your projects. :::note For specific implementation details, please refer to the [Getting started](/guides) guides. ::: # Backend-Driven Configuration > Learn how the SDK dynamically resolves configuration from the Frak backend # Backend-Driven Configuration The Frak SDK supports dynamic configuration resolved from the backend. When your application initializes, the SDK fetches your merchant configuration from the Frak backend based on your domain. This means you can manage branding, translations, component settings, and [placements](/developers/concepts/placements) directly from the [business dashboard](/guides/dashboard) without redeploying your application. ## How It Works 1. **SDK Initialization** — When the SDK starts, it calls the Frak backend's resolve endpoint with your domain. 2. **Merchant Resolution** — The backend identifies your merchant account and returns the associated configuration. 3. **Config Merging** — The resolved backend config is merged with your local SDK config. Backend values take priority over local values. 4. **Reactive Updates** — Components automatically re-render when the backend configuration is resolved. ``` Your Website Frak Backend | | | GET /resolve?domain=... | |------------------------------>| | | | { merchantId, sdkConfig } | |<------------------------------| | | | Components update reactively | | | ``` ## Configuration Priority The SDK merges configuration from multiple sources. When the same setting exists at multiple levels, the highest-priority source wins: 1. **Backend config** (highest priority) — Set in the business dashboard 2. **SDK static config** — Passed in your `FrakWalletSdkConfig` object 3. **Defaults** — Built-in SDK defaults This means you can set sensible defaults in your code and override them from the dashboard without touching your codebase. ## Resolved Configuration The backend returns the following fields when available: | Field | Description | |-------|-------------| | `name` | Your application display name | | `logoUrl` | Logo URL displayed in modals and components | | `homepageLink` | Link to your homepage (used in some components) | | `currency` | Display currency (`"eur"`, `"usd"`, `"gbp"`) | | `lang` | Language override (`"en"`, `"fr"`) | | `hidden` | When `true`, all SDK components are hidden | | `css` | Global CSS applied to modals and components | | `translations` | Global translation overrides | | `placements` | Named placement configurations (see [Placements](/developers/concepts/placements)) | | `components` | Global component defaults | ## Controlling Loading Behavior By default, the SDK waits for the backend configuration to be resolved before rendering components. This ensures components display the correct branding and settings from the start. You can control this behavior with the `waitForBackendConfig` option: ```ts twoslash // @noErrors import type { FrakWalletSdkConfig } from '@frak-labs/core-sdk'; const config: FrakWalletSdkConfig = { metadata: { name: "My App", }, // When true (default): components show a loading spinner until backend config is resolved // When false: components render immediately with local config / HTML attributes waitForBackendConfig: true, }; ``` :::tip Keep `waitForBackendConfig: true` (the default) if you rely on backend-managed settings like translations, custom CSS, or placements. Set it to `false` if you provide all configuration locally and want instant rendering. ::: ## Caching The SDK caches the resolved configuration in `localStorage` with a 30-second TTL using a stale-while-revalidate strategy: - **Fresh cache** (< 30 seconds): The cached config is used immediately, no network request. - **Stale cache** (> 30 seconds): The cached config is used immediately for fast rendering, while a background fetch updates the cache. - **No cache**: A network request is made and components wait for the response (or render immediately if `waitForBackendConfig` is `false`). The cache is scoped per domain and language, so different subdomains or language settings maintain separate caches. ## Managing Backend Configuration Backend-driven configuration is managed from the **business dashboard**. Navigate to your merchant's settings to configure: - **Branding** — Name, logo, homepage link - **Display** — Language, currency, visibility toggle - **Styling** — Custom CSS for modals and components - **Translations** — Override default text for any SDK component - **Placements** — Create named configurations for different sections of your site (see [Placements](/developers/concepts/placements)) Changes made in the dashboard take effect on your website within 30 seconds (the cache TTL), without requiring any code changes or redeployment. # Wallet SDK Configuration > Learn how to configure the Wallet SDK for your application import { Tabs, TabItem } from "@astrojs/starlight/components"; # Configuration Proper configuration is crucial for the Wallet SDK to function correctly in your application. This guide will walk you through the configuration options and how to set them up. ## Configuration Object The Wallet SDK uses a configuration object to set up its behavior. Here's the structure of the `FrakWalletSdkConfig` object: ```ts twoslash // [!include ~/snippets/types/FrakWalletSdkConfig.ts] ``` ```js /** * @typedef {Object} FrakWalletSdkConfig * @property {string|Object} [env] - The environment to run against ("prod", "dev", or { wallet, backend }) * @property {Object} metadata - Metadata about your application * @property {string} [metadata.name] - The name of your application * @property {string} [metadata.merchantId] - Your merchant ID (UUID) from the Frak dashboard * @property {string} [metadata.lang] - The default language ("en" | "fr") * @property {string} [metadata.currency] - The default currency ("eur" | "usd" | "gbp") * @property {string} [metadata.logoUrl] - Logo URL displayed in modals and components * @property {string} [metadata.homepageLink] - Link to your homepage * @property {Object} [customizations] - Customization options * @property {string} [customizations.css] - URL to a CSS file for styling * @property {Object} [customizations.i18n] - Translation overrides for SDK components * @property {string} [domain] - The domain of your application * @property {boolean} [waitForBackendConfig] - Wait for backend config before rendering (default: true) * @property {Object} [attribution] - Default attribution params (UTM / via / ref) appended to outbound sharing URLs * @property {string[]} [preload] - UI views to preload in the listener iframe ("modal" | "sharing", default: ["sharing"]) */ ``` Let's break down each property: ### `env` (optional) The environment the SDK talks to. It states both the wallet and the backend origin, so nothing is guessed from a single URL: - `"prod"` (default): `https://wallet.frak.id` and `https://backend.frak.id` - `"dev"`: `https://wallet-dev.frak.id` and `https://backend.gcp-dev.frak.id` - `{ wallet, backend }`: an explicit pair, for local development or any host the presets do not know ```ts { env: "dev" } { env: { wallet: "https://localhost:3000", backend: "https://localhost:3030" } } ``` An unknown stage name, or an object missing either origin, logs an error and falls back to production. Trailing slashes are stripped. :::caution `env` is page-level, not per client or per provider: the last integration to set one wins, and doing so logs a warning. Omitting it leaves the published value untouched. ::: :::note `env` replaces `walletUrl`, which was removed in core-sdk 1.4.0. It used to take a single wallet URL and match it against known hosts by substring to guess the backend, so an origin the SDK did not recognise silently paired a custom wallet with the production backend. Integrations that never set `walletUrl` need no change. ::: `setEnvironment(env)` and `getEnvironment()` are exported for the rare case of resolving the pair outside a client — reading the backend origin before the SDK boots, for instance. Setting `env` on your config is the normal path; calling `setEnvironment` is the same page-level write, with the same last-one-wins warning. ### `metadata` This object contains metadata about your application: - `name` (optional): The name of your application. Displayed in modals and SSO pages. - `merchantId` (optional): Your merchant ID from the Frak dashboard (UUID format). Used for referral tracking and analytics. If not provided, it will be auto-fetched from the backend using your domain. - `lang` (optional): The display language (`"en"` or `"fr"`). Defaults to the browser language. - `currency` (optional): The display currency (`"eur"`, `"usd"`, or `"gbp"`). Defaults to `"eur"`. - `logoUrl` (optional): Logo URL displayed in modals and a few components. - `homepageLink` (optional): Link to your homepage, used in SSO pages and some components. ### `customizations` This object contains customization options for the displayed Frak elements: - `css` (optional): A URL to a CSS file (must end with `.css`) that styles the Frak Wallet interface when displayed in your application. - `i18n` (optional): An object containing text overrides for SDK components. Can be a single-language config or a multi-language config keyed by language code. :::caution URL-based i18n configuration has been removed. Only inline objects are supported. ::: ### `domain` (optional) The domain of your application. This is used to identify your application in the Frak ecosystem. :::tip This property is optional. If not provided, it will be automatically retrieved during initialization. ::: ### `waitForBackendConfig` (optional) Controls whether components wait for the [backend-driven configuration](/developers/concepts/backend-configuration) to be resolved before rendering. - `true` (default): Components show a loading spinner until backend config is resolved. - `false`: Components render immediately with local config and HTML attributes. ### `attribution` (optional) Default attribution parameters (`utmSource`, `utmMedium`, `utmCampaign`, `utmTerm`, `via`, `ref`) appended to outbound sharing URLs. Per-call `displaySharingPage` overrides take precedence, then backend config, then this SDK-level default. `utmContent` is intentionally excluded, as it is per-content rather than a merchant-wide default. ### `preload` (optional) UI views to preload inside the listener iframe for a snappier first display. Accepts an array of `"modal"` and/or `"sharing"`. :::tip Defaults to `["sharing"]`. ::: ## Example Configuration Here's an example of a complete configuration object: ```ts twoslash // @noErrors import type { FrakWalletSdkConfig } from '@frak-labs/core-sdk'; const frakConfig: FrakWalletSdkConfig = { env: "prod", metadata: { name: "My Awesome dApp", lang: "en", currency: "usd", logoUrl: "https://my-app.com/logo.png", homepageLink: "https://my-app.com", }, customizations: { css: "https://my-app.com/frak-styles.css", i18n: { en: { "sdk.modal.title": "Welcome!", }, fr: { "sdk.modal.title": "Bienvenue !", "sharing.title": "Partage ce produit!", } } }, domain: "my-app.com", }; ``` ## Using the Configuration How you use this configuration depends on whether you're using React or vanilla JavaScript: ### React In a React application, use the `FrakConfigProvider` to provide this configuration to your app: ```tsx twoslash // @noErrors import { FrakConfigProvider, FrakIFrameClientProvider } from '@frak-labs/react-sdk'; const frakConfig = { metadata: { name: "My Awesome dApp", }, }; function App() { return ( {/* Your app components */} ); } ``` ### Vanilla JavaScript In a vanilla JavaScript application, pass this configuration when creating a Frak client: ```ts twoslash // @noErrors import { createIFrameFrakClient, createIframe } from '@frak-labs/core-sdk'; const frakConfig = { metadata: { name: "My Awesome dApp", }, }; const iframe = createIframe({ config: frakConfig }); const client = await createIFrameFrakClient({ config: frakConfig, iframe }); ``` ## Best Practices 1. **Environment-based Configuration**: Consider using different configurations for development and production environments. This allows you to use the development Frak Wallet during testing. 2. **Secure CSS**: If you're providing a custom CSS file, ensure it's served over HTTPS to prevent security issues. 3. **Domain Consistency**: If you provide a `domain`, make sure it matches the actual domain where your application is hosted. Mismatches can lead to authentication issues. 4. **Iframe Creation**: Always use the `createIframe` helper function provided by the SDK to create the iframe. This ensures proper setup and compatibility. :::caution Remember to handle any potential errors when creating the iframe or initializing the client. ::: By properly configuring the Wallet SDK, you ensure that it can communicate effectively with the Frak Wallet and provide a seamless experience for your users. ## Next Steps - [Backend-Driven Configuration](/developers/concepts/backend-configuration) — Learn how the SDK dynamically resolves settings from the Frak backend. - [Placements](/developers/concepts/placements) — Customize component behavior for different sections of your website. - [Tracking User Interactions](/developers/concepts/interactions) — Learn about interaction tracking. # Understanding Interactions > Learn how to leverage interactions in the Wallet SDK for tracking user engagement, implementing reward systems, and enhancing your application's functionality. # Interactions Interactions are the cornerstone of user engagement tracking in the Wallet SDK. They allow developers to record events based on user actions within their applications, enabling features like reward systems and engagement analytics. ## How Interactions Work 1. **Automatic Tracking**: The SDK tracks user arrivals, referrals, and sharing events through a simple fire-and-forget API. 2. **Merchant Resolution**: The SDK automatically resolves your merchant identity from your domain — no need to pass product or merchant IDs manually. 3. **Offline Support**: If a user isn't logged in, interactions are stored locally in the browser and sent once a session is established, ensuring privacy and data integrity. 4. **Transparent Process**: The entire interaction recording process is seamless and invisible to the user. ## Interaction Types The SDK supports three interaction types: - **`arrival`** — Track when a user lands on your site, with optional referral attribution. - **`sharing`** — Track when a user shares your content via the sharing modal. - **`custom`** — Track any custom event specific to your application. ## Sending Interactions Use the [`sendInteraction`](/developers/references/core-sdk/actions/functions/sendinteraction/) action to record events: ```ts twoslash // @noErrors import { sendInteraction } from '@frak-labs/core-sdk/actions'; // Track a user arrival with referral attribution await sendInteraction(client, { type: "arrival", referrerWallet: "0x1234...abcd", }); // Track a sharing event await sendInteraction(client, { type: "sharing" }); // Send a custom interaction await sendInteraction(client, { type: "custom", customType: "newsletter_signup", data: { email: "user@example.com" }, }); ``` `sendInteraction` is fire-and-forget: errors are caught and logged, not thrown. ## Referral Interactions For referral tracking, the SDK provides a dedicated helper that handles the full referral flow automatically: ```ts twoslash // @noErrors import { referralInteraction } from '@frak-labs/core-sdk/actions'; const result = await referralInteraction(client, { options: { alwaysAppendUrl: true, merchantId: "550e8400-e29b-41d4-a716-446655440000", }, }); ``` See [`referralInteraction`](/developers/references/core-sdk/actions/functions/referralinteraction/) for details. ## Benefits of Interactions - **Engagement Tracking**: Monitor user activity on your platform. - **Reward Systems**: Implement campaigns that distribute rewards based on user interactions. - **Privacy-Preserving**: Interactions are only sent when a user has an active session. - **Flexible Integration**: Use built-in types or define custom interactions for your specific use case. ## Best Practices - Use the `referralInteraction` helper for referral flows instead of manually composing arrival interactions. - Set default UTM / attribution params via the SDK [`attribution` config](/developers/concepts/configuration/#attribution-optional) to improve marketing attribution on shared links. - Use `idempotencyKey` on custom interactions to prevent duplicate event recording. For detailed parameter information, refer to the [`SendInteractionParamsType`](/developers/references/core-sdk/index/type-aliases/sendinteractionparamstype/) reference. # Placements > Use placements to customize SDK components for different sections of your website # Placements Placements let you define named configurations that customize how SDK components behave on different sections of your website. Instead of using the same global settings everywhere, you can create placements like `"homepage"`, `"product-page"`, or `"checkout"` — each with its own text, styling, and behavior. ## How Placements Work 1. **Create placements** in the [business dashboard](/guides/dashboard) under your merchant's customization settings. 2. **Assign a placement** to any SDK component using the `placement` attribute or prop. 3. **The component resolves** its configuration from the [backend-driven config](/developers/concepts/backend-configuration), applying placement-specific overrides on top of global defaults. ``` Global Config (dashboard defaults) └── Placement: "homepage" │ └── buttonShare: { text: "Share this!", clickAction: "sharing-page" } │ └── banner: { referralTitle: "Join our community" } └── Placement: "checkout" └── postPurchase: { ctaText: "Share and earn {REWARD}!" } └── buttonShare: { text: "Tell your friends" } ``` ## Using Placements with Web Components All Frak web components accept a `placement` attribute. When provided, the component looks up its configuration from the matching placement in the backend config. ### Share Button ```html ``` ### Post-Purchase ```html ``` ### Banner ```html ``` ### Wallet Button ```html ``` ### Open in App ```html ``` ## Using Placements with the Core SDK When calling SDK actions directly (without web components), pass the placement ID as the third argument: ```ts twoslash // @noErrors import { displayModal, displaySharingPage } from '@frak-labs/core-sdk/actions'; // Display a modal associated with the "checkout" placement const results = await displayModal(client, { steps: { login: { allowSso: true }, final: { action: { key: "reward" } }, }, }, "checkout"); // Display the sharing page for the "homepage" placement await displaySharingPage(client, {}, "homepage"); ``` ## Placement Configuration Options Each placement can customize the following components. Settings defined at the placement level override the global component defaults. ### Share Button (`buttonShare`) | Option | Type | Description | |--------|------|-------------| | `text` | `string` | Button text. Use `{REWARD}` placeholder for reward amount. | | `noRewardText` | `string` | Fallback text when no reward is available. | | `clickAction` | `string` | Which UI opens on click. Since components 1.2.0 every value opens the sharing page; `"embedded-wallet"` and `"share-modal"` are still stored and emitted for older configs. | | `useReward` | `boolean` | Whether to display the reward amount. | | `css` | `string` | Component-specific CSS override. | ### Wallet Button (`buttonWallet`) | Option | Type | Description | |--------|------|-------------| | `position` | `"right"` \| `"left"` | Screen position of the floating wallet button. | | `css` | `string` | Component-specific CSS override. | ### Post-Purchase (`postPurchase`) | Option | Type | Description | |--------|------|-------------| | `badgeText` | `string` | Text for the badge pill above the message. | | `refereeText` | `string` | Message shown to referred users. Use `{REWARD}` placeholder. | | `refereeNoRewardText` | `string` | Fallback message for referees when no reward is found. | | `referrerText` | `string` | Message shown to referrers. Use `{REWARD}` placeholder. | | `referrerNoRewardText` | `string` | Fallback message for referrers when no reward is found. | | `ctaText` | `string` | CTA button text. Use `{REWARD}` placeholder. | | `ctaNoRewardText` | `string` | Fallback CTA text when no reward is found. | | `css` | `string` | Component-specific CSS override. | ### Banner (`banner`) | Option | Type | Description | |--------|------|-------------| | `referralTitle` | `string` | Title for the referral banner variant. | | `referralDescription` | `string` | Description for the referral banner. | | `referralCta` | `string` | CTA button text for the referral banner. | | `inappTitle` | `string` | Title for the in-app browser banner variant. | | `inappDescription` | `string` | Description for the in-app browser banner. | | `inappCta` | `string` | CTA button text for the in-app browser banner. | | `css` | `string` | Component-specific CSS override. | ### Open in App (`openInApp`) | Option | Type | Description | |--------|------|-------------| | `text` | `string` | Button text override. | | `css` | `string` | Component-specific CSS override. | ### Placement-Level Settings In addition to component-specific settings, each placement also supports: | Option | Type | Description | |--------|------|-------------| | `targetInteraction` | `string` | The interaction type to use for reward calculations in this placement. | | `translations` | `Record` | Placement-specific translation overrides. | | `css` | `string` | Global CSS applied to modals displayed from this placement. | ## Placement vs. HTML Attributes Component settings can come from two sources: **placement configuration** (backend-driven) and **HTML attributes** (inline). When both are present, HTML attributes take precedence, allowing you to override placement defaults for specific instances. ```html ``` ## Example: Multi-Page Setup Here's an example of using different placements across a website: ```html ``` Each placement is configured independently in the business dashboard, giving you full control over text, styling, and behavior per section — without changing your code. ## Next Steps - [Backend-Driven Configuration](/developers/concepts/backend-configuration) — Learn how the SDK resolves configuration from the backend. - [Configuration](/developers/concepts/configuration) — Set up local SDK configuration. - [Components](/developers/components) — Explore all available web components. # Android SDK integration > Integrate Frak into a native Android app with the Kotlin SDK, covering tracking, rewards, sharing, and referral deep links. import { Tabs, TabItem, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Android SDK The Frak Android SDK brings referral tracking, rewards, and the sharing sheet to a native Android app. It is written in Kotlin, callable from Java, and ships as two artifacts so an app that only needs tracking never links a web view. ## Requirements | Item | Value | | --- | --- | | Minimum SDK | 24 (Android 7.0) | | Java / JVM target | 17 | | Language | Kotlin 2.2 language level, Java call sites supported | | License | Apache-2.0 | ## Install Two artifacts, released together: | Artifact | Contents | | --- | --- | | `id.frak.sdk:core` | Identity, config, rewards, interaction tracking, sharing links, app links. No UI, no web view. | | `id.frak.sdk:ui` | The sharing sheet. Depends on `core`. | ```kotlin title="app/build.gradle.kts" dependencies { implementation("id.frak.sdk:core:1.0.0") // Only if you show the sharing sheet implementation("id.frak.sdk:ui:1.0.0") } ``` Artifacts are published to Maven Central. Both ship in lockstep behind a `strictly` constraint, so take the same version for both — a mismatch fails resolution rather than linking two versions. From `1.0.0` the public surface follows semantic versioning. The SDK's own manifest declares the `INTERNET` permission and the `` entries needed to detect the Frak wallet app, so you do not add either by hand. It declares no activity and no intent filter: your app keeps ownership of its own deep links. ## Initialize Call `Frak.initialize` once, in `Application.onCreate` or in your launcher Activity's `onCreate` after `super.onCreate`. ```kotlin Frak.initialize( context = applicationContext, config = FrakConfig(merchantId = BuildConfig.FRAK_MERCHANT_ID) { metadata = FrakMetadata { name = "Your Store" currency = FrakCurrency.EUR homepageLink = "https://your-store.com" } deepLink = DeepLinkHandling.Automatic logLevel = FrakLogLevel.INFO }, ) ``` ```java Frak.initialize( getApplicationContext(), new FrakConfig.Builder(BuildConfig.FRAK_MERCHANT_ID) .metadata(new FrakMetadata.Builder() .name("Your Store") .currency(FrakCurrency.EUR) .homepageLink("https://your-store.com") .build()) .deepLink(DeepLinkHandling.Automatic) .logLevel(FrakLogLevel.INFO) .build()); ``` The Kotlin trailing-lambda form is sugar over the same `Builder`, not a second implementation. ### Configuration options | Option | Default | Meaning | | --- | --- | --- | | `merchantId` | `null` | Your merchant ID from the [business dashboard](https://business.frak.id/). When null, the merchant is resolved from `packageId` instead. | | `packageId` | `null` | Falls back to `context.packageName`. | | `metadata` | empty | Static merchant facts: `name`, `currency`, `lang`, `logoUrl`, `homepageLink`. | | `deepLink` | `Automatic` | `Automatic`, `Manual`, or `Disabled`. See [Referral deep links](#referral-deep-links). | | `trackingEnabled` | `true` | A hard floor. Setting it to `false` cannot be lifted at runtime. | | `logLevel` | `NONE` | `NONE`, `ERROR`, `WARN`, `INFO`, `DEBUG`. | | `logSink` | `null` | A `FrakLogSink` that replaces logcat. Must be thread-safe and must not throw. | `homepageLink` is the last fallback of the share link chain: without it, a store-wide share with no product and no explicit link has nothing to point at. ## The client `Frak.client` throws if the SDK is not initialized; `Frak.clientOrNull` returns null instead. Every namespace member is a `suspend` function. ```kotlin lifecycleScope.launch { val reward = Frak.client.rewards.best( RewardRequest { targetInteraction = "purchase" }, ) } ``` The client exposes `environment`, `anonymousId()`, `resetAnonymousId()`, `setTrackingEnabled()`, `isTrackingEnabled()`, and five namespaces: `config`, `rewards`, `sharing`, `tracking`, `appLink`. ### Calling from Java Every suspending member has a `CompletableFuture` twin named `*Async`. The work runs on the SDK's IO dispatcher and the future **completes on the main thread**, so a continuation can touch a `View` directly. ```java Frak.getClient().getRewards() .bestAsync(new RewardRequest.Builder().targetInteraction("purchase").build()) .thenAccept(reward -> banner.setText(reward == null ? "" : reward.getFormatted())); ``` ## Tracking ```kotlin // A confirmed order, on your order confirmation screen when (val result = Frak.client.tracking.purchase( customerId = "cust_123", orderId = "order_456", token = "a-unique-order-token", )) { is FrakResult.Success -> Log.i("frak", "order tracked") is FrakResult.Failure -> Log.w("frak", result.error.message) } // Any other interaction Frak.client.tracking.track(Interaction.custom("added_to_cart")) ``` `track` and `purchase` succeed once the event is **durable**, not once it is delivered. Events are queued on disk oldest-first and retried, so an offline device still reports later. `Interaction` is an opaque type built through static factories: ```kotlin Interaction.custom("checkout") Interaction.custom("checkout", mapOf("plan" to "pro")) Interaction.sharing() Interaction.arrival(referrerWallet, referrerClientId, referrerMerchantId, referralTimestamp) ``` You rarely build `arrival` yourself: `appLink.handleReferral` does it for you, and building a second one for the same link double-counts the arrival. ## Rewards ```kotlin val campaigns = Frak.client.rewards.campaigns() val best = Frak.client.rewards.best( RewardRequest { targetInteraction = "purchase" products = visibleProducts.map { product -> ProductDetails { productId = product.id name = product.title } } }, ) ``` Call `best` **once per screen for the whole visible product set**, not once per row: the cache is keyed on the encoded product list. Both calls accept a `forceRefresh` overload that skips the cache and the backoff. `RewardTier` is a sealed class with three arms: `Amount`, `Percentage`, and `Unknown`. Always give `when` an `Unknown` branch — a campaign whose payout shape your compiled binary predates degrades to it instead of failing the whole `best` call, so a server-side tier type added after you shipped costs you one unrenderable band, not the reward display. ## Configuration resolution ```kotlin val config = Frak.client.config.resolve() config.displayName config.displayLogoUrl ``` `resolve` is stale-while-revalidate with a five minute freshness window, so calling it on every screen is cheap. The resolved config is a read model: you read placements, component copy, and translations from it, and never construct one. See [Backend-driven configuration](/developers/concepts/backend-configuration/). ## Sharing ### Build a link yourself ```kotlin val link = Frak.client.sharing.buildLink( SharingRequest { products = listOf( SharingProduct(title = product.title, link = product.link) { imageUrl = product.imageUrl utmContent = product.id details = ProductDetails { productId = product.id name = product.title unitPrice = product.priceCents / 100.0 } }, ) targetInteraction = "purchase" placement = "product-page" }, ) ``` `buildLink` returns `null` only when there is nothing to link to (no `link`, no product link, and no `homepageLink`). It throws a `FrakError` when a link should have been buildable but was not, for example when tracking is disabled. `AttributionParams` (`utmSource`, `utmMedium`, `utmCampaign`, `utmContent`, `utmTerm`, `via`, `ref`) can be set per call and merges field by field over your merchant-level defaults. ### What the OS share sheet shows `SharingRequest` carries three optional overrides for the chooser Android raises when the user taps share: ```kotlin SharingRequest { targetInteraction = "purchase" shareTitle = "Ma sélection chez Your Store" shareText = "J'ai trouvé ça, ça peut t'intéresser" shareImageUrl = "https://your-store.com/product.jpg" } ``` They are the highest-precedence source: the sharing page's own copy is used when they are absent, and your merchant-level defaults below that. `shareImageUrl` is accepted for API symmetry but has no effect here — Android's chooser ships no preview image, only iOS renders one. ### The sharing sheet The `id.frak.sdk:ui` artifact adds a ready-made sheet. Its whole public surface is `FrakSharing`, `SharingResult`, and `FrakSharingDefaults`. ```kotlin private lateinit var sharing: FrakSharing override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // In onCreate, after super.onCreate. Not a property initializer: an Activity // has no ViewModelStore before that, and build() throws without one. sharing = FrakSharing.Builder(::onShareResult).build(this) } // When a share affordance becomes visible sharing.warm() // On the tap sharing.present(SharingRequest { targetInteraction = "purchase" }) ``` ```kotlin val sharing = remember { FrakSharing.Builder(::onShareResult) }.build() Button(onClick = { sharing.present(SharingRequest { targetInteraction = "purchase" }) }) { Text("Share and earn") } ``` The Compose `build()` warms the sheet on composition-enter, so there is no `warm()` call to place yourself. `Builder.heightFraction(Float)` tunes the sheet height. Values outside `0.3..1.0` are clamped and logged rather than thrown: a layout number must not crash your app. The default is `0.85`. `warm()` is cheap to call repeatedly, and `present` implies it. `Builder.language(String?)` sets the sheet's language as a BCP 47 tag (`"en"`, `"fr-CA"`), defaulting to the device locale. It selects among the translations the page ships rather than adding one, and an unknown tag falls back to the page's own default. It rides on the pre-warmed URL, so set it once per instance: a tag that changes between `warm()` and `present` costs the warm view, not the language. The sheet reports exactly once per session, through your callback: ```kotlin private fun onShareResult(result: SharingResult) { when (result) { is SharingResult.Shared -> Log.i("frak", "shared ${result.link}") is SharingResult.Copied -> Log.i("frak", "copied ${result.link}") SharingResult.InstallStarted -> Unit // informational only SharingResult.WalletOpened -> Unit // the wallet app was already installed and opened SharingResult.Dismissed -> Unit is SharingResult.Failed -> Log.w("frak", result.error.message) } } ``` `InstallStarted` is informational: it does not mean anything was installed, and it is not a cue to call `openFrakApp` again. ## Referral deep links `DeepLinkHandling.Automatic` (the default) registers an activity lifecycle observer that reads the inbound intent and calls `handleReferral` for you. Choose `Manual` to call it yourself, or `Disabled` to opt out entirely. Your app still declares its own intent filters for the domain or scheme you send referral links to: ```xml title="AndroidManifest.xml" ``` The `appLink` namespace covers the rest: ```kotlin Frak.client.appLink.handleReferral(url) // decode, guard self-referral, track the arrival Frak.client.appLink.isFrakAppInstalled() // synchronous, no async twin Frak.client.appLink.openFrakApp() // opens the wallet, or the Play Store listing Frak.client.appLink.installPageUrl(returnScheme, sessionId) ``` `handleReferral` returns whether a referral context was found. It is not a "stop routing" signal: your own navigation still runs. Test an inbound link without a real referral: ```bash adb shell am start -a android.intent.action.VIEW \ -d "https://your-store.com/product?fCtx=test_token_123" your.app.id ``` ## Consent and privacy The SDK ships no consent UI. Wire your consent platform to: ```kotlin Frak.client.setTrackingEnabled(false) // stops tracking and purges anything queued Frak.client.resetAnonymousId() // rotates the local identity ``` For Play Data Safety, three things leave the device and only three: | What | Play data type | | --- | --- | | Anonymous ID and the `customerId` you pass to `tracking.purchase` | Personal info, **User IDs** | | Referral and sharing events | App activity, **App interactions** | | `customerId`, `orderId`, and the checkout token | Financial info, **Purchase history** | No advertising ID, no `ANDROID_ID`, no install referrer, no location, no contacts. The anonymous ID is a per-install keypair held in the Android Keystore, non-exportable, and gone on uninstall, which is why it is declared as a user ID rather than a device ID. Two caveats worth knowing before you build a compliance story on `setTrackingEnabled`: the decision is written asynchronously, so a withdrawal lost to a process kill reverts to enabled on the next launch, and the web SDK has no equivalent switch today. ## Shutting down `Frak.shutdown()` cancels background work and unregisters the deep-link observer, after which `initialize` can run again. It is not a consent control: it records no decision. ## Next steps # CDN / Browser Integration > Load Frak from a CDN with a single script tag, configure it with window.FrakSetup, and drive it from plain JavaScript. import { Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # CDN integration No bundler, no build step: one script tag gives you the Frak web components and the full SDK on `window`. ## Prerequisites 1. A merchant account on the [Frak business dashboard](https://business.frak.id/) with your domain registered. The main domain is registered at sign-up; add subdomains under **Allowed Domains**. 2. Any HTML page you can add a script tag to. If you have not done that yet, start with the [Get started guide](/guides/). ## Which bundle | Bundle | URL | What it is | | --- | --- | --- | | Components | `https://sdk.frak.id/components.js` | The first-party CDN pointer. Registers the `` elements, boots the SDK, and exposes the SDK on `window.FrakSetup.core`. This is the one you want. | | Core only | `https://cdn.jsdelivr.net/npm/@frak-labs/core-sdk@1/cdn/bundle.js` | IIFE exposing `window.FrakSDK`. No UI, no auto-boot. Still served directly from jsDelivr, not on the pointer. Only for a page that drives the SDK entirely by hand. | The rest of this page uses the components bundle. Swap the host for `sdk-dev.frak.id` to load pre-release (`beta`) builds instead — its `onerror` fallback below follows to jsDelivr's `@beta` tag. This is the CDN host the bundle is fetched from; do not confuse it with the `env` config option further down, which targets the wallet/backend the SDK talks to once it is running. :::caution[The pointer always serves the latest release, majors included] `sdk.frak.id` redeploys within minutes of every release to `main`, with no way to pin it to a major version from the URL — a page pointed at it picks up a bundle that reads `config.env` while the page still sends `walletUrl` the moment that release ships. To freeze on a known major instead, skip the pointer and load jsDelivr directly: `https://cdn.jsdelivr.net/npm/@frak-labs/components@1` (drop the `onerror` fallback below, or point it at that same pinned URL). Check the release notes before a version bump either way. ::: ## 1. Set the config, then load the script The loader reads `window.FrakSetup.config` when it boots, so the config object must exist **before** the script tag runs. ```html title="index.html" ``` This is a classic deferred script, not `type="module"`. `sdk.frak.id` is a single-line `import()` shim behind a CDN pointer with a 5-minute cache, so a release reaches you in minutes instead of jsDelivr's 7-day floating-tag TTL. If it fails to load at all (network error, DNS, outage), `onerror` swaps in jsDelivr's floating tag instead — the pointer file is a single `import()`, so a failed load ran nothing and nothing double-runs. The preconnects are asymmetric on purpose: the pointer's own fetch is no-cors, so its `` must not carry `crossorigin`, while the jsDelivr fallback's `import()` is CORS-mode, so its `` does — a preconnected socket is only reused when the credentials mode matches. ### Config options | Field | Default | Meaning | | --- | --- | --- | | `env` | `"prod"` | The environment to run against: `"prod"`, `"dev"`, or `{ wallet, backend }`. | | `metadata.name` | none | Your application name, shown in modals and SSO. | | `metadata.merchantId` | resolved from your domain | Your merchant ID (UUID) from the dashboard. | | `metadata.currency` | `"eur"` | `"eur"`, `"usd"`, or `"gbp"`. | | `metadata.lang` | browser language | `"en"` or `"fr"`. | | `metadata.logoUrl` | none | Logo used by some components. | | `metadata.homepageLink` | none | Fallback link used by some components. | | `domain` | `window.location.host` | Override only if the page host differs from your registered domain. | | `customizations.css` | none | URL of a stylesheet applied to the modals and components. | | `customizations.i18n` | none | Inline translation overrides, per locale or flat. | | `waitForBackendConfig` | `true` | Wait for the backend configuration before rendering components. | | `attribution` | none | Default UTM, `via`, and `ref` values appended to sharing URLs. | | `preload` | `["sharing"]` | Views preloaded inside the listener iframe. Pass `[]` to disable. | See [Configuration](/developers/concepts/configuration/) and [FrakSetup](/developers/components/frak-setup/) for the full reference. ## 2. Drop in the components The loader watches the DOM, so an element added at any time registers itself: ```html ``` Every element and attribute is documented in the [components reference](/developers/components/). ## 3. Call the SDK from your own code Once booted, the SDK publishes two things: - `window.FrakSetup.client`, the client instance - `window.FrakSetup.core`, every SDK function and action The client is created asynchronously, so wait for the `frak:client` event before using it: ```html ``` ### Track a purchase `trackPurchaseStatus` is the exception: it takes no client, so you can call it as soon as the SDK is loaded. ```html ``` Rewards are only released once your backend confirms the order with a signed webhook. See [Validate purchases from your backend](/guides/platforms/custom/backend/). ### Events | Event | Target | Detail | Fired when | | --- | --- | --- | --- | | `frak:client` | `window` | none | The client is ready, `window.FrakSetup.client` is set | | `frak:config` | `window` | the resolved config | The backend configuration is resolved or refreshed | | `frak:referral-success` | `window` | none | An inbound referral was processed successfully | ### The share query parameter The loader also handles `?frakAction=share` on page load, with optional `link`, `products`, and `placement` parameters. It opens the sharing flow and then strips those parameters from the URL. That is how a link out of an email or a QR code can open the share sheet directly. ## Advanced: the core-only bundle If you do not want the components at all, load the core bundle and create the client yourself. This bundle is not on the `sdk.frak.id` pointer: it is still loaded straight from jsDelivr, so pin the major the same way you would have pinned the components bundle before: ```html ``` `window.FrakSDK` carries the same functions and actions as `window.FrakSetup.core`. It exists only for this bundle: the components bundle is ESM and exposes no global. ## Next steps # iOS SDK integration > Integrate Frak into a native iOS app with the Swift SDK, covering tracking, rewards, the SwiftUI sharing sheet, and referral deep links. import { Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # iOS SDK The Frak iOS SDK brings referral tracking, rewards, and the sharing sheet to a native iOS app. It is a Swift package with zero third-party dependencies, split in two products so an app that only needs tracking never links a web view. ## Requirements | Item | Value | | --- | --- | | Minimum iOS | 15 | | Minimum Xcode | 16 (the package declares Swift 6 language mode) | | Dependencies | None | | License | Apache-2.0 | ## Install In Xcode: **File → Add Package Dependencies**, then enter `https://github.com/frak-id/frak-ios-sdk`. Or in a `Package.swift`: ```swift title="Package.swift" dependencies: [ .package(url: "https://github.com/frak-id/frak-ios-sdk.git", exact: "1.0.0") ], targets: [ .target(name: "YourApp", dependencies: [ .product(name: "FrakSDK", package: "frak-ios-sdk"), // Only if you show the sharing sheet .product(name: "FrakSDKUI", package: "frak-ios-sdk"), ]) ] ``` | Product | Contents | | --- | --- | | `FrakSDK` | Identity, config, rewards, interaction tracking, sharing links, app links. No UI, no web view. | | `FrakSDKUI` | Adds the sharing sheet, a `WKWebView` inside a SwiftUI sheet. Depends on `FrakSDK`. | The dependency only runs one way, so taking `FrakSDK` alone links no web view. `FrakSDKVersion.current` returns the version the SDK reports on every request, which is useful in a bug report. It is the one public type absent from the [API reference](/developers/references/ios/): Swift's symbol graph extractor drops any declaration whose name starts with the module name followed by `Version`, since that is the shape of the globals Clang generates for a framework. ## Declare the wallet schemes Add this to your `Info.plist` before anything else. It is what lets your app talk to the Frak wallet: without it, iOS answers "not installed" to every probe, so `isFrakAppInstalled()` returns false, the sharing sheet's install detection never fires, and the handoff to the wallet silently degrades to the App Store every time. ```xml title="Info.plist" LSApplicationQueriesSchemes frakwallet frakwallet-dev ``` List both: `frakwallet` is the production wallet and `frakwallet-dev` is the one you test against on a dev build. Declaring only production makes a locally built dev wallet undetectable, which is exactly the build a first integration runs against. You also declare the URL scheme (or Universal Link) your own app receives referral links on. See [Referral deep links](#referral-deep-links) below. ## Initialize Call `Frak.initialize` once, at app startup: ```swift import FrakSDK @main struct YourApp: App { init() { Frak.initialize( FrakConfig( merchantId: "your-merchant-id", metadata: FrakMetadata( name: "Your Store", currency: .eur, homepageLink: "https://your-store.com" ), logLevel: .info ) ) } var body: some Scene { WindowGroup { ContentView() } } } ``` ### Configuration options | Option | Default | Meaning | | --- | --- | --- | | `merchantId` | `nil` | Your merchant ID from the [business dashboard](https://business.frak.id/). When nil, the merchant is resolved from `bundleId`. | | `bundleId` | `nil` | Falls back to `Bundle.main.bundleIdentifier`. | | `metadata` | empty | `name`, `currency`, `lang`, `logoURL`, `homepageLink`. | | `deepLink` | `.manual` | `.manual` or `.disabled`. iOS has no automatic mode, see below. | | `trackingEnabled` | `true` | A hard floor. When false, no anonymous ID is ever minted. | | `logLevel` | `.none` | `.none`, `.error`, `.warn`, `.info`, `.debug`. | | `logSink` | `nil` | A `FrakLogSink` that replaces the default logger. | `homepageLink` is the last fallback of the share link chain: without it, a store-wide share with no product and no explicit link has nothing to point at. ## The client `Frak.client` is throwing-synchronous, `Frak.clientOrNull` returns an optional instead. Every namespace member on the client is `async`. ```swift private func client() -> FrakClient? { try? Frak.client } let reward = try await client()?.rewards.best(RewardRequest(targetInteraction: "purchase")) ``` The client exposes `environment`, `anonymousId`, `resetAnonymousId()`, `setTrackingEnabled(_:)`, `isTrackingEnabled()`, and five namespaces: `config`, `rewards`, `sharing`, `tracking`, `appLink`. The snippets below assume you already hold a client, for example with `let client = try Frak.client`. ## Tracking ```swift // A confirmed order, on your order confirmation screen let result = await client.tracking.purchase( customerId: "cust_123", orderId: "order_456", token: "a-unique-order-token" ) switch result { case .success: print("order tracked") case .failure(let error): print(error.localizedDescription) } // Any other interaction await client.tracking.track(.custom("added_to_cart")) ``` Both calls return a `Result` rather than throwing, and both succeed once the event is **durable**, not once it is delivered. Events are written to a queue on disk and drained with retries, so an offline device still reports later. `Interaction` is built through static factories: ```swift Interaction.custom("checkout") Interaction.custom("checkout", data: ["plan": "pro"]) Interaction.sharing() Interaction.arrival(referrerWallet: nil, referrerClientId: nil, referrerMerchantId: nil, referralTimestamp: nil) ``` You rarely build `arrival` yourself: `appLink.handleReferral` does it for you. ## Rewards ```swift let campaigns = try await client.rewards.campaigns() let best = try await client.rewards.best( RewardRequest( targetInteraction: "purchase", products: visibleProducts.map { ProductDetails(productId: $0.id, name: $0.title) } ) ) ``` `best` takes a `RewardRequest` value rather than a parameter list, so a field added later is additive on both platforms. `products` is a plain array: an empty one is sent as absent. Call `best` **once per screen for the whole visible product set**, not once per row: a single `BestReward` cannot be mapped back onto per-item rows, and the cache is keyed on the encoded product list. Both calls accept `forceRefresh: true` to skip the cache. `RewardTier` has three cases: `.amount`, `.percentage`, and `.unknown`. Always give `switch` an `.unknown` branch — a campaign whose payout shape your compiled binary predates degrades to it instead of failing the whole `best` call, so a server-side tier type added after you shipped costs you one unrenderable band, not the reward display. ## Configuration resolution ```swift let resolved = try await client.config.resolve() // Or observe changes for await config in await client.config.updates { // react to a refreshed merchant config } ``` `resolve` is stale-while-revalidate, `current` returns the last resolved config without a call, and `updates` is a multicast stream that replays the latest value. See [Backend-driven configuration](/developers/concepts/backend-configuration/). ## Sharing ### Build a link yourself ```swift let link = try await client.sharing.buildLink( SharingRequest( products: [ SharingProduct( title: product.title, link: product.link, imageURL: product.imageURL, utmContent: product.id, details: ProductDetails(productId: product.id, name: product.title) ) ], targetInteraction: "purchase", placement: "product-page" ) ) ``` `buildLink` returns `nil` only when there is nothing to link to (no request link, no product link, and no homepage fallback). It throws a `FrakError` when a link should have been buildable but was not, for example when tracking is disabled. `AttributionParams` (`utmSource`, `utmMedium`, `utmCampaign`, `utmContent`, `utmTerm`, `via`, `ref`) can be passed per call and merges over your merchant-level defaults. ### What the OS share sheet shows `SharingRequest` carries three optional overrides for the `UIActivityViewController` the sheet raises: ```swift SharingRequest( targetInteraction: "purchase", shareTitle: "My picks at Your Store", shareText: "Found this, thought of you", shareImageURL: "https://your-store.com/product.jpg" ) ``` They are the highest-precedence source: the sharing page's own copy is used when they are absent, and your merchant-level defaults below that. `shareImageURL` must be `https` and is fetched under a 2 MB cap and a tap deadline — a preview that does not arrive in time is dropped, and the share still goes out with its link and attribution intact. ### The sharing sheet `FrakSDKUI` adds a single view modifier: ```swift import FrakSDKUI struct ProductView: View { @State private var isSharing = false var body: some View { Button("Share and earn") { isSharing = true } .frakSharingSheet(isPresented: $isSharing, request: request) { result in switch result { case .shared(let link): print("shared \(link)") case .copied(let link): print("copied \(link)") case .installStarted: break // informational only case .walletOpened: break // the wallet was installed and opened case .dismissed: break case .failed(let error): print(error.localizedDescription) } } } } ``` The callback fires once per presentation, with the most significant outcome. Ranked lowest to highest: `failed`, `dismissed`, `shared` and `copied`, `installStarted`, `walletOpened`. So a user who installs the wallet and then swipes the sheet away still reports the install, not the dismissal. ### Tuning the sheet ```swift .frakSharingSheet( isPresented: $isSharing, request: request, configuration: FrakSharingConfiguration( heightFraction: 0.9, install: .overlay(.init(position: .bottomRaised)) ) ) { result in // handle SharingResult } ``` | Option | Default | Meaning | | --- | --- | --- | | `heightFraction` | `0.85` | Sheet height, clamped to `0.3...1.0`. | | `install` | `.storeProductPage` | `.storeProductPage` raises a modal `SKStoreProductViewController`; `.overlay` shows an `SKOverlay` banner that does not cover the sheet. | | `detectInstall` | `true` | Polls for the wallet becoming installable while the store surface is up, then hands off and reports `.walletOpened`. | | `language` | device locale | Sheet language as a BCP 47 tag (`"en"`, `"fr-CA"`). Selects among the translations the page ships; an unknown tag falls back to the page's own default. Part of the pre-warmed URL, so a tag that changes between warm-up and tap costs the warm view, not the language. | Install detection relies on the same `LSApplicationQueriesSchemes` entry that `isFrakAppInstalled()` needs. Without it, neither works. ## Referral deep links iOS offers no automatic mode: nothing lets a library install itself in front of your app's own URL routing. Wire it yourself: ```swift .onOpenURL { url in Task { await Frak.clientOrNull?.appLink.handleReferral(url) } } ``` `handleReferral` returns whether the URL carried a Frak referral context. It is not a "stop routing" signal, so keep navigating either way. The rest of the namespace: ```swift await client.appLink.isFrakAppInstalled() await client.appLink.openFrakApp() // .openedApp, .openedStore, or .failed try await client.appLink.installPageURL(returnScheme: "yourapp", sessionId: sessionId) ``` `Frak.parseReferralLink(_:)` is static and pure, so you can decode a link before the SDK is initialized. ### Info.plist On top of the [wallet schemes](#declare-the-wallet-schemes), declare the scheme your app receives referral links on: ```xml title="Info.plist" CFBundleURLTypes CFBundleURLName com.your-company.your-app CFBundleTypeRole Editor CFBundleURLSchemes yourapp ``` To receive `https://` referral links instead of a custom scheme, add the Associated Domains capability and publish an `apple-app-site-association` file for your domain. That part is standard Universal Links setup and the SDK does not do it for you. ## Consent and privacy The SDK ships no consent UI. Wire your consent flow to: ```swift await client.setTrackingEnabled(false) // stops tracking and purges anything queued await client.resetAnonymousId() // rotates the local identity ``` Both products ship a `PrivacyInfo.xcprivacy`. It declares three collected data types, all linked to the user, none used for tracking: | Data type | What it covers | | --- | --- | | User ID | The anonymous ID and the `customerId` you pass to `tracking.purchase`. | | Purchase history | `customerId`, `orderId`, and the checkout token. | | Product interaction | Arrival, sharing, and custom interactions. | `NSPrivacyTracking` is `false`: no ad network is in the SDK path. ## Next steps # Installation via Package Manager > Install the Frak SDK and web components from npm, configure them once, and call the actions from TypeScript. import { Tabs, TabItem, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Installation via package manager For any project with a bundler: install the packages, set the config in a module that runs first, and import the components you use. ## Prerequisites 1. A package manager (npm, yarn, pnpm, or bun) and a bundler. 2. A merchant account on the [Frak business dashboard](https://business.frak.id/) with your domain registered. The main domain is registered at sign-up; add subdomains under **Allowed Domains**. If you have not done that yet, start with the [Get started guide](/guides/). ## 1. Install | Package | What it gives you | | --- | --- | | `@frak-labs/components` | The `` web components. Importing one registers it and boots the SDK. | | `@frak-labs/core-sdk` | The client and the actions, for anything you drive yourself. | ```bash npm install @frak-labs/components @frak-labs/core-sdk ``` ```bash yarn add @frak-labs/components @frak-labs/core-sdk ``` ```bash pnpm add @frak-labs/components @frak-labs/core-sdk ``` ```bash bun add @frak-labs/components @frak-labs/core-sdk ``` ## 2. Configure Put the config in its own module so it runs before anything imports a component: ```ts title="frak-setup.ts" import type { FrakWalletSdkConfig } from "@frak-labs/core-sdk"; declare global { interface Window { FrakSetup: { config?: FrakWalletSdkConfig }; } } window.FrakSetup = { config: { metadata: { name: "Your Store", currency: "eur", }, }, }; ``` Every field is listed on the [FrakSetup reference](/developers/components/frak-setup/) and in [Configuration](/developers/concepts/configuration/). ## 3. Register the components Import your config module first, then each component you use. The imports are side-effectful: they register the custom element and boot the SDK from `window.FrakSetup.config`. ```ts title="main.ts" import "./frak-setup"; import "@frak-labs/components/banner"; import "@frak-labs/components/buttonShare"; import "@frak-labs/components/postPurchase"; ``` Available subpaths: `banner`, `buttonShare`, `buttonWallet`, `openInApp`, `postPurchase`. There is no root import, so import the subpath you need. Then use the elements in your markup: ```html ``` ## 4. Call the actions Actions live in `@frak-labs/core-sdk/actions`. All of them except `trackPurchaseStatus` take the client as their first argument, and the client is published on `window.FrakSetup.client` once the SDK is ready: ```ts import { displayModal, watchWalletStatus } from "@frak-labs/core-sdk/actions"; import type { FrakClient } from "@frak-labs/core-sdk"; function waitForClient(): Promise { if (window.FrakSetup?.client) return Promise.resolve(window.FrakSetup.client); return new Promise((resolve) => { window.addEventListener( "frak:client", () => resolve(window.FrakSetup.client as FrakClient), { once: true } ); }); } const client = await waitForClient(); await watchWalletStatus(client, (status) => { console.log(status.key === "connected" ? status.wallet : "not connected"); }); await displayModal(client, { steps: { login: {}, final: { action: { key: "reward" } }, }, }); ``` ### Track a purchase ```ts import { trackPurchaseStatus } from "@frak-labs/core-sdk/actions"; await trackPurchaseStatus({ customerId: "cust_123", orderId: "order_456", token: "a-unique-order-token", }); ``` Rewards are only released once your backend confirms the order with a signed webhook. See [Validate purchases from your backend](/guides/platforms/custom/backend/). ### What is available | Action | Purpose | | --- | --- | | `watchWalletStatus` | Current wallet status, plus every change | | `displayModal` | Open a modal built from steps (`login`, `final`, and more) | | `displaySharingPage` | Open the sharing page directly | | `sendInteraction` | Send an interaction, fire and forget | | `trackPurchaseStatus` | Register an order so a confirmed sale can pay a reward | | `referralInteraction`, `processReferral`, `setupReferral` | Handle an inbound referral | | `getMerchantInformation` | Your merchant data as resolved by the backend | | `getUserReferralStatus`, `getMergeToken` | Referral state and wallet merge token | | `openSso`, `prepareSso`, `prepareSsoUrl` | Single sign-on flows | | `siweAuthenticate` | Sign-In with Ethereum | | `sendTransaction` | Ask the wallet to send a transaction | | `modalBuilder` | Fluent builder for modal steps | Full signatures live in the [generated SDK reference](/developers/references/readme/). ### Other entry points `@frak-labs/core-sdk` also exposes `/rewards` and `/identity` subpaths, and `/bundle` (index plus actions in one import) for CDN-style consumption. ## Advanced: create the client yourself If you do not use the components package, create the client by hand. Call `setupClient` **once** and reuse the promise: each call recreates the listener iframe. ```ts title="frak-client.ts" import { setupClient, type FrakWalletSdkConfig } from "@frak-labs/core-sdk"; const config: FrakWalletSdkConfig = { metadata: { name: "Your Store" }, }; let clientPromise: ReturnType | undefined; export function getFrakClient() { clientPromise ??= setupClient({ config }); return clientPromise; } ``` ## Next steps # React Integration > Add Frak to a React app, with the web components for the UI and the React SDK hooks for programmatic control. import { Tabs, TabItem, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # React integration There are two layers, and most apps use both: - **The web components.** Drop ``, ``, and `` straight into your JSX. No provider, no hooks. Start here. - **`@frak-labs/react-sdk`.** Providers and hooks for custom flows: wallet status, modals, referrals, SSO, transactions. ## Prerequisites 1. A React 18 or 19 project. 2. A merchant account on the [Frak business dashboard](https://business.frak.id/) with your domain registered. The main domain is registered at sign-up; add subdomains under **Allowed Domains**. If you have not done that yet, start with the [Get started guide](/guides/). ## The components in JSX Install `@frak-labs/components`, set the config in its own module, and import the components you use before rendering. The [package manager guide](/developers/integration/javascript/) covers that setup, and [Add Frak to a custom website](/guides/platforms/custom/web/) shows a full React example including the TypeScript declaration for the `` tags. ## The React SDK ### 1. Install `@tanstack/react-query` and `viem` are peer dependencies: the hooks are React Query queries and mutations, and the SDK ships no `QueryClient` of its own. ```bash npm install @frak-labs/react-sdk @tanstack/react-query viem ``` ```bash yarn add @frak-labs/react-sdk @tanstack/react-query viem ``` ```bash pnpm add @frak-labs/react-sdk @tanstack/react-query viem ``` ```bash bun add @frak-labs/react-sdk @tanstack/react-query viem ``` ### 2. Set up the providers Three providers, in this order: your `QueryClientProvider`, then `FrakConfigProvider` (holds the config), then `FrakIFrameClientProvider` (creates the listener iframe and the client). ```tsx twoslash title="FrakProvider.tsx" // @noErrors // [!include ~/snippets/integration/FrakProvider.tsx] ``` Wrap your app with it: ```tsx twoslash title="App.tsx" // @noErrors import { FrakProvider } from './FrakProvider'; function App() { return ( {/* Your app content */} ); } export default App; ``` The config takes the same fields as everywhere else. See [FrakSetup](/developers/components/frak-setup/) and [Configuration](/developers/concepts/configuration/). ### 3. Read the wallet status ```tsx twoslash title="WalletStatus.tsx" // @noErrors // [!include ~/snippets/integration/react-app.tsx:wallet-status] ``` ### 4. Open a modal ```tsx twoslash title="LoginButton.tsx" // @noErrors // [!include ~/snippets/integration/react-app.tsx:login-button] ``` ### 5. Put it together ```tsx twoslash // @noErrors // [!include ~/snippets/integration/react-app.tsx:app] ``` ```tsx twoslash // @noErrors // [!include ~/snippets/integration/react-app.tsx] ``` ```tsx twoslash // @noErrors // [!include ~/snippets/integration/FrakProvider.tsx] ``` ## Every hook | Hook | Returns | What it does | | --- | --- | --- | | `useWalletStatus()` | query | Current wallet status, kept in sync | | `useDisplayModal()` | mutation | Open a modal from steps, with an optional `placement` | | `useDisplaySharingPage()` | mutation | Open the sharing page | | `useReferralInteraction()` | value | Processes an inbound referral once the client is ready, returns the state or an error | | `useSetupReferral()` | side effect | Wires referral handling, emits `frak:referral-success` | | `useGetMerchantInformation()` | query | Your merchant data as resolved by the backend | | `useGetUserReferralStatus()` | query | The user's referral state | | `useGetMergeToken()` | query | Token used to merge a wallet | | `useSiweAuthenticate()` | mutation | Sign-In with Ethereum | | `useSendTransactionAction()` | mutation | Ask the wallet to send a transaction | | `useOpenSso()` | mutation | Open the SSO flow | | `usePrepareSso(params)` | query | Prepare an SSO session | | `usePrepareSsoUrl(params)` | query | Build the SSO URL ahead of time, so the open is a direct user gesture and dodges popup blockers | | `useFrakClient()` | value | The raw client, or `undefined` before it is ready | | `useFrakConfig()` | value | The resolved config. Throws outside a `FrakConfigProvider` | Most mutation hooks take an optional `{ mutations }` object of React Query options, and most query hooks take `{ query }`. Two exceptions: `useWalletStatus()` takes no argument, and `usePrepareSso(params)` takes the SSO parameters directly. Full signatures live in the [generated SDK reference](/developers/references/readme/). ## Handle an inbound referral One hook is enough on the page a referred visitor lands on: ```tsx import { useReferralInteraction } from "@frak-labs/react-sdk"; export function ReferralHandler() { const state = useReferralInteraction(); // "idle" | "processing" | a referral state | an Error return null; } ``` ## Track a purchase Purchase tracking has no hook: call the action, which needs no client. ```tsx import { trackPurchaseStatus } from "@frak-labs/core-sdk/actions"; await trackPurchaseStatus({ customerId: "cust_123", orderId: "order_456", token: "a-unique-order-token", }); ``` Rewards are only released once your backend confirms the order with a signed webhook. See [Validate purchases from your backend](/guides/platforms/custom/backend/). ## Next steps # SDK Reference > Generated API reference for every Frak SDK, across web, Android and iOS. import { CardGrid, LinkCard } from '@astrojs/starlight/components'; # SDK Reference Symbol-level reference for every Frak SDK, generated from the source of [`frak-id/wallet`](https://github.com/frak-id/wallet). If you are integrating for the first time, read the [Developers guides](/developers/) first: these pages document what exists, not how to wire it up. Each SDK has its own collapsed group in the sidebar, and search covers every symbol. The links below drop you at each package's usual entry point. ## About these pages Everything here is generated from doc comments in the SDK source and tracks the pinned SDK version exactly. Nothing is hand written, so corrections belong upstream in `frak-id/wallet`, not in this repository. # Android SDK ## Packages | Name | |---| | [id.frak.sdk](/developers/references/android/id-frak-sdk/) | | [id.frak.sdk.config](/developers/references/android/id-frak-sdk-config/) | | [id.frak.sdk.core](/developers/references/android/id-frak-sdk-core/) | | [id.frak.sdk.net](/developers/references/android/id-frak-sdk-net/) | | [id.frak.sdk.rewards](/developers/references/android/id-frak-sdk-rewards/) | | [id.frak.sdk.sharing](/developers/references/android/id-frak-sdk-sharing/) | | [id.frak.sdk.tracking](/developers/references/android/id-frak-sdk-tracking/) | | [id.frak.sdk.ui](/developers/references/android/id-frak-sdk-ui/) | # id.frak.sdk ## Types | Name | Summary | |---|---| | [AppLinkApi](/developers/references/android/id-frak-sdk/applinkapi/) | class [AppLinkApi](/developers/references/android/id-frak-sdk/applinkapi/)
Inbound referral links and the wallet app handoff. Obtained from [FrakClient.appLink](/developers/references/android/id-frak-sdk/frakclient/applink/). | | [ConfigApi](/developers/references/android/id-frak-sdk/configapi/) | class [ConfigApi](/developers/references/android/id-frak-sdk/configapi/)
Config resolution. Obtained from [FrakClient.config](/developers/references/android/id-frak-sdk/frakclient/config/). | | [Frak](/developers/references/android/id-frak-sdk/frak/) | object [Frak](/developers/references/android/id-frak-sdk/frak/)
Entry point. Call [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) once from `Application.onCreate`, then use [client](/developers/references/android/id-frak-sdk/frak/client/). | | [FrakClient](/developers/references/android/id-frak-sdk/frakclient/) | class [FrakClient](/developers/references/android/id-frak-sdk/frakclient/)
Everything the SDK can do. Obtained from [Frak.client](/developers/references/android/id-frak-sdk/frak/client/). Every suspending member has a `*Async` twin returning a [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html), since a Java caller cannot name a `Continuation`. | | [FrakSdkVersion](/developers/references/android/id-frak-sdk/fraksdkversion/) | object [FrakSdkVersion](/developers/references/android/id-frak-sdk/fraksdkversion/)
Version of this SDK build, sent on every request. `@JvmStatic val` rather than `const val`: a `const` is inlined into the merchant's bytecode and would report their compile-time version. | | [InternalFrakApi](/developers/references/android/id-frak-sdk/internalfrakapi/) | @[Target](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-target/index.html)(allowedTargets = [[AnnotationTarget.CLASS](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-l-a-s-s/index.html), [AnnotationTarget.PROPERTY](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-p-r-o-p-e-r-t-y/index.html), [AnnotationTarget.FUNCTION](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-f-u-n-c-t-i-o-n/index.html), [AnnotationTarget.CONSTRUCTOR](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-o-n-s-t-r-u-c-t-o-r/index.html)])
annotation class [InternalFrakApi](/developers/references/android/id-frak-sdk/internalfrakapi/)
Marks a declaration that is `public` only so the sibling `:frak-sdk-ui` module can see it, with no compatibility guarantee. Wired into binary-compatibility-validator's `nonPublicMarkers`, so marked types stay out of the committed `.api` dump. | | [OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/) | enum [OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/)> | | [RewardsApi](/developers/references/android/id-frak-sdk/rewardsapi/) | class [RewardsApi](/developers/references/android/id-frak-sdk/rewardsapi/)
Campaigns and reward selection. Obtained from [FrakClient.rewards](/developers/references/android/id-frak-sdk/frakclient/rewards/). | | [SharingApi](/developers/references/android/id-frak-sdk/sharingapi/) | class [SharingApi](/developers/references/android/id-frak-sdk/sharingapi/)
Share link construction. Obtained from [FrakClient.sharing](/developers/references/android/id-frak-sdk/frakclient/sharing/). | | [TrackingApi](/developers/references/android/id-frak-sdk/trackingapi/) | class [TrackingApi](/developers/references/android/id-frak-sdk/trackingapi/)
Interaction and purchase tracking. Obtained from [FrakClient.tracking](/developers/references/android/id-frak-sdk/frakclient/tracking/). | # id.frak.sdk.config ## Types | Name | Summary | |---|---| | [AttributionDefaults](/developers/references/android/id-frak-sdk-config/attributiondefaults/) | class [AttributionDefaults](/developers/references/android/id-frak-sdk-config/attributiondefaults/)
Merged by the backend over anything the SDK supplies. | | [BannerConfig](/developers/references/android/id-frak-sdk-config/bannerconfig/) | class [BannerConfig](/developers/references/android/id-frak-sdk-config/bannerconfig/) | | [ButtonShareConfig](/developers/references/android/id-frak-sdk-config/buttonshareconfig/) | class [ButtonShareConfig](/developers/references/android/id-frak-sdk-config/buttonshareconfig/) | | [ButtonWalletConfig](/developers/references/android/id-frak-sdk-config/buttonwalletconfig/) | class [ButtonWalletConfig](/developers/references/android/id-frak-sdk-config/buttonwalletconfig/) | | [FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/) | class [FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/)
What the backend knows about this merchant, as resolved by `GET /user/merchant/resolve`. | | [OpenInAppConfig](/developers/references/android/id-frak-sdk-config/openinappconfig/) | class [OpenInAppConfig](/developers/references/android/id-frak-sdk-config/openinappconfig/) | | [PostPurchaseConfig](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/) | class [PostPurchaseConfig](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/) | | [ResolvedComponents](/developers/references/android/id-frak-sdk-config/resolvedcomponents/) | class [ResolvedComponents](/developers/references/android/id-frak-sdk-config/resolvedcomponents/)
Every field nullable: absent means "fall through to the next tier", not "empty". | | [ResolvedPlacement](/developers/references/android/id-frak-sdk-config/resolvedplacement/) | class [ResolvedPlacement](/developers/references/android/id-frak-sdk-config/resolvedplacement/)
One placement's overrides. Tier 1 of the copy precedence. | | [ResolvedSdkConfig](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/) | class [ResolvedSdkConfig](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/)
The `sdkConfig` block of the resolve response. Wire-shaped: every field may be absent. | # AttributionDefaults class AttributionDefaults Merged by the backend over anything the SDK supplies. ## Properties | Name | Summary | |---|---| | [ref](/developers/references/android/id-frak-sdk-config/attributiondefaults/ref/) | val [ref](/developers/references/android/id-frak-sdk-config/attributiondefaults/ref/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmCampaign](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmcampaign/) | val [utmCampaign](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmcampaign/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmMedium](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmmedium/) | val [utmMedium](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmmedium/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmSource](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmsource/) | val [utmSource](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmsource/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmTerm](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmterm/) | val [utmTerm](/developers/references/android/id-frak-sdk-config/attributiondefaults/utmterm/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [via](/developers/references/android/id-frak-sdk-config/attributiondefaults/via/) | val [via](/developers/references/android/id-frak-sdk-config/attributiondefaults/via/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # ref val ref: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmCampaign val utmCampaign: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmMedium val utmMedium: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmSource val utmSource: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmTerm val utmTerm: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # via val via: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # BannerConfig class BannerConfig ## Properties | Name | Summary | |---|---| | [imageUrl](/developers/references/android/id-frak-sdk-config/bannerconfig/imageurl/) | val [imageUrl](/developers/references/android/id-frak-sdk-config/bannerconfig/imageurl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [inappCta](/developers/references/android/id-frak-sdk-config/bannerconfig/inappcta/) | val [inappCta](/developers/references/android/id-frak-sdk-config/bannerconfig/inappcta/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [inappDescription](/developers/references/android/id-frak-sdk-config/bannerconfig/inappdescription/) | val [inappDescription](/developers/references/android/id-frak-sdk-config/bannerconfig/inappdescription/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [inappTitle](/developers/references/android/id-frak-sdk-config/bannerconfig/inapptitle/) | val [inappTitle](/developers/references/android/id-frak-sdk-config/bannerconfig/inapptitle/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [referralCta](/developers/references/android/id-frak-sdk-config/bannerconfig/referralcta/) | val [referralCta](/developers/references/android/id-frak-sdk-config/bannerconfig/referralcta/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [referralDescription](/developers/references/android/id-frak-sdk-config/bannerconfig/referraldescription/) | val [referralDescription](/developers/references/android/id-frak-sdk-config/bannerconfig/referraldescription/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [referralTitle](/developers/references/android/id-frak-sdk-config/bannerconfig/referraltitle/) | val [referralTitle](/developers/references/android/id-frak-sdk-config/bannerconfig/referraltitle/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # imageUrl val imageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # inappCta val inappCta: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # inappDescription val inappDescription: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # inappTitle val inappTitle: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # referralCta val referralCta: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # referralDescription val referralDescription: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # referralTitle val referralTitle: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # ButtonShareConfig class ButtonShareConfig ## Properties | Name | Summary | |---|---| | [clickAction](/developers/references/android/id-frak-sdk-config/buttonshareconfig/clickaction/) | val [clickAction](/developers/references/android/id-frak-sdk-config/buttonshareconfig/clickaction/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [noRewardText](/developers/references/android/id-frak-sdk-config/buttonshareconfig/norewardtext/) | val [noRewardText](/developers/references/android/id-frak-sdk-config/buttonshareconfig/norewardtext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Copy for when there is no concrete reward to advertise (e.g. a percentage-only campaign). | | [text](/developers/references/android/id-frak-sdk-config/buttonshareconfig/text/) | val [text](/developers/references/android/id-frak-sdk-config/buttonshareconfig/text/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # clickAction val clickAction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # noRewardText val noRewardText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Copy for when there is no concrete reward to advertise (e.g. a percentage-only campaign). # text val text: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # ButtonWalletConfig class ButtonWalletConfig ## Properties | Name | Summary | |---|---| | [position](/developers/references/android/id-frak-sdk-config/buttonwalletconfig/position/) | val [position](/developers/references/android/id-frak-sdk-config/buttonwalletconfig/position/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # position val position: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # FrakResolvedConfig class FrakResolvedConfig What the backend knows about this merchant, as resolved by `GET /user/merchant/resolve`. ## Properties | Name | Summary | |---|---| | [currency](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/currency/) | val [currency](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/currency/): [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)?
May differ from [id.frak.sdk.core.FrakMetadata.currency](/developers/references/android/id-frak-sdk-core/frakmetadata/currency/); informational only, never used for formatting. | | [displayLogoUrl](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/displaylogourl/) | val [displayLogoUrl](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/displaylogourl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Logo to show alongside [displayName](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/displayname/), or null when the backend has none on file. | | [displayName](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/displayname/) | val [displayName](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/displayname/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Name to show a user: the `sdkConfig` override when the backend sent one, else name. | | [domain](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/domain/) | val [domain](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/domain/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Merchant's canonical domain, not whatever domain was queried. | | [hidden](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/hidden/) | val [hidden](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/hidden/): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | [lang](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/lang/) | val [lang](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/lang/): [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)?
Null when the backend sends a value this SDK's build does not recognise. | | [merchantId](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/merchantid/) | val [merchantId](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/merchantid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [name](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/name/) | val [name](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [sdkConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/sdkconfig/) | val [sdkConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/sdkconfig/): [ResolvedSdkConfig](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # currency val currency: [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)? May differ from [id.frak.sdk.core.FrakMetadata.currency](/developers/references/android/id-frak-sdk-core/frakmetadata/currency/); informational only, never used for formatting. # displayLogoUrl val displayLogoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Logo to show alongside [displayName](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/displayname/), or null when the backend has none on file. # displayName val displayName: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Name to show a user: the `sdkConfig` override when the backend sent one, else name. # domain val domain: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Merchant's canonical domain, not whatever domain was queried. # hidden val hidden: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) # lang val lang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? Null when the backend sends a value this SDK's build does not recognise. # merchantId val merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # name val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # sdkConfig val sdkConfig: [ResolvedSdkConfig](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/)? # OpenInAppConfig class OpenInAppConfig ## Properties | Name | Summary | |---|---| | [text](/developers/references/android/id-frak-sdk-config/openinappconfig/text/) | val [text](/developers/references/android/id-frak-sdk-config/openinappconfig/text/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # text val text: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # PostPurchaseConfig class PostPurchaseConfig ## Properties | Name | Summary | |---|---| | [badgeText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/badgetext/) | val [badgeText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/badgetext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [ctaNoRewardText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/ctanorewardtext/) | val [ctaNoRewardText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/ctanorewardtext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [ctaText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/ctatext/) | val [ctaText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/ctatext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [imageUrl](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/imageurl/) | val [imageUrl](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/imageurl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [refereeNoRewardText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/refereenorewardtext/) | val [refereeNoRewardText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/refereenorewardtext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [refereeText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/refereetext/) | val [refereeText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/refereetext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [referrerNoRewardText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/referrernorewardtext/) | val [referrerNoRewardText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/referrernorewardtext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [referrerText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/referrertext/) | val [referrerText](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/referrertext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # badgeText val badgeText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # ctaNoRewardText val ctaNoRewardText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # ctaText val ctaText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # imageUrl val imageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # refereeNoRewardText val refereeNoRewardText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # refereeText val refereeText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # referrerNoRewardText val referrerNoRewardText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # referrerText val referrerText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # ResolvedComponents class ResolvedComponents Every field nullable: absent means "fall through to the next tier", not "empty". ## Properties | Name | Summary | |---|---| | [banner](/developers/references/android/id-frak-sdk-config/resolvedcomponents/banner/) | val [banner](/developers/references/android/id-frak-sdk-config/resolvedcomponents/banner/): [BannerConfig](/developers/references/android/id-frak-sdk-config/bannerconfig/)? | | [buttonShare](/developers/references/android/id-frak-sdk-config/resolvedcomponents/buttonshare/) | val [buttonShare](/developers/references/android/id-frak-sdk-config/resolvedcomponents/buttonshare/): [ButtonShareConfig](/developers/references/android/id-frak-sdk-config/buttonshareconfig/)? | | [buttonWallet](/developers/references/android/id-frak-sdk-config/resolvedcomponents/buttonwallet/) | val [buttonWallet](/developers/references/android/id-frak-sdk-config/resolvedcomponents/buttonwallet/): [ButtonWalletConfig](/developers/references/android/id-frak-sdk-config/buttonwalletconfig/)? | | [openInApp](/developers/references/android/id-frak-sdk-config/resolvedcomponents/openinapp/) | val [openInApp](/developers/references/android/id-frak-sdk-config/resolvedcomponents/openinapp/): [OpenInAppConfig](/developers/references/android/id-frak-sdk-config/openinappconfig/)? | | [postPurchase](/developers/references/android/id-frak-sdk-config/resolvedcomponents/postpurchase/) | val [postPurchase](/developers/references/android/id-frak-sdk-config/resolvedcomponents/postpurchase/): [PostPurchaseConfig](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # banner val banner: [BannerConfig](/developers/references/android/id-frak-sdk-config/bannerconfig/)? # buttonShare val buttonShare: [ButtonShareConfig](/developers/references/android/id-frak-sdk-config/buttonshareconfig/)? # buttonWallet val buttonWallet: [ButtonWalletConfig](/developers/references/android/id-frak-sdk-config/buttonwalletconfig/)? # openInApp val openInApp: [OpenInAppConfig](/developers/references/android/id-frak-sdk-config/openinappconfig/)? # postPurchase val postPurchase: [PostPurchaseConfig](/developers/references/android/id-frak-sdk-config/postpurchaseconfig/)? # ResolvedPlacement class ResolvedPlacement One placement's overrides. Tier 1 of the copy precedence. ## Properties | Name | Summary | |---|---| | [components](/developers/references/android/id-frak-sdk-config/resolvedplacement/components/) | val [components](/developers/references/android/id-frak-sdk-config/resolvedplacement/components/): [ResolvedComponents](/developers/references/android/id-frak-sdk-config/resolvedcomponents/)? | | [targetInteraction](/developers/references/android/id-frak-sdk-config/resolvedplacement/targetinteraction/) | val [targetInteraction](/developers/references/android/id-frak-sdk-config/resolvedplacement/targetinteraction/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [translations](/developers/references/android/id-frak-sdk-config/resolvedplacement/translations/) | val [translations](/developers/references/android/id-frak-sdk-config/resolvedplacement/translations/): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)> | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # components val components: [ResolvedComponents](/developers/references/android/id-frak-sdk-config/resolvedcomponents/)? # targetInteraction val targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # translations val translations: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)> # ResolvedSdkConfig class ResolvedSdkConfig The `sdkConfig` block of the resolve response. Wire-shaped: every field may be absent. ## Properties | Name | Summary | |---|---| | [attribution](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/attribution/) | val [attribution](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/attribution/): [AttributionDefaults](/developers/references/android/id-frak-sdk-config/attributiondefaults/)? | | [components](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/components/) | val [components](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/components/): [ResolvedComponents](/developers/references/android/id-frak-sdk-config/resolvedcomponents/)?
Tier 2 of the copy precedence. | | [currency](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/currency/) | val [currency](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/currency/): [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)? | | [hidden](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/hidden/) | val [hidden](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/hidden/): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | [homepageLink](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/homepagelink/) | val [homepageLink](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/homepagelink/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [lang](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/lang/) | val [lang](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/lang/): [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? | | [logoUrl](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/logourl/) | val [logoUrl](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/logourl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [name](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/name/) | val [name](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [placements](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/placements/) | val [placements](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/placements/): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [ResolvedPlacement](/developers/references/android/id-frak-sdk-config/resolvedplacement/)>
Tier 1 of the copy precedence. | | [translations](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/translations/) | val [translations](/developers/references/android/id-frak-sdk-config/resolvedsdkconfig/translations/): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)> | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # attribution val attribution: [AttributionDefaults](/developers/references/android/id-frak-sdk-config/attributiondefaults/)? # components val components: [ResolvedComponents](/developers/references/android/id-frak-sdk-config/resolvedcomponents/)? Tier 2 of the copy precedence. # currency val currency: [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)? # hidden val hidden: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) # homepageLink val homepageLink: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # lang val lang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? # logoUrl val logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # name val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # placements val placements: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [ResolvedPlacement](/developers/references/android/id-frak-sdk-config/resolvedplacement/)> Tier 1 of the copy precedence. # translations val translations: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)> # id.frak.sdk.core ## Types | Name | Summary | |---|---| | [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) | enum [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/)>
How inbound links carrying an `fCtx` reach the SDK. | | [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/) | class [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/)
Everything the SDK needs to start, supplied once at [id.frak.sdk.Frak.initialize](/developers/references/android/id-frak-sdk/frak/initialize/). Never validated at construction; an unusable config surfaces later as [FrakError.MerchantResolutionFailed](/developers/references/android/id-frak-sdk-core/frakerror/merchantresolutionfailed/). | | [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) | enum [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)>
Currency a reward is advertised in. Closed set: backend rejects anything else with a 422. | | [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) | sealed interface [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/)
The Frak stage the SDK talks to. | | [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) | sealed class [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) : [Exception](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Exception.html)
Every failure the SDK can hand back, as one closed hierarchy. `CancellationException` is never wrapped into one of these, see `frakCall`. No default arguments anywhere: a sealed class's constructor is published, so a default would freeze a synthetic bridge into the `.api` dump. | | [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/) | enum [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)>
Language for merchant-configured copy. Only `en`/`fr` exist today. | | [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) | enum [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/)>
Logcat verbosity. Default [NONE](/developers/references/android/id-frak-sdk-core/frakloglevel/none/). Also gates [FrakConfig.logSink](/developers/references/android/id-frak-sdk-core/frakconfig/logsink/) volume, see [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/). | | [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/) | fun interface [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)
Receives SDK diagnostics, gated by [FrakConfig.logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/loglevel/). Replaces logcat once set. | | [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) | class [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/)
Static merchant-supplied facts, fixed at build time. Not the resolved backend config, see [id.frak.sdk.config.FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/). | | [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/) | sealed interface [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<out [T](/developers/references/android/id-frak-sdk-core/frakresult/)>
Outcome of a fire-and-forget call. Not `kotlin.Result`: merchants need the typed [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) arm. | | [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/) | class [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)
The purchase line item fields a campaign's `productScope` can target. Build with [Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/), or `ProductDetails { }` from Kotlin. Also returned by the SDK, on [id.frak.sdk.rewards.BestReward.matchedProducts](/developers/references/android/id-frak-sdk-rewards/bestreward/matchedproducts/), hence `equals`/`hashCode`. | ## Functions | Name | Summary | |---|---| | [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig-fun/) | fun [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig-fun/)(configure: [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/)
Kotlin sugar over [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) for the no-merchant-id form.
fun [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig-fun/)(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/)
Merchant id only: the shortest working config.
fun [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig-fun/)(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), configure: [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/)
Kotlin sugar over [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/), for the merchant-id form. | | [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata-fun/) | fun [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata-fun/)(configure: [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/)
Kotlin sugar over [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/). | | [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails-fun/) | fun [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails-fun/)(configure: [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)
Kotlin sugar over [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/). | # DeepLinkHandling enum DeepLinkHandling : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<DeepLinkHandling> How inbound links carrying an `fCtx` reach the SDK. ## Entries | | | |---|---| | [Automatic](/developers/references/android/id-frak-sdk-core/deeplinkhandling/automatic/) | [Automatic](/developers/references/android/id-frak-sdk-core/deeplinkhandling/automatic/)
The SDK watches host activities itself; calling [id.frak.sdk.AppLinkApi.handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) as well double-tracks the arrival. Android-only. | | [Manual](/developers/references/android/id-frak-sdk-core/deeplinkhandling/manual/) | [Manual](/developers/references/android/id-frak-sdk-core/deeplinkhandling/manual/)
Merchant calls [id.frak.sdk.AppLinkApi.handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) from their own router. | | [Disabled](/developers/references/android/id-frak-sdk-core/deeplinkhandling/disabled/) | [Disabled](/developers/references/android/id-frak-sdk-core/deeplinkhandling/disabled/) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-core/deeplinkhandling/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-core/deeplinkhandling/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): DeepLinkHandling
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-core/deeplinkhandling/values/) | fun [values](/developers/references/android/id-frak-sdk-core/deeplinkhandling/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<DeepLinkHandling>
Returns an array containing the constants of this enum type, in the order they're declared. | # Automatic Automatic The SDK watches host activities itself; calling [id.frak.sdk.AppLinkApi.handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) as well double-tracks the arrival. Android-only. # Disabled Disabled # Manual Manual Merchant calls [id.frak.sdk.AppLinkApi.handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) from their own router. # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # FrakConfig class FrakConfig Everything the SDK needs to start, supplied once at [id.frak.sdk.Frak.initialize](/developers/references/android/id-frak-sdk/frak/initialize/). Never validated at construction; an unusable config surfaces later as [FrakError.MerchantResolutionFailed](/developers/references/android/id-frak-sdk-core/frakerror/merchantresolutionfailed/). ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) | class [Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/)
`Builder()` exists alongside `Builder(merchantId)` because [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/merchantid/) is optional. The empty one is primary: a shared `constructor(String?)` would erase to the same JVM descriptor as `constructor(String)`. | ## Properties | Name | Summary | |---|---| | [deepLink](/developers/references/android/id-frak-sdk-core/frakconfig/deeplink/) | val [deepLink](/developers/references/android/id-frak-sdk-core/frakconfig/deeplink/): [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) | | [env](/developers/references/android/id-frak-sdk-core/frakconfig/env/) | val [env](/developers/references/android/id-frak-sdk-core/frakconfig/env/): [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/)
Merchants never set this; exists for Frak's own dev/local builds. | | [logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/loglevel/) | val [logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/loglevel/): [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) | | [logSink](/developers/references/android/id-frak-sdk-core/frakconfig/logsink/) | val [logSink](/developers/references/android/id-frak-sdk-core/frakconfig/logsink/): [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)? | | [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/merchantid/) | val [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/merchantid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Optional; when null, merchant is resolved from packageId instead. `merchantId` wins if both set. | | [metadata](/developers/references/android/id-frak-sdk-core/frakconfig/metadata/) | val [metadata](/developers/references/android/id-frak-sdk-core/frakconfig/metadata/): [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) | | [packageId](/developers/references/android/id-frak-sdk-core/frakconfig/packageid/) | val [packageId](/developers/references/android/id-frak-sdk-core/frakconfig/packageid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Null reads `context.packageName` at [id.frak.sdk.Frak.initialize](/developers/references/android/id-frak-sdk/frak/initialize/). `bundleId` on iOS. | | [trackingEnabled](/developers/references/android/id-frak-sdk-core/frakconfig/trackingenabled/) | val [trackingEnabled](/developers/references/android/id-frak-sdk-core/frakconfig/trackingenabled/): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)
Hard floor for tracking that [id.frak.sdk.FrakClient.setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) cannot lift at runtime. `false` also stops sharing, but config and reward resolution still run. | # FrakConfig() fun FrakConfig(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), configure: [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/) Kotlin sugar over [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/), for the merchant-id form. fun FrakConfig(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/) Merchant id only: the shortest working config. fun FrakConfig(configure: [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/) Kotlin sugar over [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) for the no-merchant-id form. # Builder class Builder `Builder()` exists alongside `Builder(merchantId)` because [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/merchantid/) is optional. The empty one is primary: a shared `constructor(String?)` would erase to the same JVM descriptor as `constructor(String)`. ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/builder/) | constructor()constructor(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [deepLink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/deeplink/) | var [deepLink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/deeplink/): [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) | | [env](/developers/references/android/id-frak-sdk-core/frakconfig/builder/env/) | var [env](/developers/references/android/id-frak-sdk-core/frakconfig/builder/env/): [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) | | [logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/builder/loglevel/) | var [logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/builder/loglevel/): [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) | | [logSink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/logsink/) | var [logSink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/logsink/): [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)? | | [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/merchantid/) | var [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/merchantid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [metadata](/developers/references/android/id-frak-sdk-core/frakconfig/builder/metadata/) | var [metadata](/developers/references/android/id-frak-sdk-core/frakconfig/builder/metadata/): [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) | | [packageId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/packageid/) | var [packageId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/packageid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [trackingEnabled](/developers/references/android/id-frak-sdk-core/frakconfig/builder/trackingenabled/) | var [trackingEnabled](/developers/references/android/id-frak-sdk-core/frakconfig/builder/trackingenabled/): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | ## Functions | Name | Summary | |---|---| | [build](/developers/references/android/id-frak-sdk-core/frakconfig/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-core/frakconfig/builder/build/)(): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/) | | [deepLink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/deeplink/) | fun [deepLink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/deeplink/)(deepLink: [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/)): FrakConfig.Builder | | [env](/developers/references/android/id-frak-sdk-core/frakconfig/builder/env/) | fun [env](/developers/references/android/id-frak-sdk-core/frakconfig/builder/env/)(env: [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/)): FrakConfig.Builder | | [logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/builder/loglevel/) | fun [logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/builder/loglevel/)(logLevel: [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/)): FrakConfig.Builder | | [logSink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/logsink/) | fun [logSink](/developers/references/android/id-frak-sdk-core/frakconfig/builder/logsink/)(logSink: [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)?): FrakConfig.Builder | | [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/merchantid/) | fun [merchantId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/merchantid/)(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): FrakConfig.Builder | | [metadata](/developers/references/android/id-frak-sdk-core/frakconfig/builder/metadata/) | fun [metadata](/developers/references/android/id-frak-sdk-core/frakconfig/builder/metadata/)(metadata: [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/)): FrakConfig.Builder | | [packageId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/packageid/) | fun [packageId](/developers/references/android/id-frak-sdk-core/frakconfig/builder/packageid/)(packageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): FrakConfig.Builder | | [trackingEnabled](/developers/references/android/id-frak-sdk-core/frakconfig/builder/trackingenabled/) | fun [trackingEnabled](/developers/references/android/id-frak-sdk-core/frakconfig/builder/trackingenabled/)(trackingEnabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): FrakConfig.Builder | # build fun build(): [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/) # Builder constructor() constructor(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # deepLink fun deepLink(deepLink: [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/)): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var deepLink: [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) # env fun env(env: [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/)): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var env: [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) # logLevel fun logLevel(logLevel: [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/)): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var logLevel: [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) # logSink fun logSink(logSink: [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)?): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var logSink: [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)? # merchantId fun merchantId(merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # metadata fun metadata(metadata: [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/)): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var metadata: [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) # packageId fun packageId(packageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var packageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # trackingEnabled fun trackingEnabled(trackingEnabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [FrakConfig.Builder](/developers/references/android/id-frak-sdk-core/frakconfig/builder/) var trackingEnabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) # deepLink val deepLink: [DeepLinkHandling](/developers/references/android/id-frak-sdk-core/deeplinkhandling/) # env val env: [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) Merchants never set this; exists for Frak's own dev/local builds. # logLevel val logLevel: [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) # logSink val logSink: [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/)? # merchantId val merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Optional; when null, merchant is resolved from packageId instead. `merchantId` wins if both set. # metadata val metadata: [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) # packageId val packageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Null reads `context.packageName` at [id.frak.sdk.Frak.initialize](/developers/references/android/id-frak-sdk/frak/initialize/). `bundleId` on iOS. # trackingEnabled val trackingEnabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) Hard floor for tracking that [id.frak.sdk.FrakClient.setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) cannot lift at runtime. `false` also stops sharing, but config and reward resolution still run. # FrakCurrency enum FrakCurrency : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<FrakCurrency> Currency a reward is advertised in. Closed set: backend rejects anything else with a 422. ## Entries | | | |---|---| | [EUR](/developers/references/android/id-frak-sdk-core/frakcurrency/eur/) | [EUR](/developers/references/android/id-frak-sdk-core/frakcurrency/eur/) | | [USD](/developers/references/android/id-frak-sdk-core/frakcurrency/usd/) | [USD](/developers/references/android/id-frak-sdk-core/frakcurrency/usd/) | | [GBP](/developers/references/android/id-frak-sdk-core/frakcurrency/gbp/) | [GBP](/developers/references/android/id-frak-sdk-core/frakcurrency/gbp/) | ## Properties | Name | Summary | |---|---| | [wireValue](/developers/references/android/id-frak-sdk-core/frakcurrency/wirevalue/) | val [wireValue](/developers/references/android/id-frak-sdk-core/frakcurrency/wirevalue/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-core/frakcurrency/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-core/frakcurrency/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): FrakCurrency
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-core/frakcurrency/values/) | fun [values](/developers/references/android/id-frak-sdk-core/frakcurrency/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<FrakCurrency>
Returns an array containing the constants of this enum type, in the order they're declared. | # EUR EUR # GBP GBP # USD USD # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # wireValue val wireValue: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # FrakEnvironment sealed interface FrakEnvironment The Frak stage the SDK talks to. #### Inheritors | | |---| | [Production](/developers/references/android/id-frak-sdk-core/frakenvironment/production/) | | [Development](/developers/references/android/id-frak-sdk-core/frakenvironment/development/) | | [Custom](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/) | ## Types | Name | Summary | |---|---| | [Custom](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/) | class [Custom](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/) : FrakEnvironment
Explicit origin pair for local development. On an emulator use `10.0.2.2`, not `localhost`. Must be `https://`, or `http://` to a loopback/private-network host; anything else is swapped for an unreachable placeholder and surfaces as a generic [FrakError.Network](/developers/references/android/id-frak-sdk-core/frakerror/network/) on first use. | | [Development](/developers/references/android/id-frak-sdk-core/frakenvironment/development/) | data object [Development](/developers/references/android/id-frak-sdk-core/frakenvironment/development/) : FrakEnvironment | | [Production](/developers/references/android/id-frak-sdk-core/frakenvironment/production/) | data object [Production](/developers/references/android/id-frak-sdk-core/frakenvironment/production/) : FrakEnvironment | ## Properties | Name | Summary | |---|---| | [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/backend/) | abstract val [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/backend/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/wallet/) | abstract val [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/wallet/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [walletPackageId](/developers/references/android/id-frak-sdk-core/frakenvironment/walletpackageid/) | open val [walletPackageId](/developers/references/android/id-frak-sdk-core/frakenvironment/walletpackageid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Probed to decide whether install can deep link instead of going to the store. | | [walletScheme](/developers/references/android/id-frak-sdk-core/frakenvironment/walletscheme/) | open val [walletScheme](/developers/references/android/id-frak-sdk-core/frakenvironment/walletscheme/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # backend abstract val backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # Custom class Custom : [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) Explicit origin pair for local development. On an emulator use `10.0.2.2`, not `localhost`. Must be `https://`, or `http://` to a loopback/private-network host; anything else is swapped for an unreachable placeholder and surfaces as a generic [FrakError.Network](/developers/references/android/id-frak-sdk-core/frakerror/network/) on first use. ## Constructors | | | |---|---| | [Custom](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/custom/) | constructor(wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html))
Frak's own dev wallet package id and scheme.
constructor(wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), walletPackageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), walletScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/backend/) | open override val [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/backend/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/wallet/) | open override val [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/wallet/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [walletPackageId](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/walletpackageid/) | open override val [walletPackageId](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/walletpackageid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Probed to decide whether install can deep link instead of going to the store. | | [walletScheme](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/walletscheme/) | open override val [walletScheme](/developers/references/android/id-frak-sdk-core/frakenvironment/custom/walletscheme/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # backend open override val backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # Custom constructor(wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) Frak's own dev wallet package id and scheme. constructor(wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), walletPackageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), walletScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # wallet open override val wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # walletPackageId open override val walletPackageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Probed to decide whether install can deep link instead of going to the store. # walletScheme open override val walletScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # Development data object Development : [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) ## Properties | Name | Summary | |---|---| | [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/development/backend/) | open override val [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/development/backend/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/development/wallet/) | open override val [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/development/wallet/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | # backend open override val backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # wallet open override val wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # Production data object Production : [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) ## Properties | Name | Summary | |---|---| | [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/production/backend/) | open override val [backend](/developers/references/android/id-frak-sdk-core/frakenvironment/production/backend/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/production/wallet/) | open override val [wallet](/developers/references/android/id-frak-sdk-core/frakenvironment/production/wallet/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
No trailing slash. | | [walletPackageId](/developers/references/android/id-frak-sdk-core/frakenvironment/production/walletpackageid/) | open override val [walletPackageId](/developers/references/android/id-frak-sdk-core/frakenvironment/production/walletpackageid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Probed to decide whether install can deep link instead of going to the store. | | [walletScheme](/developers/references/android/id-frak-sdk-core/frakenvironment/production/walletscheme/) | open override val [walletScheme](/developers/references/android/id-frak-sdk-core/frakenvironment/production/walletscheme/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # backend open override val backend: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # wallet open override val wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # walletPackageId open override val walletPackageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Probed to decide whether install can deep link instead of going to the store. # walletScheme open override val walletScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # wallet abstract val wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) No trailing slash. # walletPackageId open val walletPackageId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Probed to decide whether install can deep link instead of going to the store. # walletScheme open val walletScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # FrakError sealed class FrakError : [Exception](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Exception.html) Every failure the SDK can hand back, as one closed hierarchy. `CancellationException` is never wrapped into one of these, see `frakCall`. No default arguments anywhere: a sealed class's constructor is published, so a default would freeze a synthetic bridge into the `.api` dump. #### Inheritors | | |---| | [NotInitialized](/developers/references/android/id-frak-sdk-core/frakerror/notinitialized/) | | [Network](/developers/references/android/id-frak-sdk-core/frakerror/network/) | | [BackingOff](/developers/references/android/id-frak-sdk-core/frakerror/backingoff/) | | [Server](/developers/references/android/id-frak-sdk-core/frakerror/server/) | | [Decoding](/developers/references/android/id-frak-sdk-core/frakerror/decoding/) | | [TrackingDisabled](/developers/references/android/id-frak-sdk-core/frakerror/trackingdisabled/) | | [AlreadyPresenting](/developers/references/android/id-frak-sdk-core/frakerror/alreadypresenting/) | | [MerchantResolutionFailed](/developers/references/android/id-frak-sdk-core/frakerror/merchantresolutionfailed/) | | [InternalFailure](/developers/references/android/id-frak-sdk-core/frakerror/internalfailure/) | ## Types | Name | Summary | |---|---| | [AlreadyPresenting](/developers/references/android/id-frak-sdk-core/frakerror/alreadypresenting/) | class [AlreadyPresenting](/developers/references/android/id-frak-sdk-core/frakerror/alreadypresenting/) : FrakError
[id.frak.sdk.ui.FrakSharing.present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) called while a sheet is already up on the same Activity. | | [BackingOff](/developers/references/android/id-frak-sdk-core/frakerror/backingoff/) | class [BackingOff](/developers/references/android/id-frak-sdk-core/frakerror/backingoff/)(val retryAfterSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) : FrakError
This resource is in a backoff window, so nothing was sent — unlike [Network](/developers/references/android/id-frak-sdk-core/frakerror/network/), where a request was attempted. Any cached copy is served in preference to raising this. | | [Decoding](/developers/references/android/id-frak-sdk-core/frakerror/decoding/) | class [Decoding](/developers/references/android/id-frak-sdk-core/frakerror/decoding/)(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) : FrakError
2xx response that couldn't be read as the expected shape; distinct from [Server](/developers/references/android/id-frak-sdk-core/frakerror/server/). | | [InternalFailure](/developers/references/android/id-frak-sdk-core/frakerror/internalfailure/) | class [InternalFailure](/developers/references/android/id-frak-sdk-core/frakerror/internalfailure/)(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) : FrakError
A failure inside the SDK: an unexpected error that escaped an internal boundary, or a device capability it needs and cannot get. Not [Decoding](/developers/references/android/id-frak-sdk-core/frakerror/decoding/), which describes a backend body. | | [Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/) | enum [Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[FrakError.Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/)>
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. wireValue is spelled identically on iOS. | | [MerchantResolutionFailed](/developers/references/android/id-frak-sdk-core/frakerror/merchantresolutionfailed/) | class [MerchantResolutionFailed](/developers/references/android/id-frak-sdk-core/frakerror/merchantresolutionfailed/)(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : FrakError
No merchant identified: bad `packageId`, or config has neither `merchantId` nor `packageId`. | | [Network](/developers/references/android/id-frak-sdk-core/frakerror/network/) | class [Network](/developers/references/android/id-frak-sdk-core/frakerror/network/)(cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)) : FrakError
DNS failure, no connectivity, TLS failure, timeout. cause carries the underlying [java.io.IOException](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html). | | [NotInitialized](/developers/references/android/id-frak-sdk-core/frakerror/notinitialized/) | class [NotInitialized](/developers/references/android/id-frak-sdk-core/frakerror/notinitialized/) : FrakError
Client method reached before [id.frak.sdk.Frak.initialize](/developers/references/android/id-frak-sdk/frak/initialize/). A `class`, not an `object`: `fillInStackTrace()` runs at construction, so a singleton would report the first call site. | | [Server](/developers/references/android/id-frak-sdk-core/frakerror/server/) | class [Server](/developers/references/android/id-frak-sdk-core/frakerror/server/)(val status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val code: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, val retryAfterSeconds: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?) : FrakError
Non-2xx status. code is the `{ success: false, error, code }` envelope's code when present, null for plain-text bodies. retryAfterSeconds only from a `Retry-After` header. | | [TrackingDisabled](/developers/references/android/id-frak-sdk-core/frakerror/trackingdisabled/) | class [TrackingDisabled](/developers/references/android/id-frak-sdk-core/frakerror/trackingdisabled/) : FrakError
A tracking call made while tracking is not permitted, by config or at runtime. Not raised by config or reward resolution, which are ungated. | ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-core/frakerror/kind-prop/) | val [kind](/developers/references/android/id-frak-sdk-core/frakerror/kind-prop/): [FrakError.Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/) | # AlreadyPresenting class AlreadyPresenting : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) [id.frak.sdk.ui.FrakSharing.present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) called while a sheet is already up on the same Activity. ## Constructors | | | |---|---| | [AlreadyPresenting](/developers/references/android/id-frak-sdk-core/frakerror/alreadypresenting/alreadypresenting/) | constructor() | # AlreadyPresenting constructor() # BackingOff class BackingOff(val retryAfterSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) This resource is in a backoff window, so nothing was sent — unlike [Network](/developers/references/android/id-frak-sdk-core/frakerror/network/), where a request was attempted. Any cached copy is served in preference to raising this. ## Constructors | | | |---|---| | [BackingOff](/developers/references/android/id-frak-sdk-core/frakerror/backingoff/backingoff/) | constructor(retryAfterSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) | ## Properties | Name | Summary | |---|---| | [retryAfterSeconds](/developers/references/android/id-frak-sdk-core/frakerror/backingoff/retryafterseconds/) | val [retryAfterSeconds](/developers/references/android/id-frak-sdk-core/frakerror/backingoff/retryafterseconds/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)
Seconds, like [Server.retryAfterSeconds](/developers/references/android/id-frak-sdk-core/frakerror/server/retryafterseconds/) and iOS's twin. Fractional: the floor is 0.5s. | # BackingOff constructor(retryAfterSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) # retryAfterSeconds val retryAfterSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) Seconds, like [Server.retryAfterSeconds](/developers/references/android/id-frak-sdk-core/frakerror/server/retryafterseconds/) and iOS's twin. Fractional: the floor is 0.5s. # Decoding class Decoding(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) 2xx response that couldn't be read as the expected shape; distinct from [Server](/developers/references/android/id-frak-sdk-core/frakerror/server/). ## Constructors | | | |---|---| | [Decoding](/developers/references/android/id-frak-sdk-core/frakerror/decoding/decoding/) | constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?)constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | # Decoding constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # InternalFailure class InternalFailure(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) A failure inside the SDK: an unexpected error that escaped an internal boundary, or a device capability it needs and cannot get. Not [Decoding](/developers/references/android/id-frak-sdk-core/frakerror/decoding/), which describes a backend body. ## Constructors | | | |---|---| | [InternalFailure](/developers/references/android/id-frak-sdk-core/frakerror/internalfailure/internalfailure/) | constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?)constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | # InternalFailure constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # Kind enum Kind : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<FrakError.Kind> Stable discriminator, one per arm. A `when` over Kind with an `else` survives a new arm; a `when` over the hierarchy does not. wireValue is spelled identically on iOS. ## Entries | | | |---|---| | [NOT_INITIALIZED](/developers/references/android/id-frak-sdk-core/frakerror/kind/not_initialized/) | [NOT_INITIALIZED](/developers/references/android/id-frak-sdk-core/frakerror/kind/not_initialized/) | | [NETWORK](/developers/references/android/id-frak-sdk-core/frakerror/kind/network/) | [NETWORK](/developers/references/android/id-frak-sdk-core/frakerror/kind/network/) | | [BACKING_OFF](/developers/references/android/id-frak-sdk-core/frakerror/kind/backing_off/) | [BACKING_OFF](/developers/references/android/id-frak-sdk-core/frakerror/kind/backing_off/) | | [SERVER](/developers/references/android/id-frak-sdk-core/frakerror/kind/server/) | [SERVER](/developers/references/android/id-frak-sdk-core/frakerror/kind/server/) | | [DECODING](/developers/references/android/id-frak-sdk-core/frakerror/kind/decoding/) | [DECODING](/developers/references/android/id-frak-sdk-core/frakerror/kind/decoding/) | | [TRACKING_DISABLED](/developers/references/android/id-frak-sdk-core/frakerror/kind/tracking_disabled/) | [TRACKING_DISABLED](/developers/references/android/id-frak-sdk-core/frakerror/kind/tracking_disabled/) | | [ALREADY_PRESENTING](/developers/references/android/id-frak-sdk-core/frakerror/kind/already_presenting/) | [ALREADY_PRESENTING](/developers/references/android/id-frak-sdk-core/frakerror/kind/already_presenting/) | | [MERCHANT_RESOLUTION_FAILED](/developers/references/android/id-frak-sdk-core/frakerror/kind/merchant_resolution_failed/) | [MERCHANT_RESOLUTION_FAILED](/developers/references/android/id-frak-sdk-core/frakerror/kind/merchant_resolution_failed/) | | [INTERNAL_FAILURE](/developers/references/android/id-frak-sdk-core/frakerror/kind/internal_failure/) | [INTERNAL_FAILURE](/developers/references/android/id-frak-sdk-core/frakerror/kind/internal_failure/) | ## Properties | Name | Summary | |---|---| | [wireValue](/developers/references/android/id-frak-sdk-core/frakerror/kind/wirevalue/) | val [wireValue](/developers/references/android/id-frak-sdk-core/frakerror/kind/wirevalue/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-core/frakerror/kind/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-core/frakerror/kind/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): FrakError.Kind
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-core/frakerror/kind/values/) | fun [values](/developers/references/android/id-frak-sdk-core/frakerror/kind/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<FrakError.Kind>
Returns an array containing the constants of this enum type, in the order they're declared. | # kind val kind: [FrakError.Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/) # ALREADY_PRESENTING ALREADY_PRESENTING # BACKING_OFF BACKING_OFF # DECODING DECODING # INTERNAL_FAILURE INTERNAL_FAILURE # MERCHANT_RESOLUTION_FAILED MERCHANT_RESOLUTION_FAILED # NETWORK NETWORK # NOT_INITIALIZED NOT_INITIALIZED # SERVER SERVER # TRACKING_DISABLED TRACKING_DISABLED # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakError.Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[FrakError.Kind](/developers/references/android/id-frak-sdk-core/frakerror/kind/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # wireValue val wireValue: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # MerchantResolutionFailed class MerchantResolutionFailed(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) No merchant identified: bad `packageId`, or config has neither `merchantId` nor `packageId`. ## Constructors | | | |---|---| | [MerchantResolutionFailed](/developers/references/android/id-frak-sdk-core/frakerror/merchantresolutionfailed/merchantresolutionfailed/) | constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | # MerchantResolutionFailed constructor(message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # Network class Network(cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)) : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) DNS failure, no connectivity, TLS failure, timeout. cause carries the underlying [java.io.IOException](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html). ## Constructors | | | |---|---| | [Network](/developers/references/android/id-frak-sdk-core/frakerror/network/network/) | constructor(cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)) | # Network constructor(cause: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)) # NotInitialized class NotInitialized : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) Client method reached before [id.frak.sdk.Frak.initialize](/developers/references/android/id-frak-sdk/frak/initialize/). A `class`, not an `object`: `fillInStackTrace()` runs at construction, so a singleton would report the first call site. ## Constructors | | | |---|---| | [NotInitialized](/developers/references/android/id-frak-sdk-core/frakerror/notinitialized/notinitialized/) | constructor() | # NotInitialized constructor() # Server class Server(val status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val code: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, val retryAfterSeconds: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?) : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) Non-2xx status. code is the `{ success: false, error, code }` envelope's code when present, null for plain-text bodies. retryAfterSeconds only from a `Retry-After` header. ## Constructors | | | |---|---| | [Server](/developers/references/android/id-frak-sdk-core/frakerror/server/server/) | constructor(status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), code: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, retryAfterSeconds: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?)constructor(status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html))
Status only, for a merchant faking a failure in their own test; the SDK always has all three. | ## Properties | Name | Summary | |---|---| | [code](/developers/references/android/id-frak-sdk-core/frakerror/server/code/) | val [code](/developers/references/android/id-frak-sdk-core/frakerror/server/code/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [retryAfterSeconds](/developers/references/android/id-frak-sdk-core/frakerror/server/retryafterseconds/) | val [retryAfterSeconds](/developers/references/android/id-frak-sdk-core/frakerror/server/retryafterseconds/): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? | | [status](/developers/references/android/id-frak-sdk-core/frakerror/server/status/) | val [status](/developers/references/android/id-frak-sdk-core/frakerror/server/status/): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | # code val code: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # retryAfterSeconds val retryAfterSeconds: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? # Server constructor(status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), code: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, retryAfterSeconds: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?) constructor(status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)) Status only, for a merchant faking a failure in their own test; the SDK always has all three. # status val status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) # TrackingDisabled class TrackingDisabled : [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) A tracking call made while tracking is not permitted, by config or at runtime. Not raised by config or reward resolution, which are ungated. ## Constructors | | | |---|---| | [TrackingDisabled](/developers/references/android/id-frak-sdk-core/frakerror/trackingdisabled/trackingdisabled/) | constructor() | # TrackingDisabled constructor() # FrakLanguage enum FrakLanguage : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<FrakLanguage> Language for merchant-configured copy. Only `en`/`fr` exist today. ## Entries | | | |---|---| | [EN](/developers/references/android/id-frak-sdk-core/fraklanguage/en/) | [EN](/developers/references/android/id-frak-sdk-core/fraklanguage/en/) | | [FR](/developers/references/android/id-frak-sdk-core/fraklanguage/fr/) | [FR](/developers/references/android/id-frak-sdk-core/fraklanguage/fr/) | ## Properties | Name | Summary | |---|---| | [wireValue](/developers/references/android/id-frak-sdk-core/fraklanguage/wirevalue/) | val [wireValue](/developers/references/android/id-frak-sdk-core/fraklanguage/wirevalue/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-core/fraklanguage/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-core/fraklanguage/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): FrakLanguage
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-core/fraklanguage/values/) | fun [values](/developers/references/android/id-frak-sdk-core/fraklanguage/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<FrakLanguage>
Returns an array containing the constants of this enum type, in the order they're declared. | # EN EN # FR FR # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # wireValue val wireValue: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # FrakLogLevel enum FrakLogLevel : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<FrakLogLevel> Logcat verbosity. Default [NONE](/developers/references/android/id-frak-sdk-core/frakloglevel/none/). Also gates [FrakConfig.logSink](/developers/references/android/id-frak-sdk-core/frakconfig/logsink/) volume, see [FrakLogSink](/developers/references/android/id-frak-sdk-core/fraklogsink/). ## Entries | | | |---|---| | [NONE](/developers/references/android/id-frak-sdk-core/frakloglevel/none/) | [NONE](/developers/references/android/id-frak-sdk-core/frakloglevel/none/) | | [ERROR](/developers/references/android/id-frak-sdk-core/frakloglevel/error/) | [ERROR](/developers/references/android/id-frak-sdk-core/frakloglevel/error/) | | [WARN](/developers/references/android/id-frak-sdk-core/frakloglevel/warn/) | [WARN](/developers/references/android/id-frak-sdk-core/frakloglevel/warn/) | | [INFO](/developers/references/android/id-frak-sdk-core/frakloglevel/info/) | [INFO](/developers/references/android/id-frak-sdk-core/frakloglevel/info/) | | [DEBUG](/developers/references/android/id-frak-sdk-core/frakloglevel/debug/) | [DEBUG](/developers/references/android/id-frak-sdk-core/frakloglevel/debug/) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-core/frakloglevel/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-core/frakloglevel/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): FrakLogLevel
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-core/frakloglevel/values/) | fun [values](/developers/references/android/id-frak-sdk-core/frakloglevel/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<FrakLogLevel>
Returns an array containing the constants of this enum type, in the order they're declared. | # DEBUG DEBUG # ERROR ERROR # INFO INFO # NONE NONE # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # WARN WARN # FrakLogSink fun interface FrakLogSink Receives SDK diagnostics, gated by [FrakConfig.logLevel](/developers/references/android/id-frak-sdk-core/frakconfig/loglevel/). Replaces logcat once set. ## Functions | Name | Summary | |---|---| | [log](/developers/references/android/id-frak-sdk-core/fraklogsink/log/) | abstract fun [log](/developers/references/android/id-frak-sdk-core/fraklogsink/log/)(level: [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/), message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), throwable: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?)
Must not throw (exception is swallowed, not surfaced) and must be thread-safe. | # log abstract fun log(level: [FrakLogLevel](/developers/references/android/id-frak-sdk-core/frakloglevel/), message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), throwable: [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)?) Must not throw (exception is swallowed, not surfaced) and must be thread-safe. # FrakMetadata class FrakMetadata Static merchant-supplied facts, fixed at build time. Not the resolved backend config, see [id.frak.sdk.config.FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/). ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) | class [Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) | ## Properties | Name | Summary | |---|---| | [currency](/developers/references/android/id-frak-sdk-core/frakmetadata/currency/) | val [currency](/developers/references/android/id-frak-sdk-core/frakmetadata/currency/): [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) | | [homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/homepagelink/) | val [homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/homepagelink/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [lang](/developers/references/android/id-frak-sdk-core/frakmetadata/lang/) | val [lang](/developers/references/android/id-frak-sdk-core/frakmetadata/lang/): [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)?
Null means "let the backend decide" (falls back to `en`). | | [logoUrl](/developers/references/android/id-frak-sdk-core/frakmetadata/logourl/) | val [logoUrl](/developers/references/android/id-frak-sdk-core/frakmetadata/logourl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [name](/developers/references/android/id-frak-sdk-core/frakmetadata/name/) | val [name](/developers/references/android/id-frak-sdk-core/frakmetadata/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | # FrakMetadata() fun FrakMetadata(configure: [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) Kotlin sugar over [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/). # Builder class Builder ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/builder/) | constructor() | ## Properties | Name | Summary | |---|---| | [currency](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/currency/) | var [currency](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/currency/): [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) | | [homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/homepagelink/) | var [homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/homepagelink/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [lang](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/lang/) | var [lang](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/lang/): [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? | | [logoUrl](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/logourl/) | var [logoUrl](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/logourl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [name](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/name/) | var [name](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | [build](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/build/)(): [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) | | [currency](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/currency/) | fun [currency](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/currency/)(currency: [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)): FrakMetadata.Builder | | [homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/homepagelink/) | fun [homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/homepagelink/)(homepageLink: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): FrakMetadata.Builder | | [lang](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/lang/) | fun [lang](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/lang/)(lang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)?): FrakMetadata.Builder | | [logoUrl](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/logourl/) | fun [logoUrl](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/logourl/)(logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): FrakMetadata.Builder | | [name](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/name/) | fun [name](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/name/)(name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): FrakMetadata.Builder | # build fun build(): [FrakMetadata](/developers/references/android/id-frak-sdk-core/frakmetadata/) # Builder constructor() # currency fun currency(currency: [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/)): [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) var currency: [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) # homepageLink fun homepageLink(homepageLink: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) var homepageLink: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # lang fun lang(lang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)?): [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) var lang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? # logoUrl fun logoUrl(logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) var logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # name fun name(name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [FrakMetadata.Builder](/developers/references/android/id-frak-sdk-core/frakmetadata/builder/) var name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # currency val currency: [FrakCurrency](/developers/references/android/id-frak-sdk-core/frakcurrency/) # homepageLink val homepageLink: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # lang val lang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? Null means "let the backend decide" (falls back to `en`). # logoUrl val logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # name val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # FrakResult sealed interface FrakResult<out T> Outcome of a fire-and-forget call. Not `kotlin.Result`: merchants need the typed [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) arm. #### Inheritors | | |---| | [Success](/developers/references/android/id-frak-sdk-core/frakresult/success/) | | [Failure](/developers/references/android/id-frak-sdk-core/frakresult/failure/) | ## Types | Name | Summary | |---|---| | [Failure](/developers/references/android/id-frak-sdk-core/frakresult/failure/) | class [Failure](/developers/references/android/id-frak-sdk-core/frakresult/failure/)(val error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) : FrakResult<[Nothing](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-nothing/index.html)> | | [Success](/developers/references/android/id-frak-sdk-core/frakresult/success/) | class [Success](/developers/references/android/id-frak-sdk-core/frakresult/success/)<out [T](/developers/references/android/id-frak-sdk-core/frakresult/success/)>(val value: [T](/developers/references/android/id-frak-sdk-core/frakresult/success/)) : FrakResult<[T](/developers/references/android/id-frak-sdk-core/frakresult/success/)> | # Failure class Failure(val error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) : [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Nothing](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-nothing/index.html)> ## Constructors | | | |---|---| | [Failure](/developers/references/android/id-frak-sdk-core/frakresult/failure/failure/) | constructor(error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) | ## Properties | Name | Summary | |---|---| | [error](/developers/references/android/id-frak-sdk-core/frakresult/failure/error/) | val [error](/developers/references/android/id-frak-sdk-core/frakresult/failure/error/): [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) | # error val error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) # Failure constructor(error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) # Success class Success<out T>(val value: T) : [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<T> ## Constructors | | | |---|---| | [Success](/developers/references/android/id-frak-sdk-core/frakresult/success/success/) | constructor(value: T) | ## Properties | Name | Summary | |---|---| | [value](/developers/references/android/id-frak-sdk-core/frakresult/success/value/) | val [value](/developers/references/android/id-frak-sdk-core/frakresult/success/value/): T | # Success constructor(value: [T](/developers/references/android/id-frak-sdk-core/frakresult/success/)) # value val value: [T](/developers/references/android/id-frak-sdk-core/frakresult/success/) # ProductDetails class ProductDetails The purchase line item fields a campaign's `productScope` can target. Build with [Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/), or `ProductDetails { }` from Kotlin. Also returned by the SDK, on [id.frak.sdk.rewards.BestReward.matchedProducts](/developers/references/android/id-frak-sdk-rewards/bestreward/matchedproducts/), hence `equals`/`hashCode`. ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) | class [Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) | ## Properties | Name | Summary | |---|---| | [name](/developers/references/android/id-frak-sdk-core/productdetails/name/) | val [name](/developers/references/android/id-frak-sdk-core/productdetails/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [productId](/developers/references/android/id-frak-sdk-core/productdetails/productid/) | val [productId](/developers/references/android/id-frak-sdk-core/productdetails/productid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [quantity](/developers/references/android/id-frak-sdk-core/productdetails/quantity/) | val [quantity](/developers/references/android/id-frak-sdk-core/productdetails/quantity/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [sku](/developers/references/android/id-frak-sdk-core/productdetails/sku/) | val [sku](/developers/references/android/id-frak-sdk-core/productdetails/sku/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [totalPrice](/developers/references/android/id-frak-sdk-core/productdetails/totalprice/) | val [totalPrice](/developers/references/android/id-frak-sdk-core/productdetails/totalprice/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [unitPrice](/developers/references/android/id-frak-sdk-core/productdetails/unitprice/) | val [unitPrice](/developers/references/android/id-frak-sdk-core/productdetails/unitprice/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # ProductDetails() fun ProductDetails(configure: [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/) Kotlin sugar over [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/). # Builder class Builder ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/builder/) | constructor() | ## Properties | Name | Summary | |---|---| | [name](/developers/references/android/id-frak-sdk-core/productdetails/builder/name/) | var [name](/developers/references/android/id-frak-sdk-core/productdetails/builder/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [productId](/developers/references/android/id-frak-sdk-core/productdetails/builder/productid/) | var [productId](/developers/references/android/id-frak-sdk-core/productdetails/builder/productid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [quantity](/developers/references/android/id-frak-sdk-core/productdetails/builder/quantity/) | var [quantity](/developers/references/android/id-frak-sdk-core/productdetails/builder/quantity/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [sku](/developers/references/android/id-frak-sdk-core/productdetails/builder/sku/) | var [sku](/developers/references/android/id-frak-sdk-core/productdetails/builder/sku/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [totalPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/totalprice/) | var [totalPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/totalprice/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [unitPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/unitprice/) | var [unitPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/unitprice/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | ## Functions | Name | Summary | |---|---| | [build](/developers/references/android/id-frak-sdk-core/productdetails/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-core/productdetails/builder/build/)(): [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/) | | [name](/developers/references/android/id-frak-sdk-core/productdetails/builder/name/) | fun [name](/developers/references/android/id-frak-sdk-core/productdetails/builder/name/)(name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): ProductDetails.Builder | | [productId](/developers/references/android/id-frak-sdk-core/productdetails/builder/productid/) | fun [productId](/developers/references/android/id-frak-sdk-core/productdetails/builder/productid/)(productId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): ProductDetails.Builder | | [quantity](/developers/references/android/id-frak-sdk-core/productdetails/builder/quantity/) | fun [quantity](/developers/references/android/id-frak-sdk-core/productdetails/builder/quantity/)(quantity: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?): ProductDetails.Builder | | [sku](/developers/references/android/id-frak-sdk-core/productdetails/builder/sku/) | fun [sku](/developers/references/android/id-frak-sdk-core/productdetails/builder/sku/)(sku: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): ProductDetails.Builder | | [totalPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/totalprice/) | fun [totalPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/totalprice/)(totalPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?): ProductDetails.Builder | | [unitPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/unitprice/) | fun [unitPrice](/developers/references/android/id-frak-sdk-core/productdetails/builder/unitprice/)(unitPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?): ProductDetails.Builder | # build fun build(): [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/) # Builder constructor() # name fun name(name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) var name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # productId fun productId(productId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) var productId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # quantity fun quantity(quantity: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?): [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) var quantity: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # sku fun sku(sku: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) var sku: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # totalPrice fun totalPrice(totalPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?): [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) var totalPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # unitPrice fun unitPrice(unitPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?): [ProductDetails.Builder](/developers/references/android/id-frak-sdk-core/productdetails/builder/) var unitPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # name val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # productId val productId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # quantity val quantity: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # sku val sku: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # totalPrice val totalPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # unitPrice val unitPrice: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # id.frak.sdk.net ## Types | Name | Summary | |---|---| | [PercentEncoding](/developers/references/android/id-frak-sdk-net/percentencoding/) | object [PercentEncoding](/developers/references/android/id-frak-sdk-net/percentencoding/)
RFC 3986 percent-encoding for a single query-string value. Not `java.net.URLEncoder` (form encoding turns space into `+`), not `android.net.Uri.encode` (throws on the unit-test classpath). `public` only because `:frak-sdk-ui` needs it across the module boundary; see [InternalFrakApi](/developers/references/android/id-frak-sdk/internalfrakapi/). | # PercentEncoding object PercentEncoding RFC 3986 percent-encoding for a single query-string value. Not `java.net.URLEncoder` (form encoding turns space into `+`), not `android.net.Uri.encode` (throws on the unit-test classpath). `public` only because `:frak-sdk-ui` needs it across the module boundary; see [InternalFrakApi](/developers/references/android/id-frak-sdk/internalfrakapi/). ## Functions | Name | Summary | |---|---| | [encode](/developers/references/android/id-frak-sdk-net/percentencoding/encode/) | fun [encode](/developers/references/android/id-frak-sdk-net/percentencoding/encode/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Percent-encodes every byte outside RFC 3986's unreserved set. | # encode fun encode(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Percent-encodes every byte outside RFC 3986's unreserved set. # id.frak.sdk.rewards ## Types | Name | Summary | |---|---| | [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/) | class [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)(val formatted: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val minPurchaseAmount: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, val minPurchaseValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val lockupDurationDays: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val isProductScoped: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val matchedProducts: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>?)
The single reward worth advertising, formatted server-side. formatted contains a non-breaking space (U+00A0) before the currency symbol; render as-is, do not reformat. | | [Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/) | class [Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)(val campaignId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val interactionTypeKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val referrer: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, val referee: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, val defaultLockupSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val maxRewardsPerUser: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val expiresAt: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?)
One active campaign. Arrives sorted by priority descending; do not re-sort. | | [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/) | sealed class [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)
What a campaign pays out. [Percentage](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/) has no concrete amount so it's suppressed from display. | | [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/) | enum [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)>
Who a reward is being estimated for: sharer ([REFERRER](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referrer/)) or arriving referee ([REFEREE](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referee/)). | | [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/) | class [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)
What to look a reward up for. Build with [Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/), or `RewardRequest { }` from Kotlin. | | [RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/) | sealed class [RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)
One band of a tiered reward. Null `maxValue` means no upper bound (not a sentinel). | | [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/) | class [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)(val amount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val eurAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val usdAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val gbpAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html))
A reward amount in raw token units and each fiat currency the backend prices. | ## Functions | Name | Summary | |---|---| | [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest-fun/) | fun [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest-fun/)(configure: [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)
Kotlin sugar over [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/). | # BestReward class BestReward(val formatted: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val minPurchaseAmount: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, val minPurchaseValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val lockupDurationDays: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val isProductScoped: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val matchedProducts: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>?) The single reward worth advertising, formatted server-side. formatted contains a non-breaking space (U+00A0) before the currency symbol; render as-is, do not reformat. ## Constructors | | | |---|---| | [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/bestreward/) | constructor(formatted: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), minPurchaseAmount: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, minPurchaseValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, lockupDurationDays: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, isProductScoped: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), matchedProducts: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>?) | ## Properties | Name | Summary | |---|---| | [formatted](/developers/references/android/id-frak-sdk-rewards/bestreward/formatted/) | val [formatted](/developers/references/android/id-frak-sdk-rewards/bestreward/formatted/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [isProductScoped](/developers/references/android/id-frak-sdk-rewards/bestreward/isproductscoped/) | val [isProductScoped](/developers/references/android/id-frak-sdk-rewards/bestreward/isproductscoped/): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)
Whether the selected campaign is gated to a `productScope`; not the reward's basis. | | [lockupDurationDays](/developers/references/android/id-frak-sdk-rewards/bestreward/lockupdurationdays/) | val [lockupDurationDays](/developers/references/android/id-frak-sdk-rewards/bestreward/lockupdurationdays/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [matchedProducts](/developers/references/android/id-frak-sdk-rewards/bestreward/matchedproducts/) | val [matchedProducts](/developers/references/android/id-frak-sdk-rewards/bestreward/matchedproducts/): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>?
The requested products matching the winning campaign's scope; null when unscoped or none requested. | | [minPurchaseAmount](/developers/references/android/id-frak-sdk-rewards/bestreward/minpurchaseamount/) | val [minPurchaseAmount](/developers/references/android/id-frak-sdk-rewards/bestreward/minpurchaseamount/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [minPurchaseValue](/developers/references/android/id-frak-sdk-rewards/bestreward/minpurchasevalue/) | val [minPurchaseValue](/developers/references/android/id-frak-sdk-rewards/bestreward/minpurchasevalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [payoutType](/developers/references/android/id-frak-sdk-rewards/bestreward/payouttype/) | val [payoutType](/developers/references/android/id-frak-sdk-rewards/bestreward/payouttype/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
`fixed`/`percentage`/`tiered`. `String`, not an enum, so a new server value still decodes. | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # BestReward constructor(formatted: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), minPurchaseAmount: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, minPurchaseValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, lockupDurationDays: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, isProductScoped: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), matchedProducts: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>?) # formatted val formatted: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # isProductScoped val isProductScoped: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) Whether the selected campaign is gated to a `productScope`; not the reward's basis. # lockupDurationDays val lockupDurationDays: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # matchedProducts val matchedProducts: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>? The requested products matching the winning campaign's scope; null when unscoped or none requested. # minPurchaseAmount val minPurchaseAmount: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # minPurchaseValue val minPurchaseValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # payoutType val payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) `fixed`/`percentage`/`tiered`. `String`, not an enum, so a new server value still decodes. # Campaign class Campaign(val campaignId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val interactionTypeKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val referrer: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, val referee: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, val defaultLockupSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val maxRewardsPerUser: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val expiresAt: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?) One active campaign. Arrives sorted by priority descending; do not re-sort. ## Constructors | | | |---|---| | [Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/campaign/) | constructor(campaignId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), interactionTypeKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), referrer: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, referee: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, defaultLockupSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, maxRewardsPerUser: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, expiresAt: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?) | ## Properties | Name | Summary | |---|---| | [campaignId](/developers/references/android/id-frak-sdk-rewards/campaign/campaignid/) | val [campaignId](/developers/references/android/id-frak-sdk-rewards/campaign/campaignid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [defaultLockupSeconds](/developers/references/android/id-frak-sdk-rewards/campaign/defaultlockupseconds/) | val [defaultLockupSeconds](/developers/references/android/id-frak-sdk-rewards/campaign/defaultlockupseconds/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?
Whole days a reward is locked before it can be claimed, when configured. | | [expiresAt](/developers/references/android/id-frak-sdk-rewards/campaign/expiresat/) | val [expiresAt](/developers/references/android/id-frak-sdk-rewards/campaign/expiresat/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
ISO-8601 expiry, or null for a campaign that never expires. | | [interactionTypeKey](/developers/references/android/id-frak-sdk-rewards/campaign/interactiontypekey/) | val [interactionTypeKey](/developers/references/android/id-frak-sdk-rewards/campaign/interactiontypekey/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
The interaction that triggers this campaign, e.g. `purchase`. Open on the wire. | | [maxRewardsPerUser](/developers/references/android/id-frak-sdk-rewards/campaign/maxrewardsperuser/) | val [maxRewardsPerUser](/developers/references/android/id-frak-sdk-rewards/campaign/maxrewardsperuser/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [name](/developers/references/android/id-frak-sdk-rewards/campaign/name/) | val [name](/developers/references/android/id-frak-sdk-rewards/campaign/name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [referee](/developers/references/android/id-frak-sdk-rewards/campaign/referee/) | val [referee](/developers/references/android/id-frak-sdk-rewards/campaign/referee/): [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?
What the person arriving through the link earns. | | [referrer](/developers/references/android/id-frak-sdk-rewards/campaign/referrer/) | val [referrer](/developers/references/android/id-frak-sdk-rewards/campaign/referrer/): [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?
What the sharer earns. Absent when the campaign rewards only the referee. | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # Campaign constructor(campaignId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), interactionTypeKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), referrer: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, referee: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)?, defaultLockupSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, maxRewardsPerUser: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, expiresAt: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?) # campaignId val campaignId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # defaultLockupSeconds val defaultLockupSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? Whole days a reward is locked before it can be claimed, when configured. # expiresAt val expiresAt: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? ISO-8601 expiry, or null for a campaign that never expires. # interactionTypeKey val interactionTypeKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) The interaction that triggers this campaign, e.g. `purchase`. Open on the wire. # maxRewardsPerUser val maxRewardsPerUser: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # name val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # referee val referee: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)? What the person arriving through the link earns. # referrer val referrer: [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/)? What the sharer earns. Absent when the campaign rewards only the referee. # EstimatedReward sealed class EstimatedReward What a campaign pays out. [Percentage](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/) has no concrete amount so it's suppressed from display. #### Inheritors | | |---| | [Fixed](/developers/references/android/id-frak-sdk-rewards/estimatedreward/fixed/) | | [Percentage](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/) | | [Tiered](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/) | | [Unknown](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/) | ## Types | Name | Summary | |---|---| | [Fixed](/developers/references/android/id-frak-sdk-rewards/estimatedreward/fixed/) | class [Fixed](/developers/references/android/id-frak-sdk-rewards/estimatedreward/fixed/)(val amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) : EstimatedReward | | [Percentage](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/) | class [Percentage](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/)(val percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val percentOf: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val maxAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?, val minAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?) : EstimatedReward | | [Tiered](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/) | class [Tiered](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/)(val tierField: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val tiers: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)>) : EstimatedReward | | [Unknown](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/) | class [Unknown](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/)(val payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : EstimatedReward
A payout type newer than this binary. Never rendered, never dropped. | # Fixed class Fixed(val amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) : [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/) ## Constructors | | | |---|---| | [Fixed](/developers/references/android/id-frak-sdk-rewards/estimatedreward/fixed/fixed/) | constructor(amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) | ## Properties | Name | Summary | |---|---| | [amount](/developers/references/android/id-frak-sdk-rewards/estimatedreward/fixed/amount/) | val [amount](/developers/references/android/id-frak-sdk-rewards/estimatedreward/fixed/amount/): [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # amount val amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/) # Fixed constructor(amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) # Percentage class Percentage(val percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val percentOf: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val maxAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?, val minAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?) : [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/) ## Constructors | | | |---|---| | [Percentage](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/percentage/) | constructor(percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), percentOf: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), maxAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?, minAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?) | ## Properties | Name | Summary | |---|---| | [maxAmount](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/maxamount/) | val [maxAmount](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/maxamount/): [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)? | | [minAmount](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/minamount/) | val [minAmount](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/minamount/): [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)? | | [percent](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/percent/) | val [percent](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/percent/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | | [percentOf](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/percentof/) | val [percentOf](/developers/references/android/id-frak-sdk-rewards/estimatedreward/percentage/percentof/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
What the percentage applies to, e.g. `purchase_amount`. Open on the wire. | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # maxAmount val maxAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)? # minAmount val minAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)? # percent val percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # Percentage constructor(percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), percentOf: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), maxAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?, minAmount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)?) # percentOf val percentOf: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) What the percentage applies to, e.g. `purchase_amount`. Open on the wire. # Tiered class Tiered(val tierField: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val tiers: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)>) : [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/) ## Constructors | | | |---|---| | [Tiered](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/tiered/) | constructor(tierField: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), tiers: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)>) | ## Properties | Name | Summary | |---|---| | [tierField](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/tierfield/) | val [tierField](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/tierfield/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [tiers](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/tiers/) | val [tiers](/developers/references/android/id-frak-sdk-rewards/estimatedreward/tiered/tiers/): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)> | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # Tiered constructor(tierField: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), tiers: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)>) # tierField val tierField: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # tiers val tiers: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/)> # Unknown class Unknown(val payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : [EstimatedReward](/developers/references/android/id-frak-sdk-rewards/estimatedreward/) A payout type newer than this binary. Never rendered, never dropped. ## Constructors | | | |---|---| | [Unknown](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/unknown/) | constructor(payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [payoutType](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/payouttype/) | val [payoutType](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/payouttype/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # payoutType val payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # Unknown constructor(payoutType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # RewardAudience enum RewardAudience : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<RewardAudience> Who a reward is being estimated for: sharer ([REFERRER](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referrer/)) or arriving referee ([REFEREE](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referee/)). ## Entries | | | |---|---| | [REFERRER](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referrer/) | [REFERRER](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referrer/) | | [REFEREE](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referee/) | [REFEREE](/developers/references/android/id-frak-sdk-rewards/rewardaudience/referee/) | ## Properties | Name | Summary | |---|---| | [wireValue](/developers/references/android/id-frak-sdk-rewards/rewardaudience/wirevalue/) | val [wireValue](/developers/references/android/id-frak-sdk-rewards/rewardaudience/wirevalue/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-rewards/rewardaudience/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-rewards/rewardaudience/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): RewardAudience
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-rewards/rewardaudience/values/) | fun [values](/developers/references/android/id-frak-sdk-rewards/rewardaudience/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<RewardAudience>
Returns an array containing the constants of this enum type, in the order they're declared. | # REFEREE REFEREE # REFERRER REFERRER # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # wireValue val wireValue: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # RewardRequest class RewardRequest What to look a reward up for. Build with [Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/), or `RewardRequest { }` from Kotlin. ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/) | class [Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/) | ## Properties | Name | Summary | |---|---| | [audience](/developers/references/android/id-frak-sdk-rewards/rewardrequest/audience/) | val [audience](/developers/references/android/id-frak-sdk-rewards/rewardrequest/audience/): [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)?
Referrer or referee. Null ranks both. | | [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/products/) | val [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/products/): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>
Products currently in view, when known. Advisory: a campaign scoped to none of them is ranked below one matching at least one. | | [targetInteraction](/developers/references/android/id-frak-sdk-rewards/rewardrequest/targetinteraction/) | val [targetInteraction](/developers/references/android/id-frak-sdk-rewards/rewardrequest/targetinteraction/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Which interaction the reward is for, e.g. `purchase`. Free-form; a typo silently never matches. | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # RewardRequest() fun RewardRequest(configure: [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/) Kotlin sugar over [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/). # audience val audience: [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)? Referrer or referee. Null ranks both. # Builder class Builder ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/builder/) | constructor() | ## Properties | Name | Summary | |---|---| | [audience](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/audience/) | var [audience](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/audience/): [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)? | | [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/products/) | var [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/products/): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)> | | [targetInteraction](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/targetinteraction/) | var [targetInteraction](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/targetinteraction/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | [addProduct](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/addproduct/) | fun [addProduct](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/addproduct/)(product: [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)): RewardRequest.Builder | | [audience](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/audience/) | fun [audience](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/audience/)(audience: [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)?): RewardRequest.Builder | | [build](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/build/)(): [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)
Copies [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/products/), so mutating the caller's list cannot change an already-built request. | | [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/products/) | fun [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/products/)(products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>): RewardRequest.Builder | | [targetInteraction](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/targetinteraction/) | fun [targetInteraction](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/targetinteraction/)(targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): RewardRequest.Builder | # addProduct fun addProduct(product: [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)): [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/) # audience fun audience(audience: [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)?): [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/) var audience: [RewardAudience](/developers/references/android/id-frak-sdk-rewards/rewardaudience/)? # build fun build(): [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/) Copies [products](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/products/), so mutating the caller's list cannot change an already-built request. # Builder constructor() # products fun products(products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)>): [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/) var products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)> # targetInteraction fun targetInteraction(targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [RewardRequest.Builder](/developers/references/android/id-frak-sdk-rewards/rewardrequest/builder/) var targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # products val products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)> Products currently in view, when known. Advisory: a campaign scoped to none of them is ranked below one matching at least one. # targetInteraction val targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Which interaction the reward is for, e.g. `purchase`. Free-form; a typo silently never matches. # RewardTier sealed class RewardTier One band of a tiered reward. Null `maxValue` means no upper bound (not a sentinel). #### Inheritors | | |---| | [Amount](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/) | | [Percentage](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/) | | [Unknown](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/) | ## Types | Name | Summary | |---|---| | [Amount](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/) | class [Amount](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/)(val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) : RewardTier | | [Percentage](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/) | class [Percentage](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/)(val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) : RewardTier | | [Unknown](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/) | class [Unknown](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/)(val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?) : RewardTier
A tier shape this build does not know, kept so one unrecognised band cannot fail the whole reward. Mirrors [EstimatedReward.Unknown](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/); the bounds are the fields every tier carries. | ## Properties | Name | Summary | |---|---| | [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/maxvalue/) | abstract val [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/maxvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/minvalue/) | abstract val [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/minvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | # Amount class Amount(val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) : [RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/) ## Constructors | | | |---|---| | [Amount](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/amount/) | constructor(minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) | ## Properties | Name | Summary | |---|---| | [amount](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/amount-prop/) | val [amount](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/amount-prop/): [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/) | | [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/maxvalue/) | open override val [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/maxvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/minvalue/) | open override val [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/amount/minvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # Amount constructor(minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/)) # amount val amount: [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/) # maxValue open override val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # minValue open override val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # maxValue abstract val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # minValue abstract val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # Percentage class Percentage(val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, val percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) : [RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/) ## Constructors | | | |---|---| | [Percentage](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/percentage/) | constructor(minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) | ## Properties | Name | Summary | |---|---| | [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/maxvalue/) | open override val [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/maxvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/minvalue/) | open override val [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/minvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | | [percent](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/percent/) | val [percent](/developers/references/android/id-frak-sdk-rewards/rewardtier/percentage/percent/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # maxValue open override val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # minValue open override val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # percent val percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # Percentage constructor(minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?, percent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) # Unknown class Unknown(val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?) : [RewardTier](/developers/references/android/id-frak-sdk-rewards/rewardtier/) A tier shape this build does not know, kept so one unrecognised band cannot fail the whole reward. Mirrors [EstimatedReward.Unknown](/developers/references/android/id-frak-sdk-rewards/estimatedreward/unknown/); the bounds are the fields every tier carries. ## Constructors | | | |---|---| | [Unknown](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/unknown/) | constructor(minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?) | ## Properties | Name | Summary | |---|---| | [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/maxvalue/) | open override val [maxValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/maxvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? | | [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/minvalue/) | open override val [minValue](/developers/references/android/id-frak-sdk-rewards/rewardtier/unknown/minvalue/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # maxValue open override val maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? # minValue open override val minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # Unknown constructor(minValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), maxValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)?) # TokenAmount class TokenAmount(val amount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val eurAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val usdAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val gbpAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) A reward amount in raw token units and each fiat currency the backend prices. ## Constructors | | | |---|---| | [TokenAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/tokenamount/) | constructor(amount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), eurAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), usdAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), gbpAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) | ## Properties | Name | Summary | |---|---| | [amount](/developers/references/android/id-frak-sdk-rewards/tokenamount/amount/) | val [amount](/developers/references/android/id-frak-sdk-rewards/tokenamount/amount/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)
Non-zero even when every fiat field is zero (fiat is `0` when unpriced, not worthless). | | [eurAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/euramount/) | val [eurAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/euramount/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | | [gbpAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/gbpamount/) | val [gbpAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/gbpamount/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | | [usdAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/usdamount/) | val [usdAmount](/developers/references/android/id-frak-sdk-rewards/tokenamount/usdamount/): [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # amount val amount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) Non-zero even when every fiat field is zero (fiat is `0` when unpriced, not worthless). # eurAmount val eurAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # gbpAmount val gbpAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # TokenAmount constructor(amount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), eurAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), usdAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), gbpAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)) # usdAmount val usdAmount: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) # id.frak.sdk.sharing ## Types | Name | Summary | |---|---| | [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/) | class [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)
Per-call attribution overrides for a share link's UTM parameters, merged over the merchant-level [AttributionDefaults](/developers/references/android/id-frak-sdk-config/attributiondefaults/) field by field. Build with [Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/), or `AttributionParams { }` from Kotlin. | | [FrakContext](/developers/references/android/id-frak-sdk-sharing/frakcontext/) | sealed interface [FrakContext](/developers/references/android/id-frak-sdk-sharing/frakcontext/)
Referral context carried in a share link's `fCtx`: who shared, for which merchant, and when. Two layouts live on the wire with genuinely different information, hence sealed rather than nullable fields on one type. | | [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/) | class [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)
One product to advertise on the sharing sheet. Build with [Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/), or `SharingProduct(title, link) { }` from Kotlin. | | [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/) | class [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)
What to share; passed to `buildSharingLink` or to the sheet. Build with [Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/), or `SharingRequest { }` from Kotlin. | ## Functions | Name | Summary | |---|---| | [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams-fun/) | fun [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams-fun/)(configure: [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)
Kotlin sugar over [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/). | | [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct-fun/) | fun [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct-fun/)(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)
Title and link only.
fun [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct-fun/)(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), configure: [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)
Kotlin sugar over [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/). | | [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest-fun/) | fun [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest-fun/)(configure: [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)
Kotlin sugar over [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/). | # AttributionParams class AttributionParams Per-call attribution overrides for a share link's UTM parameters, merged over the merchant-level [AttributionDefaults](/developers/references/android/id-frak-sdk-config/attributiondefaults/) field by field. Build with [Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/), or `AttributionParams { }` from Kotlin. ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) | class [Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) | ## Properties | Name | Summary | |---|---| | [ref](/developers/references/android/id-frak-sdk-sharing/attributionparams/ref/) | val [ref](/developers/references/android/id-frak-sdk-sharing/attributionparams/ref/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmCampaign](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmcampaign/) | val [utmCampaign](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmcampaign/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmContent](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmcontent/) | val [utmContent](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmcontent/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmMedium](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmmedium/) | val [utmMedium](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmmedium/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmSource](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmsource/) | val [utmSource](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmsource/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmTerm](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmterm/) | val [utmTerm](/developers/references/android/id-frak-sdk-sharing/attributionparams/utmterm/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [via](/developers/references/android/id-frak-sdk-sharing/attributionparams/via/) | val [via](/developers/references/android/id-frak-sdk-sharing/attributionparams/via/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # AttributionParams() fun AttributionParams(configure: [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/) Kotlin sugar over [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/). # Builder class Builder ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/builder/) | constructor() | ## Properties | Name | Summary | |---|---| | [ref](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/ref/) | var [ref](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/ref/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmCampaign](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcampaign/) | var [utmCampaign](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcampaign/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmContent](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcontent/) | var [utmContent](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcontent/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmMedium](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmmedium/) | var [utmMedium](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmmedium/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmSource](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmsource/) | var [utmSource](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmsource/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmTerm](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmterm/) | var [utmTerm](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmterm/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [via](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/via/) | var [via](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/via/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | [build](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/build/)(): [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/) | | [ref](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/ref/) | fun [ref](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/ref/)(ref: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | | [utmCampaign](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcampaign/) | fun [utmCampaign](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcampaign/)(utmCampaign: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | | [utmContent](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcontent/) | fun [utmContent](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmcontent/)(utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | | [utmMedium](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmmedium/) | fun [utmMedium](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmmedium/)(utmMedium: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | | [utmSource](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmsource/) | fun [utmSource](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmsource/)(utmSource: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | | [utmTerm](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmterm/) | fun [utmTerm](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/utmterm/)(utmTerm: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | | [via](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/via/) | fun [via](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/via/)(via: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): AttributionParams.Builder | # build fun build(): [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/) # Builder constructor() # ref fun ref(ref: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var ref: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmCampaign fun utmCampaign(utmCampaign: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var utmCampaign: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmContent fun utmContent(utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmMedium fun utmMedium(utmMedium: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var utmMedium: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmSource fun utmSource(utmSource: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var utmSource: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmTerm fun utmTerm(utmTerm: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var utmTerm: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # via fun via(via: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [AttributionParams.Builder](/developers/references/android/id-frak-sdk-sharing/attributionparams/builder/) var via: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # ref val ref: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmCampaign val utmCampaign: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmContent val utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmMedium val utmMedium: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmSource val utmSource: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmTerm val utmTerm: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # via val via: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # FrakContext sealed interface FrakContext Referral context carried in a share link's `fCtx`: who shared, for which merchant, and when. Two layouts live on the wire with genuinely different information, hence sealed rather than nullable fields on one type. #### Inheritors | | |---| | [V1](/developers/references/android/id-frak-sdk-sharing/frakcontext/v1/) | | [V2](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/) | ## Types | Name | Summary | |---|---| | [V1](/developers/references/android/id-frak-sdk-sharing/frakcontext/v1/) | class [V1](/developers/references/android/id-frak-sdk-sharing/frakcontext/v1/) : FrakContext
Legacy layout: bare wallet address from pre-anonymous-id web builds. Decoded, never minted. | | [V2](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/) | class [V2](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/) : FrakContext
Current layout. Carries the merchant, a share timestamp, and at least one of clientId / wallet. | # V1 class V1 : [FrakContext](/developers/references/android/id-frak-sdk-sharing/frakcontext/) Legacy layout: bare wallet address from pre-anonymous-id web builds. Decoded, never minted. ## Properties | Name | Summary | |---|---| | [wallet](/developers/references/android/id-frak-sdk-sharing/frakcontext/v1/wallet/) | val [wallet](/developers/references/android/id-frak-sdk-sharing/frakcontext/v1/wallet/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # wallet val wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # V2 class V2 : [FrakContext](/developers/references/android/id-frak-sdk-sharing/frakcontext/) Current layout. Carries the merchant, a share timestamp, and at least one of clientId / wallet. ## Properties | Name | Summary | |---|---| | [clientId](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/clientid/) | val [clientId](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/clientid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [merchantId](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/merchantid/) | val [merchantId](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/merchantid/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [timestamp](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/timestamp/) | val [timestamp](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/timestamp/): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | | [wallet](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/wallet/) | val [wallet](/developers/references/android/id-frak-sdk-sharing/frakcontext/v2/wallet/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # clientId val clientId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # merchantId val merchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # timestamp val timestamp: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) # wallet val wallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # SharingProduct class SharingProduct One product to advertise on the sharing sheet. Build with [Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/), or `SharingProduct(title, link) { }` from Kotlin. ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/) | class [Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/)(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [details](/developers/references/android/id-frak-sdk-sharing/sharingproduct/details/) | val [details](/developers/references/android/id-frak-sdk-sharing/sharingproduct/details/): [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)?
Scope fields for reward selection; [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/) is what a `productScope` matches on. | | [imageUrl](/developers/references/android/id-frak-sdk-sharing/sharingproduct/imageurl/) | val [imageUrl](/developers/references/android/id-frak-sdk-sharing/sharingproduct/imageurl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [link](/developers/references/android/id-frak-sdk-sharing/sharingproduct/link/) | val [link](/developers/references/android/id-frak-sdk-sharing/sharingproduct/link/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [title](/developers/references/android/id-frak-sdk-sharing/sharingproduct/title/) | val [title](/developers/references/android/id-frak-sdk-sharing/sharingproduct/title/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | | [utmContent](/developers/references/android/id-frak-sdk-sharing/sharingproduct/utmcontent/) | val [utmContent](/developers/references/android/id-frak-sdk-sharing/sharingproduct/utmcontent/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
`utm_content` for a link built from this product; highest-priority source for that field. | # SharingProduct() fun SharingProduct(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), configure: [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/) Kotlin sugar over [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/). fun SharingProduct(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/) Title and link only. # Builder class Builder(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/builder/) | constructor(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [details](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/details/) | var [details](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/details/): [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)? | | [imageUrl](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/imageurl/) | var [imageUrl](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/imageurl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [utmContent](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/utmcontent/) | var [utmContent](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/utmcontent/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | [build](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/build/)(): [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/) | | [details](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/details/) | fun [details](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/details/)(details: [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)?): SharingProduct.Builder | | [imageUrl](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/imageurl/) | fun [imageUrl](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/imageurl/)(imageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingProduct.Builder | | [utmContent](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/utmcontent/) | fun [utmContent](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/utmcontent/)(utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingProduct.Builder | # build fun build(): [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/) # Builder constructor(title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # details fun details(details: [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)?): [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/) var details: [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)? # imageUrl fun imageUrl(imageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/) var imageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # utmContent fun utmContent(utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingProduct.Builder](/developers/references/android/id-frak-sdk-sharing/sharingproduct/builder/) var utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # details val details: [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/)? Scope fields for reward selection; [ProductDetails](/developers/references/android/id-frak-sdk-core/productdetails/) is what a `productScope` matches on. # imageUrl val imageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # link val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # title val title: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # utmContent val utmContent: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? `utm_content` for a link built from this product; highest-priority source for that field. # SharingRequest class SharingRequest What to share; passed to `buildSharingLink` or to the sheet. Build with [Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/), or `SharingRequest { }` from Kotlin. ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) | class [Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) | ## Properties | Name | Summary | |---|---| | [attribution](/developers/references/android/id-frak-sdk-sharing/sharingrequest/attribution/) | val [attribution](/developers/references/android/id-frak-sdk-sharing/sharingrequest/attribution/): [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)? | | [link](/developers/references/android/id-frak-sdk-sharing/sharingrequest/link/) | val [link](/developers/references/android/id-frak-sdk-sharing/sharingrequest/link/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Falls back to the merchant's `homepageLink`, then [id.frak.sdk.core.FrakMetadata.homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/homepagelink/). | | [logoUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/logourl/) | val [logoUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/logourl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [placement](/developers/references/android/id-frak-sdk-sharing/sharingrequest/placement/) | val [placement](/developers/references/android/id-frak-sdk-sharing/sharingrequest/placement/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Which configured placement's copy to render, e.g. `product-page`. Accepted but not yet acted on. | | [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/products/) | val [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/products/): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)> | | [shareImageUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/shareimageurl/) | val [shareImageUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/shareimageurl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Highest-precedence override for the OS share sheet's preview image. iOS only; Android ships no preview. | | [shareText](/developers/references/android/id-frak-sdk-sharing/sharingrequest/sharetext/) | val [shareText](/developers/references/android/id-frak-sdk-sharing/sharingrequest/sharetext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Highest-precedence override for the OS share sheet's body text. | | [shareTitle](/developers/references/android/id-frak-sdk-sharing/sharingrequest/sharetitle/) | val [shareTitle](/developers/references/android/id-frak-sdk-sharing/sharingrequest/sharetitle/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Highest-precedence override for the OS share sheet's title. | | [targetInteraction](/developers/references/android/id-frak-sdk-sharing/sharingrequest/targetinteraction/) | val [targetInteraction](/developers/references/android/id-frak-sdk-sharing/sharingrequest/targetinteraction/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | # SharingRequest() fun SharingRequest(configure: [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/).() -> [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)): [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/) Kotlin sugar over [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/). # attribution val attribution: [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)? # Builder class Builder ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/builder/) | constructor() | ## Properties | Name | Summary | |---|---| | [attribution](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/attribution/) | var [attribution](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/attribution/): [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)? | | [link](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/link/) | var [link](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/link/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [logoUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/logourl/) | var [logoUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/logourl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [placement](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/placement/) | var [placement](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/placement/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/products/) | var [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/products/): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)> | | [shareImageUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/shareimageurl/) | var [shareImageUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/shareimageurl/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [shareText](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetext/) | var [shareText](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetext/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [shareTitle](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetitle/) | var [shareTitle](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetitle/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | | [targetInteraction](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/targetinteraction/) | var [targetInteraction](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/targetinteraction/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? | ## Functions | Name | Summary | |---|---| | [addProduct](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/addproduct/) | fun [addProduct](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/addproduct/)(product: [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)): SharingRequest.Builder | | [attribution](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/attribution/) | fun [attribution](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/attribution/)(attribution: [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)?): SharingRequest.Builder | | [build](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/build/)(): [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)
Copies [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/products/), so mutating the caller's list cannot change an already-built request. | | [link](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/link/) | fun [link](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/link/)(link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | | [logoUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/logourl/) | fun [logoUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/logourl/)(logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | | [placement](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/placement/) | fun [placement](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/placement/)(placement: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | | [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/products/) | fun [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/products/)(products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)>): SharingRequest.Builder | | [shareImageUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/shareimageurl/) | fun [shareImageUrl](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/shareimageurl/)(shareImageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | | [shareText](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetext/) | fun [shareText](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetext/)(shareText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | | [shareTitle](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetitle/) | fun [shareTitle](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/sharetitle/)(shareTitle: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | | [targetInteraction](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/targetinteraction/) | fun [targetInteraction](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/targetinteraction/)(targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): SharingRequest.Builder | # addProduct fun addProduct(product: [SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) # attribution fun attribution(attribution: [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var attribution: [AttributionParams](/developers/references/android/id-frak-sdk-sharing/attributionparams/)? # build fun build(): [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/) Copies [products](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/products/), so mutating the caller's list cannot change an already-built request. # Builder constructor() # link fun link(link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # logoUrl fun logoUrl(logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # placement fun placement(placement: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var placement: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # products fun products(products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)>): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)> # shareImageUrl fun shareImageUrl(shareImageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var shareImageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # shareText fun shareText(shareText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var shareText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # shareTitle fun shareTitle(shareTitle: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var shareTitle: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # targetInteraction fun targetInteraction(targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [SharingRequest.Builder](/developers/references/android/id-frak-sdk-sharing/sharingrequest/builder/) var targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # link val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Falls back to the merchant's `homepageLink`, then [id.frak.sdk.core.FrakMetadata.homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/homepagelink/). # logoUrl val logoUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # placement val placement: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Which configured placement's copy to render, e.g. `product-page`. Accepted but not yet acted on. # products val products: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[SharingProduct](/developers/references/android/id-frak-sdk-sharing/sharingproduct/)> # shareImageUrl val shareImageUrl: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Highest-precedence override for the OS share sheet's preview image. iOS only; Android ships no preview. # shareText val shareText: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Highest-precedence override for the OS share sheet's body text. # shareTitle val shareTitle: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Highest-precedence override for the OS share sheet's title. # targetInteraction val targetInteraction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? # id.frak.sdk.tracking ## Types | Name | Summary | |---|---| | [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) | class [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
Something the user did that the merchant wants attributed. Closed to the three shapes `POST /user/track/interaction` accepts; use [custom](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/) for anything else. | # Interaction class Interaction Something the user did that the merchant wants attributed. Closed to the three shapes `POST /user/track/interaction` accepts; use [custom](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/) for anything else. ## Types | Name | Summary | |---|---| | [Companion](/developers/references/android/id-frak-sdk-tracking/interaction/companion/) | object [Companion](/developers/references/android/id-frak-sdk-tracking/interaction/companion/) | ## Functions | Name | Summary | |---|---| | equals | open operator override fun equals(other: [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | hashCode | open override fun hashCode(): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | | toString | open override fun toString(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # Companion object Companion ## Functions | Name | Summary | |---|---| | [arrival](/developers/references/android/id-frak-sdk-tracking/interaction/companion/arrival/) | fun [arrival](/developers/references/android/id-frak-sdk-tracking/interaction/companion/arrival/)(referrerWallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, referrerClientId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, referrerMerchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, referralTimestamp: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
A referral arrival. Built for you by [id.frak.sdk.AppLinkApi.handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/); tracking one yourself for a link the SDK already handled double-counts it, as the `arrival` schema carries no idempotency key. | | [custom](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/) | fun [custom](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/)(customType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
Anything the three built-in shapes do not cover. [customType](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/) is free-form; the route's schema is the authority, so an unrecognised value comes back as a 4xx.
fun [custom](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/)(customType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), data: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)>): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
[data](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/) is sent verbatim as the event's `data` object.
fun [custom](/developers/references/android/id-frak-sdk-tracking/interaction/companion/custom/)(customType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), data: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)>, idempotencyKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) | | [sharing](/developers/references/android/id-frak-sdk-tracking/interaction/companion/sharing/) | fun [sharing](/developers/references/android/id-frak-sdk-tracking/interaction/companion/sharing/)(): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
A share, timestamped at enqueue. What the sharing sheet reports when the user shares.
fun [sharing](/developers/references/android/id-frak-sdk-tracking/interaction/companion/sharing/)(purchaseId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
A share tied to a purchase, timestamped at enqueue.
fun [sharing](/developers/references/android/id-frak-sdk-tracking/interaction/companion/sharing/)(sharingTimestamp: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?, purchaseId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)
A share with an explicit timestamp and/or the purchase it followed. [sharingTimestamp](/developers/references/android/id-frak-sdk-tracking/interaction/companion/sharing/) is Unix SECONDS; null is stamped at enqueue, so a queued event reports when the share happened rather than when it was delivered. | # arrival fun arrival(referrerWallet: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, referrerClientId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, referrerMerchantId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, referralTimestamp: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) A referral arrival. Built for you by [id.frak.sdk.AppLinkApi.handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/); tracking one yourself for a link the SDK already handled double-counts it, as the `arrival` schema carries no idempotency key. # custom fun custom(customType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) Anything the three built-in shapes do not cover. customType is free-form; the route's schema is the authority, so an unrecognised value comes back as a 4xx. fun custom(customType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), data: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)>): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) data is sent verbatim as the event's `data` object. fun custom(customType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), data: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)>, idempotencyKey: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) #### Parameters android | | | |---|---| | idempotencyKey | overrides the key the SDK stamps at enqueue. | # sharing fun sharing(): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) A share, timestamped at enqueue. What the sharing sheet reports when the user shares. fun sharing(purchaseId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) A share tied to a purchase, timestamped at enqueue. fun sharing(sharingTimestamp: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?, purchaseId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/) A share with an explicit timestamp and/or the purchase it followed. sharingTimestamp is Unix SECONDS; null is stamped at enqueue, so a queued event reports when the share happened rather than when it was delivered. # id.frak.sdk.ui ## Types | Name | Summary | |---|---| | [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/) | class [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/)
The Frak sharing sheet. Build it once per screen, [warm](/developers/references/android/id-frak-sdk-ui/fraksharing/warm/) it when a share affordance becomes visible, then [present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) on the tap. | | [FrakSharingDefaults](/developers/references/android/id-frak-sdk-ui/fraksharingdefaults/) | object [FrakSharingDefaults](/developers/references/android/id-frak-sdk-ui/fraksharingdefaults/)
Tunable defaults for [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/). | | [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) | sealed interface [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/)
How a sharing session ended. A session can produce several; the callback reports only the most significant: walletOpened > install > shared/copied > dismissed. | # FrakSharing class FrakSharing The Frak sharing sheet. Build it once per screen, [warm](/developers/references/android/id-frak-sdk-ui/fraksharing/warm/) it when a share affordance becomes visible, then [present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) on the tap. A sheet that is up survives a configuration change, but not process death. Use one instance per Activity: two share a warm web view and a "one sheet at a time" guard, and after a configuration change a live session reports to whichever was built first, not whichever presented. ## Types | Name | Summary | |---|---| | [Builder](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/) | class [Builder](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/)(callback: [FrakSharing.ResultCallback](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/))
Builds a FrakSharing against a hosting Activity. | | [ResultCallback](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/) | fun interface [ResultCallback](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/)
How a sharing session ended. Always invoked on the main thread, and it can arrive after the hosting Activity is destroyed, so write it defensively. Should be a stable reference. | ## Functions | Name | Summary | |---|---| | [present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) | fun [present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/)(request: [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/))
Opens the sheet. No-op if the hosting Activity is finishing, destroyed, or not at least `STARTED`. | | [warm](/developers/references/android/id-frak-sdk-ui/fraksharing/warm/) | fun [warm](/developers/references/android/id-frak-sdk-ui/fraksharing/warm/)()
Starts warming the pooled web view and the identity/config reads. Call when a share affordance becomes visible; cheap to call repeatedly, and [present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) implies it. | # Builder class Builder(callback: [FrakSharing.ResultCallback](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/)) Builds a [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/) against a hosting Activity. ## Constructors | | | |---|---| | [Builder](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/builder/) | constructor(callback: [FrakSharing.ResultCallback](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/)) | ## Functions | Name | Summary | |---|---| | [build](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/build/) | fun [build](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/build/)(): [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/)
The Compose build site; resolves the hosting Activity from `LocalContext` and warms on composition-enter, so [warm](/developers/references/android/id-frak-sdk-ui/fraksharing/warm/) never has to be called by hand.
fun [build](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/build/)(activity: ERROR CLASS: Symbol not found for ComponentActivity): [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/)
The Activity that will host the sheet's window. Call from `onCreate` (after `super.onCreate`), never from a property initialiser, where there is no `ViewModelStore` yet to hold the retained sheet state. | | [heightFraction](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/heightfraction/) | fun [heightFraction](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/heightfraction/)(fraction: [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)): FrakSharing.Builder
Share of the screen height the sheet occupies. Values outside `0.3..1.0`, and non-finite ones, are clamped and logged rather than thrown: a layout number must not crash the merchant's app, and iOS clamps the same input. | | [language](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/language/) | fun [language](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/language/)(languageTag: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): FrakSharing.Builder
Language of the sheet's contents as a BCP-47 tag (`"en"`, `"fr-CA"`), defaulting to the device locale. Selects among what the page ships; it falls back to its own default for a tag it has no translation for. Part of the pre-warmed URL, so set it once per instance. | # build fun build(activity: ERROR CLASS: Symbol not found for ComponentActivity): [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/) The Activity that will host the sheet's window. Call from `onCreate` (after `super.onCreate`), never from a property initialiser, where there is no `ViewModelStore` yet to hold the retained sheet state. #### Throws | | | |---|---| | [IllegalStateException](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalStateException.html) | if called before the Activity reaches `onCreate`. | fun build(): [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/) The Compose build site; resolves the hosting Activity from `LocalContext` and warms on composition-enter, so [warm](/developers/references/android/id-frak-sdk-ui/fraksharing/warm/) never has to be called by hand. # Builder constructor(callback: [FrakSharing.ResultCallback](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/)) # heightFraction fun heightFraction(fraction: [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)): [FrakSharing.Builder](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/) Share of the screen height the sheet occupies. Values outside `0.3..1.0`, and non-finite ones, are clamped and logged rather than thrown: a layout number must not crash the merchant's app, and iOS clamps the same input. # language fun language(languageTag: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?): [FrakSharing.Builder](/developers/references/android/id-frak-sdk-ui/fraksharing/builder/) Language of the sheet's contents as a BCP-47 tag (`"en"`, `"fr-CA"`), defaulting to the device locale. Selects among what the page ships; it falls back to its own default for a tag it has no translation for. Part of the pre-warmed URL, so set it once per instance. # present fun present(request: [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)) Opens the sheet. No-op if the hosting Activity is finishing, destroyed, or not at least `STARTED`. # ResultCallback fun interface ResultCallback How a sharing session ended. Always invoked on the main thread, and it can arrive after the hosting Activity is destroyed, so write it defensively. Should be a stable reference. ## Functions | Name | Summary | |---|---| | [onResult](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/onresult/) | abstract fun [onResult](/developers/references/android/id-frak-sdk-ui/fraksharing/resultcallback/onresult/)(result: [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/)) | # onResult abstract fun onResult(result: [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/)) # warm fun warm() Starts warming the pooled web view and the identity/config reads. Call when a share affordance becomes visible; cheap to call repeatedly, and [present](/developers/references/android/id-frak-sdk-ui/fraksharing/present/) implies it. # FrakSharingDefaults object FrakSharingDefaults Tunable defaults for [FrakSharing](/developers/references/android/id-frak-sdk-ui/fraksharing/). ## Properties | Name | Summary | |---|---| | [HEIGHT_FRACTION](/developers/references/android/id-frak-sdk-ui/fraksharingdefaults/height_fraction/) | val [HEIGHT_FRACTION](/developers/references/android/id-frak-sdk-ui/fraksharingdefaults/height_fraction/): [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) = 0.85f
Default fraction of the screen the sharing sheet takes. Not `const`: a `const val` would be inlined into the merchant's bytecode and frozen at their compile time. Mirrored on the other platform; keep both in step. | # HEIGHT_FRACTION val HEIGHT_FRACTION: [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) = 0.85f Default fraction of the screen the sharing sheet takes. Not `const`: a `const val` would be inlined into the merchant's bytecode and frozen at their compile time. Mirrored on the other platform; keep both in step. # SharingResult sealed interface SharingResult How a sharing session ended. A session can produce several; the callback reports only the most significant: walletOpened > install > shared/copied > dismissed. #### Inheritors | | |---| | [Shared](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/) | | [Copied](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/) | | [InstallStarted](/developers/references/android/id-frak-sdk-ui/sharingresult/installstarted/) | | [WalletOpened](/developers/references/android/id-frak-sdk-ui/sharingresult/walletopened/) | | [Dismissed](/developers/references/android/id-frak-sdk-ui/sharingresult/dismissed/) | | [Failed](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/) | ## Types | Name | Summary | |---|---| | [Copied](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/) | class [Copied](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/)(val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : SharingResult | | [Dismissed](/developers/references/android/id-frak-sdk-ui/sharingresult/dismissed/) | object [Dismissed](/developers/references/android/id-frak-sdk-ui/sharingresult/dismissed/) : SharingResult | | [Failed](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/) | class [Failed](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/)(val error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) : SharingResult | | [InstallStarted](/developers/references/android/id-frak-sdk-ui/sharingresult/installstarted/) | object [InstallStarted](/developers/references/android/id-frak-sdk-ui/sharingresult/installstarted/) : SharingResult
The user asked to install; the sheet took them to the wallet's install page, or to the store with no identity to hand it. Informational only — do not call [id.frak.sdk.AppLinkApi.openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) again in response, and it doesn't mean anything was installed. | | [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) | enum [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<[SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)> | | [Shared](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/) | class [Shared](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/)(val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : SharingResult | | [WalletOpened](/developers/references/android/id-frak-sdk-ui/sharingresult/walletopened/) | object [WalletOpened](/developers/references/android/id-frak-sdk-ui/sharingresult/walletopened/) : SharingResult
The wallet was already installed and [id.frak.sdk.AppLinkApi.openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) opened it. | ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind-prop/) | abstract val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind-prop/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | # Copied class Copied(val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) ## Constructors | | | |---|---| | [Copied](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/copied/) | constructor(link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/kind/) | open override val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/kind/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | | [link](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/link/) | val [link](/developers/references/android/id-frak-sdk-ui/sharingresult/copied/link/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # Copied constructor(link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # kind open override val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # link val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # Dismissed object Dismissed : [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/dismissed/kind/) | open override val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/dismissed/kind/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | # kind open override val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # Failed class Failed(val error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) : [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) ## Constructors | | | |---|---| | [Failed](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/failed/) | constructor(error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) | ## Properties | Name | Summary | |---|---| | [error](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/error/) | val [error](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/error/): [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) | | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/kind/) | open override val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/failed/kind/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | # error val error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) # Failed constructor(error: [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/)) # kind open override val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # InstallStarted object InstallStarted : [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) The user asked to install; the sheet took them to the wallet's install page, or to the store with no identity to hand it. Informational only — do not call [id.frak.sdk.AppLinkApi.openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) again in response, and it doesn't mean anything was installed. ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/installstarted/kind/) | open override val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/installstarted/kind/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | # kind open override val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # Kind enum Kind : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<SharingResult.Kind> ## Entries | | | |---|---| | [SHARED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/shared/) | [SHARED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/shared/) | | [COPIED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/copied/) | [COPIED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/copied/) | | [INSTALL_STARTED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/install_started/) | [INSTALL_STARTED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/install_started/) | | [WALLET_OPENED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wallet_opened/) | [WALLET_OPENED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wallet_opened/) | | [DISMISSED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/dismissed/) | [DISMISSED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/dismissed/) | | [FAILED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/failed/) | [FAILED](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/failed/) | ## Properties | Name | Summary | |---|---| | [wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) | val [wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): SharingResult.Kind
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/values/) | fun [values](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<SharingResult.Kind>
Returns an array containing the constants of this enum type, in the order they're declared. | # kind abstract val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # COPIED COPIED # DISMISSED DISMISSED # FAILED FAILED # INSTALL_STARTED INSTALL_STARTED # SHARED SHARED # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # WALLET_OPENED WALLET_OPENED # wireValue val wireValue: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # Shared class Shared(val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) : [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) ## Constructors | | | |---|---| | [Shared](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/shared/) | constructor(link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) | ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/kind/) | open override val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/kind/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | | [link](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/link/) | val [link](/developers/references/android/id-frak-sdk-ui/sharingresult/shared/link/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | # kind open override val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # link val link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) # Shared constructor(link: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)) # WalletOpened object WalletOpened : [SharingResult](/developers/references/android/id-frak-sdk-ui/sharingresult/) The wallet was already installed and [id.frak.sdk.AppLinkApi.openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) opened it. ## Properties | Name | Summary | |---|---| | [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/walletopened/kind/) | open override val [kind](/developers/references/android/id-frak-sdk-ui/sharingresult/walletopened/kind/): [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/)
Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. | # kind open override val kind: [SharingResult.Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) Stable discriminator, one per arm. A `when` over [Kind](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/) with an `else` survives a new arm; a `when` over the hierarchy does not. [Kind.wireValue](/developers/references/android/id-frak-sdk-ui/sharingresult/kind/wirevalue/) is spelled identically on iOS. # AppLinkApi class AppLinkApi Inbound referral links and the wallet app handoff. Obtained from [FrakClient.appLink](/developers/references/android/id-frak-sdk/frakclient/applink/). ## Functions | Name | Summary | |---|---| | [handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) | suspend fun [handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/)(url: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)
Decodes referral context, guards self-referral, tracks arrival. Not a "stop routing" signal. | | [handleReferralAsync](/developers/references/android/id-frak-sdk/applinkapi/handlereferralasync/) | fun [handleReferralAsync](/developers/references/android/id-frak-sdk/applinkapi/handlereferralasync/)(url: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)>
[handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) for Java. | | [installPageUrl](/developers/references/android/id-frak-sdk/applinkapi/installpageurl/) | suspend fun [installPageUrl](/developers/references/android/id-frak-sdk/applinkapi/installpageurl/)(returnScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), sessionId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Wallet's hosted install page, carrying a fresh proof. Not the store listing — [openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) handles that handoff itself. | | [installPageUrlAsync](/developers/references/android/id-frak-sdk/applinkapi/installpageurlasync/) | fun [installPageUrlAsync](/developers/references/android/id-frak-sdk/applinkapi/installpageurlasync/)(returnScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), sessionId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)>
[installPageUrl](/developers/references/android/id-frak-sdk/applinkapi/installpageurl/) for Java. Completes exceptionally with a [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) wrapped in a `CompletionException`. | | [isFrakAppInstalled](/developers/references/android/id-frak-sdk/applinkapi/isfrakappinstalled/) | fun [isFrakAppInstalled](/developers/references/android/id-frak-sdk/applinkapi/isfrakappinstalled/)(): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | | [openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) | suspend fun [openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/)(): [OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/)
Opens the wallet app if installed, else the Play Store listing with an install referrer. | | [openFrakAppAsync](/developers/references/android/id-frak-sdk/applinkapi/openfrakappasync/) | fun [openFrakAppAsync](/developers/references/android/id-frak-sdk/applinkapi/openfrakappasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/)>
[openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) for Java. | # handleReferral suspend fun handleReferral(url: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) Decodes referral context, guards self-referral, tracks arrival. Not a "stop routing" signal. # handleReferralAsync fun handleReferralAsync(url: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)> [handleReferral](/developers/references/android/id-frak-sdk/applinkapi/handlereferral/) for Java. # installPageUrl suspend fun installPageUrl(returnScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), sessionId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Wallet's hosted install page, carrying a fresh proof. Not the store listing — [openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) handles that handoff itself. #### Throws | | | |---|---| | [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) | when the page cannot be minted: tracking is disabled, the device refused key material, or no merchant could be resolved. | # installPageUrlAsync fun installPageUrlAsync(returnScheme: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), sessionId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)> [installPageUrl](/developers/references/android/id-frak-sdk/applinkapi/installpageurl/) for Java. Completes exceptionally with a [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) wrapped in a `CompletionException`. # isFrakAppInstalled fun isFrakAppInstalled(): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) # openFrakApp suspend fun openFrakApp(): [OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/) Opens the wallet app if installed, else the Play Store listing with an install referrer. # openFrakAppAsync fun openFrakAppAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/)> [openFrakApp](/developers/references/android/id-frak-sdk/applinkapi/openfrakapp/) for Java. # ConfigApi class ConfigApi Config resolution. Obtained from [FrakClient.config](/developers/references/android/id-frak-sdk/frakclient/config/). Every suspending member has a `*Async` twin returning a [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html) for Java callers; a [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) surfaces there wrapped in a `CompletionException`. ## Functions | Name | Summary | |---|---| | [resolve](/developers/references/android/id-frak-sdk/configapi/resolve/) | suspend fun [resolve](/developers/references/android/id-frak-sdk/configapi/resolve/)(): [FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/)
Stale-while-revalidate; only call that reliably 404s on a bad merchant id.
suspend fun [resolve](/developers/references/android/id-frak-sdk/configapi/resolve/)(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/) | | [resolveAsync](/developers/references/android/id-frak-sdk/configapi/resolveasync/) | fun [resolveAsync](/developers/references/android/id-frak-sdk/configapi/resolveasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/)>
[resolve](/developers/references/android/id-frak-sdk/configapi/resolve/) for Java. Completes on the main thread; blocking it from there throws.
fun [resolveAsync](/developers/references/android/id-frak-sdk/configapi/resolveasync/)(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/)>
[resolve](/developers/references/android/id-frak-sdk/configapi/resolve/) for Java. | # resolve suspend fun resolve(): [FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/) Stale-while-revalidate; only call that reliably 404s on a bad merchant id. suspend fun resolve(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/) #### Parameters android | | | |---|---| | forceRefresh | skips the cache-freshness check and the backoff. | # resolveAsync fun resolveAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/)> [resolve](/developers/references/android/id-frak-sdk/configapi/resolve/) for Java. Completes on the main thread; blocking it from there throws. fun resolveAsync(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResolvedConfig](/developers/references/android/id-frak-sdk-config/frakresolvedconfig/)> [resolve](/developers/references/android/id-frak-sdk/configapi/resolve/) for Java. # Frak object Frak Entry point. Call [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) once from `Application.onCreate`, then use [client](/developers/references/android/id-frak-sdk/frak/client/). Java callers use `Frak.getClient()` and the `*Async` twin of every suspending member. ## Properties | Name | Summary | |---|---| | [client](/developers/references/android/id-frak-sdk/frak/client/) | val [client](/developers/references/android/id-frak-sdk/frak/client/): [FrakClient](/developers/references/android/id-frak-sdk/frakclient/) | | [clientOrNull](/developers/references/android/id-frak-sdk/frak/clientornull/) | val [clientOrNull](/developers/references/android/id-frak-sdk/frak/clientornull/): [FrakClient](/developers/references/android/id-frak-sdk/frakclient/)?
Same as [client](/developers/references/android/id-frak-sdk/frak/client/), but null instead of throwing. | | [isInitialized](/developers/references/android/id-frak-sdk/frak/isinitialized/) | val [isInitialized](/developers/references/android/id-frak-sdk/frak/isinitialized/): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)
Whether [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) has run. For merchants guarding optional integrations. | ## Functions | Name | Summary | |---|---| | [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) | fun [initialize](/developers/references/android/id-frak-sdk/frak/initialize/)(context: Context, config: [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/))
Non-blocking, does no I/O, never throws. Second call is a no-op; first config wins. | | [parseReferralLink](/developers/references/android/id-frak-sdk/frak/parsereferrallink/) | fun [parseReferralLink](/developers/references/android/id-frak-sdk/frak/parsereferrallink/)(url: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakContext](/developers/references/android/id-frak-sdk-sharing/frakcontext/)?
Pure and static; callable before [initialize](/developers/references/android/id-frak-sdk/frak/initialize/). Only decodes — does not track arrival. | | [shutdown](/developers/references/android/id-frak-sdk/frak/shutdown/) | suspend fun [shutdown](/developers/references/android/id-frak-sdk/frak/shutdown/)()
Tears the SDK down: cancels background coroutines, unregisters the deep-link observer, and drops the client so [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) can run again. Not a privacy control — use [FrakClient.setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) for that. Idempotent; Java uses [shutdownAsync](/developers/references/android/id-frak-sdk/frak/shutdownasync/). | | [shutdownAsync](/developers/references/android/id-frak-sdk/frak/shutdownasync/) | fun [shutdownAsync](/developers/references/android/id-frak-sdk/frak/shutdownasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Void](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html)?>
[shutdown](/developers/references/android/id-frak-sdk/frak/shutdown/) for Java. Runs on its own scope, not the client's, which `shutdown()` cancels. Blocking it from the main thread throws rather than deadlocking; sequence a following [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) off the future (`thenRun`) rather than beside it, or the new client races the old one's teardown. | # client val client: [FrakClient](/developers/references/android/id-frak-sdk/frakclient/) #### Throws | | | |---|---| | [FrakError.NotInitialized](/developers/references/android/id-frak-sdk-core/frakerror/notinitialized/) | when [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) has not run. | # clientOrNull val clientOrNull: [FrakClient](/developers/references/android/id-frak-sdk/frakclient/)? Same as [client](/developers/references/android/id-frak-sdk/frak/client/), but null instead of throwing. # initialize fun initialize(context: Context, config: [FrakConfig](/developers/references/android/id-frak-sdk-core/frakconfig/)) Non-blocking, does no I/O, never throws. Second call is a no-op; first config wins. # isInitialized val isInitialized: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) Whether [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) has run. For merchants guarding optional integrations. # parseReferralLink fun parseReferralLink(url: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakContext](/developers/references/android/id-frak-sdk-sharing/frakcontext/)? Pure and static; callable before [initialize](/developers/references/android/id-frak-sdk/frak/initialize/). Only decodes — does not track arrival. # shutdown suspend fun shutdown() Tears the SDK down: cancels background coroutines, unregisters the deep-link observer, and drops the client so [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) can run again. Not a privacy control — use [FrakClient.setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) for that. Idempotent; Java uses [shutdownAsync](/developers/references/android/id-frak-sdk/frak/shutdownasync/). # shutdownAsync fun shutdownAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Void](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html)?> [shutdown](/developers/references/android/id-frak-sdk/frak/shutdown/) for Java. Runs on its own scope, not the client's, which `shutdown()` cancels. Blocking it from the main thread throws rather than deadlocking; sequence a following [initialize](/developers/references/android/id-frak-sdk/frak/initialize/) off the future (`thenRun`) rather than beside it, or the new client races the old one's teardown. # FrakClient class FrakClient Everything the SDK can do. Obtained from [Frak.client](/developers/references/android/id-frak-sdk/frak/client/). Every suspending member has a `*Async` twin returning a [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html), since a Java caller cannot name a `Continuation`. How failure is signalled, one tier per kind of answer: - `T?` means **absence** — nothing was there, and that is a normal answer ([anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/), [RewardsApi.best](/developers/references/android/id-frak-sdk/rewardsapi/best/), [SharingApi.buildLink](/developers/references/android/id-frak-sdk/sharingapi/buildlink/)'s null arm). - A sealed or enum type means **outcome** — several ends are all valid ([OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/)). - `Boolean` means **predicate** ([AppLinkApi.isFrakAppInstalled](/developers/references/android/id-frak-sdk/applinkapi/isfrakappinstalled/)). - A thrown [id.frak.sdk.core.FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) means **failure** — the call could have worked and did not ([ConfigApi.resolve](/developers/references/android/id-frak-sdk/configapi/resolve/), [RewardsApi.campaigns](/developers/references/android/id-frak-sdk/rewardsapi/campaigns/), [SharingApi.buildLink](/developers/references/android/id-frak-sdk/sharingapi/buildlink/), [AppLinkApi.installPageUrl](/developers/references/android/id-frak-sdk/applinkapi/installpageurl/)). Through an `*Async` twin this arrives as a `CompletionException` whose `cause` is the [id.frak.sdk.core.FrakError](/developers/references/android/id-frak-sdk-core/frakerror/). [TrackingApi](/developers/references/android/id-frak-sdk/trackingapi/) is the one deliberate exception: it returns [id.frak.sdk.core.FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/) and never throws, because it is called from hot paths where a disabled-tracking refusal is expected rather than exceptional. A tier change is invisible to the ABI dump, so it needs a `!` commit. ## Properties | Name | Summary | |---|---| | [appLink](/developers/references/android/id-frak-sdk/frakclient/applink/) | val [appLink](/developers/references/android/id-frak-sdk/frakclient/applink/): [AppLinkApi](/developers/references/android/id-frak-sdk/applinkapi/)
Inbound referral links and the wallet app handoff. | | [config](/developers/references/android/id-frak-sdk/frakclient/config/) | val [config](/developers/references/android/id-frak-sdk/frakclient/config/): [ConfigApi](/developers/references/android/id-frak-sdk/configapi/)
Config resolution and its live stream. | | [environment](/developers/references/android/id-frak-sdk/frakclient/environment/) | val [environment](/developers/references/android/id-frak-sdk/frakclient/environment/): [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/)
The stage this client talks to. Merchants never set it directly, see [id.frak.sdk.core.FrakConfig.env](/developers/references/android/id-frak-sdk-core/frakconfig/env/). | | [metadataLang](/developers/references/android/id-frak-sdk/frakclient/metadatalang/) | val [metadataLang](/developers/references/android/id-frak-sdk/frakclient/metadatalang/): [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)?
The merchant-supplied build-time language, for the same tier-3 copy. See [metadataName](/developers/references/android/id-frak-sdk/frakclient/metadataname/). | | [metadataName](/developers/references/android/id-frak-sdk/frakclient/metadataname/) | val [metadataName](/developers/references/android/id-frak-sdk/frakclient/metadataname/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
The merchant-supplied build-time name. `public` only so `:frak-sdk-ui` can read it across the module boundary. | | [rewards](/developers/references/android/id-frak-sdk/frakclient/rewards/) | val [rewards](/developers/references/android/id-frak-sdk/frakclient/rewards/): [RewardsApi](/developers/references/android/id-frak-sdk/rewardsapi/)
Campaigns and the single best reward to advertise. | | [sharing](/developers/references/android/id-frak-sdk/frakclient/sharing/) | val [sharing](/developers/references/android/id-frak-sdk/frakclient/sharing/): [SharingApi](/developers/references/android/id-frak-sdk/sharingapi/)
Share link construction. | | [tracking](/developers/references/android/id-frak-sdk/frakclient/tracking/) | val [tracking](/developers/references/android/id-frak-sdk/frakclient/tracking/): [TrackingApi](/developers/references/android/id-frak-sdk/trackingapi/)
Interaction and purchase tracking. | ## Functions | Name | Summary | |---|---| | [anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/) | suspend fun [anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/)(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Anonymous id, or null when tracking is disabled or the device refused key material. | | [anonymousIdAsync](/developers/references/android/id-frak-sdk/frakclient/anonymousidasync/) | fun [anonymousIdAsync](/developers/references/android/id-frak-sdk/frakclient/anonymousidasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?>
[anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/) for Java. | | [isTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/istrackingenabled/) | suspend fun [isTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/istrackingenabled/)(): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)
Whether tracking is currently allowed: `FrakConfig.trackingEnabled` AND the persisted runtime decision. | | [isTrackingEnabledAsync](/developers/references/android/id-frak-sdk/frakclient/istrackingenabledasync/) | fun [isTrackingEnabledAsync](/developers/references/android/id-frak-sdk/frakclient/istrackingenabledasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)>
[isTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/istrackingenabled/) for Java. | | [resetAnonymousId](/developers/references/android/id-frak-sdk/frakclient/resetanonymousid/) | suspend fun [resetAnonymousId](/developers/references/android/id-frak-sdk/frakclient/resetanonymousid/)(): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)
Destroys the keypair so the next [anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/) mints a new identity. | | [resetAnonymousIdAsync](/developers/references/android/id-frak-sdk/frakclient/resetanonymousidasync/) | fun [resetAnonymousIdAsync](/developers/references/android/id-frak-sdk/frakclient/resetanonymousidasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)>
[resetAnonymousId](/developers/references/android/id-frak-sdk/frakclient/resetanonymousid/) for Java. | | [setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) | suspend fun [setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/)(enabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html))
Turns tracking on or off at runtime and persists the decision for this install. `false` purges anything still queued, which can discard purchase events not yet sent; `true` cannot lift a build shipping `trackingEnabled(false)`. Identity survives — see [resetAnonymousId](/developers/references/android/id-frak-sdk/frakclient/resetanonymousid/). | | [setTrackingEnabledAsync](/developers/references/android/id-frak-sdk/frakclient/settrackingenabledasync/) | fun [setTrackingEnabledAsync](/developers/references/android/id-frak-sdk/frakclient/settrackingenabledasync/)(enabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Void](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html)?>
[setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) for Java. | # anonymousId suspend fun anonymousId(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Anonymous id, or null when tracking is disabled or the device refused key material. # anonymousIdAsync fun anonymousIdAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?> [anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/) for Java. # appLink val appLink: [AppLinkApi](/developers/references/android/id-frak-sdk/applinkapi/) Inbound referral links and the wallet app handoff. # config val config: [ConfigApi](/developers/references/android/id-frak-sdk/configapi/) Config resolution and its live stream. # environment val environment: [FrakEnvironment](/developers/references/android/id-frak-sdk-core/frakenvironment/) The stage this client talks to. Merchants never set it directly, see [id.frak.sdk.core.FrakConfig.env](/developers/references/android/id-frak-sdk-core/frakconfig/env/). # isTrackingEnabled suspend fun isTrackingEnabled(): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) Whether tracking is currently allowed: `FrakConfig.trackingEnabled` AND the persisted runtime decision. # isTrackingEnabledAsync fun isTrackingEnabledAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)> [isTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/istrackingenabled/) for Java. # metadataLang val metadataLang: [FrakLanguage](/developers/references/android/id-frak-sdk-core/fraklanguage/)? The merchant-supplied build-time language, for the same tier-3 copy. See [metadataName](/developers/references/android/id-frak-sdk/frakclient/metadataname/). # metadataName val metadataName: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? The merchant-supplied build-time name. `public` only so `:frak-sdk-ui` can read it across the module boundary. # resetAnonymousId suspend fun resetAnonymousId(): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) Destroys the keypair so the next [anonymousId](/developers/references/android/id-frak-sdk/frakclient/anonymousid/) mints a new identity. This is a local identity rotation, not an Art. 17 erasure: events already sent stay attributed to the old id on Frak's side. Route an actual erasure request to https://frak.id/account-deletion. #### Return false when the platform keystore refused to erase the key; the identity did not rotate. # resetAnonymousIdAsync fun resetAnonymousIdAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)> [resetAnonymousId](/developers/references/android/id-frak-sdk/frakclient/resetanonymousid/) for Java. # rewards val rewards: [RewardsApi](/developers/references/android/id-frak-sdk/rewardsapi/) Campaigns and the single best reward to advertise. # setTrackingEnabled suspend fun setTrackingEnabled(enabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)) Turns tracking on or off at runtime and persists the decision for this install. `false` purges anything still queued, which can discard purchase events not yet sent; `true` cannot lift a build shipping `trackingEnabled(false)`. Identity survives — see [resetAnonymousId](/developers/references/android/id-frak-sdk/frakclient/resetanonymousid/). # setTrackingEnabledAsync fun setTrackingEnabledAsync(enabled: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[Void](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html)?> [setTrackingEnabled](/developers/references/android/id-frak-sdk/frakclient/settrackingenabled/) for Java. # sharing val sharing: [SharingApi](/developers/references/android/id-frak-sdk/sharingapi/) Share link construction. # tracking val tracking: [TrackingApi](/developers/references/android/id-frak-sdk/trackingapi/) Interaction and purchase tracking. # FrakSdkVersion object FrakSdkVersion Version of this SDK build, sent on every request. `@JvmStatic val` rather than `const val`: a `const` is inlined into the merchant's bytecode and would report their compile-time version. ## Properties | Name | Summary | |---|---| | [CURRENT](/developers/references/android/id-frak-sdk/fraksdkversion/current/) | val [CURRENT](/developers/references/android/id-frak-sdk/fraksdkversion/current/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Keep in step with `frak.sdk.version` in `gradle.properties`; the build checks it. | | [HEADER_NAME](/developers/references/android/id-frak-sdk/fraksdkversion/header_name/) | val [HEADER_NAME](/developers/references/android/id-frak-sdk/fraksdkversion/header_name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Wire plumbing for `HttpClient`; not merchant API. | | [HEADER_VALUE](/developers/references/android/id-frak-sdk/fraksdkversion/header_value/) | val [HEADER_VALUE](/developers/references/android/id-frak-sdk/fraksdkversion/header_value/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
What [HEADER_NAME](/developers/references/android/id-frak-sdk/fraksdkversion/header_name/) carries. Platform-prefixed: the version alone is identical on both SDKs, so a fleet of frozen binaries is otherwise indistinguishable on the wire. | | [QUERY_PARAMETER_NAME](/developers/references/android/id-frak-sdk/fraksdkversion/query_parameter_name/) | val [QUERY_PARAMETER_NAME](/developers/references/android/id-frak-sdk/fraksdkversion/query_parameter_name/): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)
Wire plumbing for `:frak-sdk-ui`'s page URLs; not merchant API. | # CURRENT val CURRENT: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Keep in step with `frak.sdk.version` in `gradle.properties`; the build checks it. # HEADER_NAME val HEADER_NAME: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Wire plumbing for `HttpClient`; not merchant API. # HEADER_VALUE val HEADER_VALUE: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) What [HEADER_NAME](/developers/references/android/id-frak-sdk/fraksdkversion/header_name/) carries. Platform-prefixed: the version alone is identical on both SDKs, so a fleet of frozen binaries is otherwise indistinguishable on the wire. # QUERY_PARAMETER_NAME val QUERY_PARAMETER_NAME: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) Wire plumbing for `:frak-sdk-ui`'s page URLs; not merchant API. # InternalFrakApi @[Target](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-target/index.html)(allowedTargets = [[AnnotationTarget.CLASS](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-l-a-s-s/index.html), [AnnotationTarget.PROPERTY](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-p-r-o-p-e-r-t-y/index.html), [AnnotationTarget.FUNCTION](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-f-u-n-c-t-i-o-n/index.html), [AnnotationTarget.CONSTRUCTOR](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-o-n-s-t-r-u-c-t-o-r/index.html)]) annotation class InternalFrakApi Marks a declaration that is `public` only so the sibling `:frak-sdk-ui` module can see it, with no compatibility guarantee. Wired into binary-compatibility-validator's `nonPublicMarkers`, so marked types stay out of the committed `.api` dump. # OpenAppResult enum OpenAppResult : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)<OpenAppResult> ## Entries | | | |---|---| | [OpenedApp](/developers/references/android/id-frak-sdk/openappresult/openedapp/) | [OpenedApp](/developers/references/android/id-frak-sdk/openappresult/openedapp/) | | [OpenedStore](/developers/references/android/id-frak-sdk/openappresult/openedstore/) | [OpenedStore](/developers/references/android/id-frak-sdk/openappresult/openedstore/) | | [Failed](/developers/references/android/id-frak-sdk/openappresult/failed/) | [Failed](/developers/references/android/id-frak-sdk/openappresult/failed/) | ## Functions | Name | Summary | |---|---| | [valueOf](/developers/references/android/id-frak-sdk/openappresult/valueof/) | fun [valueOf](/developers/references/android/id-frak-sdk/openappresult/valueof/)(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): OpenAppResult
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) | | [values](/developers/references/android/id-frak-sdk/openappresult/values/) | fun [values](/developers/references/android/id-frak-sdk/openappresult/values/)(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<OpenAppResult>
Returns an array containing the constants of this enum type, in the order they're declared. | # Failed Failed # OpenedApp OpenedApp # OpenedStore OpenedStore # valueOf fun valueOf(value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) #### Throws | | | |---|---| | kotlin.IllegalArgumentException | if this enum type has no constant with the specified name | # values fun values(): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)<[OpenAppResult](/developers/references/android/id-frak-sdk/openappresult/)> Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. # RewardsApi class RewardsApi Campaigns and reward selection. Obtained from [FrakClient.rewards](/developers/references/android/id-frak-sdk/frakclient/rewards/). ## Functions | Name | Summary | |---|---| | [best](/developers/references/android/id-frak-sdk/rewardsapi/best/) | suspend fun [best](/developers/references/android/id-frak-sdk/rewardsapi/best/)(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)): [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)?
Reward worth advertising, formatted server-side; null when nothing matches.
suspend fun [best](/developers/references/android/id-frak-sdk/rewardsapi/best/)(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/), forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)? | | [bestAsync](/developers/references/android/id-frak-sdk/rewardsapi/bestasync/) | fun [bestAsync](/developers/references/android/id-frak-sdk/rewardsapi/bestasync/)(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)?>
fun [bestAsync](/developers/references/android/id-frak-sdk/rewardsapi/bestasync/)(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/), forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)?>
[best](/developers/references/android/id-frak-sdk/rewardsapi/best/) for Java. | | [campaigns](/developers/references/android/id-frak-sdk/rewardsapi/campaigns/) | suspend fun [campaigns](/developers/references/android/id-frak-sdk/rewardsapi/campaigns/)(): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)>
Active campaigns for this merchant, highest priority first.
suspend fun [campaigns](/developers/references/android/id-frak-sdk/rewardsapi/campaigns/)(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)> | | [campaignsAsync](/developers/references/android/id-frak-sdk/rewardsapi/campaignsasync/) | fun [campaignsAsync](/developers/references/android/id-frak-sdk/rewardsapi/campaignsasync/)(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)>>
fun [campaignsAsync](/developers/references/android/id-frak-sdk/rewardsapi/campaignsasync/)(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)>>
[campaigns](/developers/references/android/id-frak-sdk/rewardsapi/campaigns/) for Java. | # best suspend fun best(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)): [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)? Reward worth advertising, formatted server-side; null when nothing matches. Call once per screen for the whole visible product set, not once per row: the cache is keyed on the encoded product list, so per-row calls multiply cache keys and requests. suspend fun best(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/), forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)? #### Parameters android | | | |---|---| | forceRefresh | skips the cache and the backoff. | # bestAsync fun bestAsync(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)?> fun bestAsync(request: [RewardRequest](/developers/references/android/id-frak-sdk-rewards/rewardrequest/), forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[BestReward](/developers/references/android/id-frak-sdk-rewards/bestreward/)?> [best](/developers/references/android/id-frak-sdk/rewardsapi/best/) for Java. # campaigns suspend fun campaigns(): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)> Active campaigns for this merchant, highest priority first. suspend fun campaigns(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)> #### Parameters android | | | |---|---| | forceRefresh | skips the cache and the backoff. | # campaignsAsync fun campaignsAsync(): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)>> fun campaignsAsync(forceRefresh: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)<[Campaign](/developers/references/android/id-frak-sdk-rewards/campaign/)>> [campaigns](/developers/references/android/id-frak-sdk/rewardsapi/campaigns/) for Java. # SharingApi class SharingApi Share link construction. Obtained from [FrakClient.sharing](/developers/references/android/id-frak-sdk/frakclient/sharing/). ## Functions | Name | Summary | |---|---| | [buildLink](/developers/references/android/id-frak-sdk/sharingapi/buildlink/) | suspend fun [buildLink](/developers/references/android/id-frak-sdk/sharingapi/buildlink/)(request: [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?
Builds a share link for [request](/developers/references/android/id-frak-sdk/sharingapi/buildlink/). | | [buildLinkAsync](/developers/references/android/id-frak-sdk/sharingapi/buildlinkasync/) | fun [buildLinkAsync](/developers/references/android/id-frak-sdk/sharingapi/buildlinkasync/)(request: [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?>
[buildLink](/developers/references/android/id-frak-sdk/sharingapi/buildlink/) for Java. Completes with null on the same "nothing to link to" path, and completes exceptionally with a [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) wrapped in a `CompletionException` otherwise. | # buildLink suspend fun buildLink(request: [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? Builds a share link for request. #### Return null only when there is nothing to link to: the request carried no link, none of its products did, and neither the resolved config nor [id.frak.sdk.core.FrakMetadata.homepageLink](/developers/references/android/id-frak-sdk-core/frakmetadata/homepagelink/) supplies one. That is answerable without a network round trip, so it is an absence rather than a failure. #### Throws | | | |---|---| | [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) | when a link could have been built but could not be: tracking is disabled, the device refused key material, or no merchant could be resolved. | # buildLinkAsync fun buildLinkAsync(request: [SharingRequest](/developers/references/android/id-frak-sdk-sharing/sharingrequest/)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?> [buildLink](/developers/references/android/id-frak-sdk/sharingapi/buildlink/) for Java. Completes with null on the same "nothing to link to" path, and completes exceptionally with a [FrakError](/developers/references/android/id-frak-sdk-core/frakerror/) wrapped in a `CompletionException` otherwise. # TrackingApi class TrackingApi Interaction and purchase tracking. Obtained from [FrakClient.tracking](/developers/references/android/id-frak-sdk/frakclient/tracking/). ## Functions | Name | Summary | |---|---| | [purchase](/developers/references/android/id-frak-sdk/trackingapi/purchase/) | suspend fun [purchase](/developers/references/android/id-frak-sdk/trackingapi/purchase/)(customerId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), orderId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), token: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)>
Records a purchase; same enqueue-then-send contract as [track](/developers/references/android/id-frak-sdk/trackingapi/track/). | | [purchaseAsync](/developers/references/android/id-frak-sdk/trackingapi/purchaseasync/) | fun [purchaseAsync](/developers/references/android/id-frak-sdk/trackingapi/purchaseasync/)(customerId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), orderId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), token: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)>>
[purchase](/developers/references/android/id-frak-sdk/trackingapi/purchase/) for Java. | | [track](/developers/references/android/id-frak-sdk/trackingapi/track/) | suspend fun [track](/developers/references/android/id-frak-sdk/trackingapi/track/)(interaction: [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)): [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)>
Records an [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/); succeeds once durable, not once delivered (queued, oldest-first). | | [trackAsync](/developers/references/android/id-frak-sdk/trackingapi/trackasync/) | fun [trackAsync](/developers/references/android/id-frak-sdk/trackingapi/trackasync/)(interaction: [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)>>
[track](/developers/references/android/id-frak-sdk/trackingapi/track/) for Java. | # purchase suspend fun purchase(customerId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), orderId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), token: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)> Records a purchase; same enqueue-then-send contract as [track](/developers/references/android/id-frak-sdk/trackingapi/track/). # purchaseAsync fun purchaseAsync(customerId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), orderId: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), token: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)>> [purchase](/developers/references/android/id-frak-sdk/trackingapi/purchase/) for Java. # track suspend fun track(interaction: [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)): [FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)> Records an [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/); succeeds once durable, not once delivered (queued, oldest-first). # trackAsync fun trackAsync(interaction: [Interaction](/developers/references/android/id-frak-sdk-tracking/interaction/)): [CompletableFuture](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletableFuture.html)<[FrakResult](/developers/references/android/id-frak-sdk-core/frakresult/)<[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)>> [track](/developers/references/android/id-frak-sdk/trackingapi/track/) for Java. # Banner > **Banner**(`__namedParameters`): `Element` \| `null` Defined in: vendor/wallet/sdk/components/src/components/Banner/Banner.tsx:77 Auto-detecting notification banner component. Renders an inline banner on the merchant page with one of two distinct visual styles depending on the detected mode: - **Referral mode** (white): Shown after a successful referral link processing. Displays a gift icon, reward copy, and a "Got it" CTA. - **In-app browser mode** (dark transparent): Shown when the page is opened inside a social media in-app browser (Instagram, Facebook). Offers an inline link to redirect to the default browser plus a close button to dismiss. In-app browser mode takes priority over referral mode. Uses Light DOM + vanilla-extract styles from `@frak-labs/design-system`. ## Parameters ### \_\_namedParameters #### allowInappRedirect? `boolean` \| `"true"` \| `"false"` When `true` (default `false`), the banner is allowed to switch to in-app browser mode (Instagram / Facebook WebView) and prompt the user to escape to the system browser. Most flows now work inside in-app browsers via the anonymous-id flow, so the redirect is opt-in. Enable it only on surfaces that actually drive users into a WebAuthn-bound action (login, sendTransaction, SIWE authenticate). Accepts the boolean `true` (TS/JSX) or the string `"true"` (HTML attribute). Any other value — including `false`, `"false"`, the empty string, or attribute absence — keeps the redirect disabled. #### classname? `string` = `""` CSS class names passed through to the root element (Light DOM). #### imageUrl? `string` Override the image displayed on the left of the referral banner. Accepts an image URL. Falls back to the built-in gift icon when omitted. The image is constrained to the icon slot via `object-fit: contain`, so any aspect ratio renders correctly. #### inappCta? `string` Override the in-app browser banner CTA button text. #### inappDescription? `string` Override the in-app browser banner description. #### inappTitle? `string` Override the in-app browser banner title. #### interaction? `"referral"` \| `"create_referral_link"` \| `"purchase"` \| `` `custom.${string}` `` Filter rewards by interaction type (e.g. "purchase", "referral"). When omitted, the best reward across all interaction types is shown. #### placement? `string` Placement ID for backend-driven CSS customization. #### preview? `string` When set, forces the banner to render in preview mode (e.g. in Shopify theme editor). Bypasses normal event/browser detection and shows static content. #### previewMode? `"referral"` \| `"inapp"` Which banner variant to preview: "referral" or "inapp". Only used when preview is set. Defaults to "referral". #### products? `string` \| `ProductDetails`[] Products currently in view, used to prefer a campaign whose `productScope` matches one of them when picking the reward to advertise. Accepts a ProductDetails array (JS property) or a JSON-stringified array (HTML attribute). #### referralCta? `string` Override the referral banner CTA button text. #### referralDescription? `string` Override the referral banner description. #### referralTitle? `string` Override the referral banner title. ## Returns `Element` \| `null` ## Examples Basic usage (auto-detects mode): ```html ``` With a custom class: ```html ``` # ButtonShare > **ButtonShare**(`args`): `Element` \| `null` Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/ButtonShare.tsx:71 Button to share the current page ## Parameters ### args #### classname? `string` = `""` Classname to apply to the button #### clickAction? `string` & \{ \} \| `"sharing-page"` Reported on the `share_button_clicked` event. It no longer selects anything: every click opens the full-page sharing UI. Retired values (`"share-modal"`, `"embedded-wallet"`) stay accepted because merchant configs and saved plugin markup still carry them, and the resolved value is reported as-is so a legacy config stays visible in analytics. **Default Value** `"sharing-page"` #### noRewardText? `string` Fallback text when `text` contains the `{REWARD}` placeholder but no reward is available. #### placement? `string` #### preview? `string` When set, renders the button in preview mode (e.g. Shopify/WP editor). Skips the client-ready gating so the button is always enabled visually, and no-ops the click handler so merchants can see the final layout with their configured copy even when no Frak client is initialized. #### products? `string` \| `SharingPageProduct`[] Products currently in view, used to prefer a campaign whose `productScope` matches one of them when picking the reward to advertise, and forwarded to the sharing page so it can render product cards. Accepts a SharingPageProduct array (JS property) or a JSON-stringified array (HTML attribute). #### targetInteraction? `"referral"` \| `"create_referral_link"` \| `"purchase"` \| `` `custom.${string}` `` Target interaction behind this sharing action (will be used to get the right reward to display) #### text? `string` Text to display on the button. Including the placeholder `{REWARD}` (e.g. `Share and earn up to \{REWARD\}!`) opts the button into the live reward flow: the SDK fetches the estimated reward and substitutes the placeholder. When no reward is available, `noRewardText` is used as a fallback (or the placeholder is stripped if no fallback is provided). When omitted, a built-in localized default is used based on the resolved language (`"Share & earn {REWARD}!"` / `"Partagez et gagnez {REWARD} !"`) — mirroring the dashboard's first wording preset. ## Returns `Element` \| `null` The share button with ` ``` ## Remarks The proof is minted at prepare time and carries a 10-minute validity window. A URL prepared and left unused for longer still opens SSO and still logs the user in — only the anonymous-to-wallet identity link is dropped. Re-prepare on a long-lived page rather than holding one URL indefinitely. Not to be confused with [prepareSso](/developers/references/core-sdk/actions/functions/preparesso/), which asks the wallet iframe to build the URL over RPC and cannot mint a proof. # processReferral > **processReferral**(`client`, `args`): `Promise`\<`"success"` \| `"idle"` \| `"processing"` \| `"no-referrer"` \| `"self-referral"`\> Defined in: actions/referral/processReferral.ts:150 Handle the full referral interaction flow: 1. Check if the user has been referred (if not, early exit) 2. Preflight self-referral check (if yes, early exit) 3. Track the arrival event 4. Replace the current URL with the user's own referral context 5. Return the resulting referral state ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The current Frak Client ### args #### frakContext? `FrakContext` \| `null` The referral context parsed from the URL #### options? [`ProcessReferralOptions`](/developers/references/core-sdk/actions/type-aliases/processreferraloptions/) Options for URL replacement and merchant context #### walletStatus? [`WalletStatusReturnType`](/developers/references/core-sdk/index/type-aliases/walletstatusreturntype/) The current user wallet status ## Returns `Promise`\<`"success"` \| `"idle"` \| `"processing"` \| `"no-referrer"` \| `"self-referral"`\> The referral state ## See @frak-labs/core-sdk!ModalStepTypes for modal step types # referralInteraction > **referralInteraction**(`client`, `args?`): `Promise`\<`"success"` \| `"idle"` \| `"processing"` \| `"no-referrer"` \| `"self-referral"` \| `undefined`\> Defined in: actions/referral/referralInteraction.ts:21 Function used to handle referral interactions ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The current Frak Client ### args? #### options? [`ProcessReferralOptions`](/developers/references/core-sdk/actions/type-aliases/processreferraloptions/) Some options for the referral interaction ## Returns `Promise`\<`"success"` \| `"idle"` \| `"processing"` \| `"no-referrer"` \| `"self-referral"` \| `undefined`\> A promise with the resulting referral state, or undefined in case of an error ## Description This function will automatically handle the referral interaction process ## See [processReferral](/developers/references/core-sdk/actions/functions/processreferral/) for more details on the automatic referral handling process # sendInteraction > **sendInteraction**(`client`, `params`): `Promise`\<`void`\> Defined in: actions/sendInteraction.ts:43 Send an interaction to the backend via the listener RPC. Fire-and-forget: errors are caught and logged, not thrown. ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The Frak client instance ### params [`SendInteractionParamsType`](/developers/references/core-sdk/index/type-aliases/sendinteractionparamstype/) The interaction parameters ## Returns `Promise`\<`void`\> ## Description Sends a user interaction event through the wallet iframe RPC. Supports three interaction types: arrival tracking, sharing events, and custom interactions. ## Examples Track a user arrival with referral attribution: ```ts await sendInteraction(client, { type: "arrival", referrerWallet: "0x1234...abcd", landingUrl: window.location.href, utmSource: "twitter", utmMedium: "social", utmCampaign: "launch-2026", }); ``` Track a sharing event: ```ts await sendInteraction(client, { type: "sharing" }); ``` Send a custom interaction: ```ts await sendInteraction(client, { type: "custom", customType: "newsletter_signup", data: { email: "user@example.com" }, }); ``` # sendTransaction > **sendTransaction**(`client`, `args`): `Promise`\<\{ `hash`: `` `0x${string}` ``; \}\> Defined in: actions/wrapper/sendTransaction.ts:47 Function used to send a user transaction, simple wrapper around the displayModal function to ease the send transaction process ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The current Frak Client ### args The parameters #### metadata? [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) Custom metadata to be passed to the modal #### tx [`SendTransactionTxType`](/developers/references/core-sdk/index/type-aliases/sendtransactiontxtype/) \| [`SendTransactionTxType`](/developers/references/core-sdk/index/type-aliases/sendtransactiontxtype/)[] The transaction to be sent (either a single tx or multiple ones) ## Returns `Promise`\<\{ `hash`: `` `0x${string}` ``; \}\> The hash of the transaction that was sent in a promise ## Description This function will display a modal to the user with the provided transaction and metadata. ## Example ```ts const { hash } = await sendTransaction(frakConfig, { tx: { to: "0xdeadbeef", value: toHex(100n), }, metadata: { header: { title: "Sending eth", }, context: "Send 100wei to 0xdeadbeef", }, }); console.log("Transaction hash:", hash); ``` # setupReferral > **setupReferral**(`client`): `Promise`\<`void`\> Defined in: actions/referral/setupReferral.ts:22 Process referral context and emit a DOM event on success. - Calls [referralInteraction](/developers/references/core-sdk/actions/functions/referralinteraction/) to detect and track any referral in the URL - On `"success"`, dispatches a bare [REFERRAL\_SUCCESS\_EVENT](/developers/references/core-sdk/actions/variables/referral_success_event/) on `window` - Silently swallows errors (fire-and-forget during SDK init) ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The initialized Frak client ## Returns `Promise`\<`void`\> # siweAuthenticate > **siweAuthenticate**(`client`, `args`): `Promise`\<\{ `message`: `string`; `signature`: `` `0x${string}` ``; \}\> Defined in: actions/wrapper/siweAuthenticate.ts:86 Function used to launch a siwe authentication ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The current Frak Client ### args The parameters #### metadata? [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) Custom metadata to be passed to the modal #### siwe? `Partial`\<[`SiweAuthenticationParams`](/developers/references/core-sdk/index/type-aliases/siweauthenticationparams/)\> Partial SIWE params, since we can rebuild them from the SDK if they are empty If no parameters provider, some fields will be recomputed from the current configuration and environment. - `statement` will be set to a default value - `nonce` will be generated - `uri` will be set to the current domain - `version` will be set to "1" - `domain` will be set to the current window domain **Default** ```ts {} ``` ## Returns `Promise`\<\{ `message`: `string`; `signature`: `` `0x${string}` ``; \}\> The SIWE authentication result (message + signature) in a promise ## Description This function will display a modal to the user with the provided SIWE parameters and metadata. ## Example ```ts import { siweAuthenticate } from "@frak-labs/core-sdk/actions"; import { parseSiweMessage } from "viem/siwe"; const { signature, message } = await siweAuthenticate(frakConfig, { siwe: { statement: "Sign in to My App", domain: "my-app.com", expirationTimeTimestamp: Date.now() + 1000 * 60 * 5, }, metadata: { header: { title: "Sign in", }, context: "Sign in to My App", }, }); console.log("Parsed final message:", parseSiweMessage(message)); console.log("Siwe signature:", signature); ``` # trackPurchaseStatus > **trackPurchaseStatus**(`args`): `Promise`\<`void`\> Defined in: actions/trackPurchaseStatus.ts:34 Function used to track the status of a purchase when a purchase is tracked, the `purchaseCompleted` interactions will be automatically send for the user when we receive the purchase confirmation via webhook. ## Parameters ### args #### customerId `string` \| `number` The customer id that made the purchase (on your side) #### merchantId? `string` Optional explicit merchant id to use for the tracking request #### orderId `string` \| `number` The order id of the purchase (on your side) #### token `string` The token of the purchase ## Returns `Promise`\<`void`\> ## Description This function will send a request to the backend to listen for the purchase status. ## Example ```ts async function trackPurchase(checkout) { const payload = { customerId: checkout.order.customer.id, orderId: checkout.order.id, token: checkout.token, merchantId: "your-merchant-id", }; await trackPurchaseStatus(payload); } ``` ## Remarks - Merchant id is resolved in this order: explicit `args.merchantId`, then `sdkConfigStore.resolveMerchantId()` (config store → sessionStorage → backend fetch). - This function supports anonymous users and will use the `x-frak-client-id` header when available. - At least one identity source must exist (`frak-wallet-interaction-token` or `x-frak-client-id`), otherwise the tracking request is skipped. - This function will print a warning if used in a non-browser environment or if no identity / merchant id can be resolved. # watchWalletStatus > **watchWalletStatus**(`client`, `callback?`): `Promise`\<[`WalletStatusReturnType`](/developers/references/core-sdk/index/type-aliases/walletstatusreturntype/)\> Defined in: actions/watchWalletStatus.ts:23 Function used to watch the current frak wallet status ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) The current Frak Client ### callback? (`status`) => `void` The callback that will receive any wallet status change ## Returns `Promise`\<[`WalletStatusReturnType`](/developers/references/core-sdk/index/type-aliases/walletstatusreturntype/)\> A promise resolving with the initial wallet status ## Description This function will return the current wallet status, and will listen to any change in the wallet status. ## Example ```ts await watchWalletStatus(frakConfig, (status: WalletStatusReturnType) => { if (status.key === "connected") { console.log("Wallet connected:", status.wallet); } else { console.log("Wallet not connected"); } }); ``` # ModalBuilder > **ModalBuilder** = [`ModalStepBuilder`](/developers/references/core-sdk/actions/type-aliases/modalstepbuilder/)\<\[[`LoginModalStepType`](/developers/references/core-sdk/index/type-aliases/loginmodalsteptype/)\]\> Defined in: actions/wrapper/modalBuilder.ts:51 Represent the output type of the modal builder # ModalStepBuilder > **ModalStepBuilder**\<`Steps`\> = \{ `display`: (`metadataOverride?`, `placement?`) => `Promise`\<[`ModalRpcStepsResultType`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsresulttype/)\<`Steps`\>\>; `params`: [`DisplayModalParamsType`](/developers/references/core-sdk/index/type-aliases/displaymodalparamstype/)\<`Steps`\>; `reward`: (`options?`) => `ModalStepBuilder`\<\[`...Steps`, [`FinalModalStepType`](/developers/references/core-sdk/index/type-aliases/finalmodalsteptype/)\]\>; `sendTx`: (`options`) => `ModalStepBuilder`\<\[`...Steps`, [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/)\]\>; \} Defined in: actions/wrapper/modalBuilder.ts:16 Represent the type of the modal step builder ## Type Parameters ### Steps `Steps` *extends* [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] = [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] ## Properties ### display > **display**: (`metadataOverride?`, `placement?`) => `Promise`\<[`ModalRpcStepsResultType`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsresulttype/)\<`Steps`\>\> Defined in: actions/wrapper/modalBuilder.ts:40 Display the modal #### Parameters ##### metadataOverride? (`current?`) => [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) \| `undefined` Function returning optional metadata to override the current modal metadata ##### placement? `string` Optional placement ID to associate with this modal display #### Returns `Promise`\<[`ModalRpcStepsResultType`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsresulttype/)\<`Steps`\>\> *** ### params > **params**: [`DisplayModalParamsType`](/developers/references/core-sdk/index/type-aliases/displaymodalparamstype/)\<`Steps`\> Defined in: actions/wrapper/modalBuilder.ts:22 The current modal params *** ### reward > **reward**: (`options?`) => `ModalStepBuilder`\<\[`...Steps`, [`FinalModalStepType`](/developers/references/core-sdk/index/type-aliases/finalmodalsteptype/)\]\> Defined in: actions/wrapper/modalBuilder.ts:32 Add a final step of type reward to the modal #### Parameters ##### options? `Omit`\<[`FinalModalStepType`](/developers/references/core-sdk/index/type-aliases/finalmodalsteptype/)\[`"params"`\], `"action"`\> #### Returns `ModalStepBuilder`\<\[`...Steps`, [`FinalModalStepType`](/developers/references/core-sdk/index/type-aliases/finalmodalsteptype/)\]\> *** ### sendTx > **sendTx**: (`options`) => `ModalStepBuilder`\<\[`...Steps`, [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/)\]\> Defined in: actions/wrapper/modalBuilder.ts:26 Add a send transaction step to the modal #### Parameters ##### options [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/)\[`"params"`\] #### Returns `ModalStepBuilder`\<\[`...Steps`, [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/)\]\> # ProcessReferralOptions > **ProcessReferralOptions** = \{ `alwaysAppendUrl?`: `boolean`; `merchantId?`: `string`; \} Defined in: actions/referral/processReferral.ts:17 Options for the referral auto-interaction process. ## Properties ### alwaysAppendUrl? > `optional` **alwaysAppendUrl?**: `boolean` Defined in: actions/referral/processReferral.ts:23 If true, always replace the URL with the current user's referral context so the next visitor gets referred by this user. #### Default Value ```ts false ``` *** ### merchantId? > `optional` **merchantId?**: `string` Defined in: actions/referral/processReferral.ts:29 Merchant ID for building the current user's referral context. Required when `alwaysAppendUrl` is true and the incoming context is V1. For V2 contexts, the merchantId is already embedded in the context. # SendTransactionParams > **SendTransactionParams** = \{ `metadata?`: [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/); `tx`: [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/)\[`"params"`\]\[`"tx"`\]; \} Defined in: actions/wrapper/sendTransaction.ts:13 Parameters to directly show a modal used to send a transaction ## Properties ### metadata? > `optional` **metadata?**: [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) Defined in: actions/wrapper/sendTransaction.ts:21 Custom metadata to be passed to the modal *** ### tx > **tx**: [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/)\[`"params"`\]\[`"tx"`\] Defined in: actions/wrapper/sendTransaction.ts:17 The transaction to be sent (either a single tx or multiple ones) # SiweAuthenticateModalParams > **SiweAuthenticateModalParams** = \{ `metadata?`: [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/); `siwe?`: `Partial`\<[`SiweAuthenticationParams`](/developers/references/core-sdk/index/type-aliases/siweauthenticationparams/)\>; \} Defined in: actions/wrapper/siweAuthenticate.ts:38 Parameter used to directly show a modal used to authenticate with SIWE ## Properties ### metadata? > `optional` **metadata?**: [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) Defined in: actions/wrapper/siweAuthenticate.ts:55 Custom metadata to be passed to the modal *** ### siwe? > `optional` **siwe?**: `Partial`\<[`SiweAuthenticationParams`](/developers/references/core-sdk/index/type-aliases/siweauthenticationparams/)\> Defined in: actions/wrapper/siweAuthenticate.ts:51 Partial SIWE params, since we can rebuild them from the SDK if they are empty If no parameters provider, some fields will be recomputed from the current configuration and environment. - `statement` will be set to a default value - `nonce` will be generated - `uri` will be set to the current domain - `version` will be set to "1" - `domain` will be set to the current window domain #### Default ```ts {} ``` # REFERRAL_SUCCESS_EVENT > `const` **REFERRAL\_SUCCESS\_EVENT**: `"frak:referral-success"` = `"frak:referral-success"` Defined in: actions/referral/setupReferral.ts:11 Custom event name dispatched on successful referral processing. Fired once per page load when a valid referral context is found in the URL and successfully tracked. Consumers (e.g. ``) listen for this to display a referral success message. # areAddressesEqual > **areAddressesEqual**(`a`, `b`): `boolean` Defined in: context/address.ts:35 Case-insensitive equality check for two Ethereum addresses. Both inputs are assumed to be syntactically valid addresses; callers that receive untrusted input should validate via isAddress first. ## Parameters ### a `` `0x${string}` `` ### b `` `0x${string}` `` ## Returns `boolean` # base64urlDecode > **base64urlDecode**(`value`): `Uint8Array` Defined in: utils/compression/b64.ts:18 Decode a base64url encoded string ## Parameters ### value `string` The value to decode ## Returns `Uint8Array` The decoded value # base64urlEncode > **base64urlEncode**(`buffer`): `string` Defined in: utils/compression/b64.ts:6 Encode a buffer to a base64url encoded string ## Parameters ### buffer `Uint8Array` The buffer to encode ## Returns `string` The encoded string # buildListenerUrl > **buildListenerUrl**(`__namedParameters`): `string` Defined in: utils/iframe/iframeHelper.ts:109 Build the listener iframe URL. Exported so every iframe creator (here and `@frak-labs/react-sdk`'s provider) builds the same URL — they drifted before, and a missing `clientId` param silently costs the listener its SDK-seeded identity. Query params: - `clientId` — anonymous SDK client identifier used for funnel joining. Omitted entirely when derivation failed; never serialised as `"undefined"`. The listener then falls back to its persisted store. Hash params (consumed by `apps/listener/app/bootstrap.ts#setupPreloadHints`): - `preload=modal,sharing` — idle-warms the matching Ring 1 + Ring 2 chunks. Skipped entirely when no preload hints are provided so the listener doesn't pay for warm-ups that nobody asked for. ## Parameters ### \_\_namedParameters #### clientId? `string` #### preload? [`ListenerPreloadOption`](/developers/references/core-sdk/index/type-aliases/listenerpreloadoption/)[] #### walletUrl? `string` = `...` ## Returns `string` # clearAllCache > **clearAllCache**(): `void` Defined in: utils/cache/withCache.ts:111 Clear all cached data (both pending promises and resolved responses). Called automatically when the client is destroyed. ## Returns `void` # coerceProductCandidates > **coerceProductCandidates**(`products`): `unknown`[] \| `null` Defined in: utils/product/sanitizeProducts.ts:23 Coerce a raw `products` value into a candidate array, or null. Accepts real arrays (JS property surface) and JSON-stringified arrays (HTML attribute surface — server-rendered plugins deliver attributes as strings). ## Parameters ### products `unknown` ## Returns `unknown`[] \| `null` # createIFrameFrakClient > **createIFrameFrakClient**(`args`): `Promise`\<[`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/)\> Defined in: clients/createIFrameFrakClient.ts:48 Create a new iframe Frak client ## Parameters ### args #### config [`FrakWalletSdkConfig`](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/) The configuration to use for the Frak Wallet SDK. 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). #### iframe `HTMLIFrameElement` The iframe to use for the communication ## Returns `Promise`\<[`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/)\> The created Frak Client ## Example ```ts const frakConfig: FrakWalletSdkConfig = { metadata: { name: "My app title", }, } const iframe = await createIframe({ config: frakConfig }); const client = createIFrameFrakClient({ config: frakConfig, iframe }); ``` # decodeProductsParam > **decodeProductsParam**(`value`): [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/)[] \| `undefined` Defined in: utils/product/sanitizeProducts.ts:149 Decode a `products` URL query param produced by `compressJsonToB64` — the encoding email tools use when embedding an order's products into a share CTA. Malformed / tampered payloads degrade to `undefined`. ## Parameters ### value `string` \| `null` \| `undefined` ## Returns [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/)[] \| `undefined` # deleteQueryParamCaseInsensitive > **deleteQueryParamCaseInsensitive**(`searchParams`, `key`): `void` Defined in: utils/url/queryParams.ts:46 Delete every query parameter whose key matches `key` case-insensitively. Keys are collected before deletion because mutating a `URLSearchParams` while iterating it skips entries. ## Parameters ### searchParams `URLSearchParams` ### key `string` ## Returns `void` # detectPageLanguage > **detectPageLanguage**(): [`Language`](/developers/references/core-sdk/index/type-aliases/language/) \| `undefined` Defined in: utils/i18n/detectPageLanguage.ts:20 Best-effort detection of the page's intended content language for SDK copy. Precedence: the document's declared `` (the page author's explicit content language) → the browser UI language (`navigator.language`). Returns `undefined` when neither resolves to a supported language, letting callers apply their own fallback (e.g. `"en"`). The `` check comes first so a page authored in French renders French SDK copy even when the visitor's browser is set to another language. ## Returns [`Language`](/developers/references/core-sdk/index/type-aliases/language/) \| `undefined` # findIframeInOpener > **findIframeInOpener**(`pathname?`): `Window` \| `null` Defined in: utils/iframe/iframeHelper.ts:173 Find an iframe within window.opener by pathname When a popup is opened via window.open from an iframe, window.opener points to the parent window, not the iframe itself. This utility searches through all frames in window.opener to find an iframe matching the specified pathname. ## Parameters ### pathname? `string` = `"/listener"` The pathname to search for (default: "/listener") ## Returns `Window` \| `null` The matching iframe window, or null if not found ## Example ```typescript // Find the default /listener iframe const listenerIframe = findIframeInOpener(); // Find a custom iframe const customIframe = findIframeInOpener("/my-custom-iframe"); ``` # formatAmount > **formatAmount**(`amount`, `currency?`): `string` Defined in: utils/format/formatAmount.ts:11 Format a numeric amount as a localized currency string ## Parameters ### amount `number` The raw numeric amount to format ### currency? [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) Optional currency config; defaults to EUR/fr-FR when omitted ## Returns `string` Localized currency string (e.g. "1 500 €", "$1,500") # formatAmountParts > **formatAmountParts**(`amount`, `currency?`): `RewardAmountParts` Defined in: utils/format/formatAmountParts.ts:34 Split a money amount into display parts, using the same options as [formatAmount](/developers/references/core-sdk/index/functions/formatamount/) so the two can never disagree about the number. ## Parameters ### amount `number` ### currency? [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) ## Returns `RewardAmountParts` # generateSsoUrl > **generateSsoUrl**(`walletUrl`, `params`, `merchantId`, `name`, `clientId`, `css?`, `proof?`): `string` Defined in: utils/sso/sso.ts:47 Generate SSO URL with compressed parameters This mirrors the wallet's getOpenSsoLink() function ## Parameters ### walletUrl `string` Base wallet URL (e.g., "https://wallet.frak.id") ### params [`PrepareSsoParamsType`](/developers/references/core-sdk/index/type-aliases/preparessoparamstype/) SSO parameters ### merchantId `string` Merchant identifier ### name `string` \| `undefined` Application name ### clientId `string` \| `undefined` Client identifier for identity tracking, omitted when the client could not derive one ### css? `string` Optional custom CSS ### proof? `string` Optional proof-of-possession for `clientId` (see `signProof`) ## Returns `string` Complete SSO URL ready to open in popup or redirect ## Example ```ts const ssoUrl = generateSsoUrl( "https://wallet.frak.id", { metadata: { logoUrl: "..." }, directExit: true }, "0x123...", "My App" ); // Returns: https://wallet.frak.id/sso?p= ``` # getBackendUrl > **getBackendUrl**(): `string` Defined in: config/environment.ts:160 The backend origin for the active environment. ## Returns `string` # getClientId > **getClientId**(): `string` \| `undefined` Defined in: config/clientId.ts:71 The derived anonymous id, or `undefined` when derivation has not completed yet (or failed). Synchronous, and never mints anything — any value it returns is P-256-derived. On a cold cache it schedules derivation in the background so a later call succeeds, without blocking or throwing. Prefer [getClientIdAsync](/developers/references/core-sdk/index/functions/getclientidasync/) anywhere an `await` is possible. ## Returns `string` \| `undefined` The derived client ID (UUID format), or `undefined` # getClientIdAsync > **getClientIdAsync**(): `Promise`\<`string`\> Defined in: config/clientId.ts:90 The derived anonymous id, awaiting derivation when it has not run yet. First caller triggers key generation; concurrent callers join the same in-flight derivation, so this is safe to call from anywhere without coordinating on `setupClient`. Rejects when no provable id can be produced, so callers that genuinely require one get a diagnosable failure rather than a silently unprovable id. ## Returns `Promise`\<`string`\> # getCurrencyAmountKey > **getCurrencyAmountKey**(`currency?`): keyof [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/) Defined in: utils/format/getCurrencyAmountKey.ts:8 Get the currency amount key for a given currency ## Parameters ### currency? [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) The currency to use ## Returns keyof [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/) The currency amount key # getEnvironment > **getEnvironment**(): [`ResolvedEnvironment`](/developers/references/core-sdk/index/type-aliases/resolvedenvironment/) Defined in: config/environment.ts:145 The active environment. Defaults to production when nothing was set, so standalone actions (`trackPurchaseStatus`, an early `ensureIdentity`) work without a client. ## Returns [`ResolvedEnvironment`](/developers/references/core-sdk/index/type-aliases/resolvedenvironment/) # getQueryParamCaseInsensitive > **getQueryParamCaseInsensitive**(`searchParams`, `key`): `string` \| `null` Defined in: utils/url/queryParams.ts:24 Read a query parameter, matching its key case-insensitively. An exact-case match wins when present, so a canonical link is never shadowed by a mangled duplicate (`?fctx=stale&fCtx=real` resolves to `real`). Only when the exact key is absent do we scan for a case-folded variant. ## Parameters ### searchParams `URLSearchParams` ### key `string` ## Returns `string` \| `null` the param value, or `null` when no key matches. # getSupportedCurrency > **getSupportedCurrency**(`currency?`): [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) Defined in: utils/format/getSupportedCurrency.ts:9 Get the supported currency for a given currency ## Parameters ### currency? [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) The currency to use ## Returns [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) The supported currency # isMobile > **isMobile**(): `boolean` Defined in: utils/browser/inAppBrowser.ts:26 Check if the current device is a mobile device (iOS, iPadOS, Android, webOS, BlackBerry, IEMobile, Opera Mini). Reuses [isIOS](/developers/references/core-sdk/index/variables/isios/) so the iPadOS-13+ Macintosh heuristic stays in one place. ## Returns `boolean` # mergeAttribution > **mergeAttribution**(`__namedParameters`): [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) \| `undefined` Defined in: context/mergeAttribution.ts:44 Merge the three attribution layers into a single [AttributionParams](/developers/references/core-sdk/index/type-aliases/attributionparams/) value suitable for `FrakContextManager.update`. Priority per field: 1. `perCall` (wins) 2. `defaults` (merchant-level, backend > SDK static, already pre-merged) 3. Hardcoded fallbacks resolved later by `FrakContextManager` Special rules: - `perCall === null` returns `undefined` (explicit disable: no UTM/ref/via). - `perCall === undefined` (no opinion) yields at least `{}` so `FrakContextManager` applies its one hardcoded default, `utm_source=frak`. There are no others: `resolveAttributionValues` leaves every other key undefined unless supplied. - `utm_content` never comes from `defaults`; only `productUtmContent` or `perCall.utmContent` can populate it. ## Parameters ### \_\_namedParameters [`MergeAttributionInput`](/developers/references/core-sdk/index/type-aliases/mergeattributioninput/) ## Returns [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) \| `undefined` # normalizeProductDetails > **normalizeProductDetails**(`candidate`): [`ProductDetails`](/developers/references/core-sdk/index/type-aliases/productdetails/) \| `undefined` Defined in: utils/product/sanitizeProducts.ts:60 Normalise one untrusted candidate into its [ProductDetails](/developers/references/core-sdk/index/type-aliases/productdetails/) scope fields, or `undefined` when none survived. Unlike [normalizeSharingProduct](/developers/references/core-sdk/index/functions/normalizesharingproduct/), no `title` is required — callers that only need scope fields for reward selection never render a product card. ## Parameters ### candidate `unknown` ## Returns [`ProductDetails`](/developers/references/core-sdk/index/type-aliases/productdetails/) \| `undefined` # normalizeSharingProduct > **normalizeSharingProduct**(`candidate`): [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/) \| `null` Defined in: utils/product/sanitizeProducts.ts:104 Normalise one untrusted candidate into a [SharingPageProduct](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/), or null when nothing usable survived. `products` is a public API boundary, so every URL field is validated structurally before reaching `new URL(...)`. A title-less entry is kept when it carries scope fields: the title is a display concern, the scope fields are a reward-matching one. ## Parameters ### candidate `unknown` ## Returns [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/) \| `null` # redirectToExternalBrowser > **redirectToExternalBrowser**(`targetUrl`): `void` Defined in: utils/browser/inAppBrowser.ts:67 Redirect to external browser from in-app WebView. - **iOS**: Uses `x-safari-https://` scheme — server-side 302 redirects to custom URL schemes are silently swallowed by WKWebView. Direct `window.location.href` assignment works (confirmed iOS 17+). - **Android**: Uses backend `/common/social` endpoint which returns a PDF Content-Type response, forcing the WebView to hand off to the default browser. ## Parameters ### targetUrl `string` The URL to open in the external browser ## Returns `void` # sanitizeProductDetailsList > **sanitizeProductDetailsList**(`input`): [`ProductDetails`](/developers/references/core-sdk/index/type-aliases/productdetails/)[] \| `undefined` Defined in: utils/product/sanitizeProducts.ts:83 ## Parameters ### input `unknown` ## Returns [`ProductDetails`](/developers/references/core-sdk/index/type-aliases/productdetails/)[] \| `undefined` # sanitizeSharingProducts > **sanitizeSharingProducts**(`input`): [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/)[] \| `undefined` Defined in: utils/product/sanitizeProducts.ts:131 Returns `undefined` (not `[]`) when nothing usable came out — `openSharingPage` / `displaySharingPage` skip the product card section then. ## Parameters ### input `unknown` ## Returns [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/)[] \| `undefined` # setEnvironment > **setEnvironment**(`env?`): [`ResolvedEnvironment`](/developers/references/core-sdk/index/type-aliases/resolvedenvironment/) Defined in: config/environment.ts:116 Publish the environment for every later reader. Called by the client entrypoints (`createIframe` / `createIFrameFrakClient` / the React provider), so it runs more than once per page in normal use. An omitted `env` is a no-op rather than "reset to production": a second client built from a bare config would otherwise silently repoint the first one's in-flight calls. The production default lives in [getEnvironment](/developers/references/core-sdk/index/functions/getenvironment/) instead. ## Parameters ### env? [`FrakEnvironment`](/developers/references/core-sdk/index/type-aliases/frakenvironment/) ## Returns [`ResolvedEnvironment`](/developers/references/core-sdk/index/type-aliases/resolvedenvironment/) # setupClient > **setupClient**(`config`): `Promise`\<[`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) \| `undefined`\> Defined in: clients/setupClient.ts:20 Directly setup the Frak client with an iframe Return when the FrakClient is ready (setup and communication estbalished with the wallet) ## Parameters ### config The configuration to use for the Frak Wallet SDK #### config [`FrakWalletSdkConfig`](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/) ## Returns `Promise`\<[`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) \| `undefined`\> a Promise with the Frak Client ## Example ```ts const frakConfig: FrakWalletSdkConfig = { metadata: { name: "My app title", }, } const client = await setupClient({ config: frakConfig }); ``` # trackEvent > **trackEvent**\<`K`\>(`client`, `event`, `properties?`): `void` Defined in: utils/analytics/trackEvent.ts:16 Track an analytics event via the SDK's OpenPanel instance. Fire-and-forget — silently catches errors so analytics never break a partner integration. The client must be passed explicitly because the OpenPanel instance is scoped to each `FrakClient` (a partner site may hold multiple iframes). ## Type Parameters ### K `K` *extends* keyof SdkLifecycleEventMap \| keyof SdkComponentEventMap \| keyof SdkReferralEventMap ## Parameters ### client [`FrakClient`](/developers/references/core-sdk/index/type-aliases/frakclient/) \| `undefined` The Frak client instance (no-op if undefined) ### event `K` Typed event name from the SDK event map ### properties? [`SdkEventMap`](/developers/references/core-sdk/index/type-aliases/sdkeventmap/)\[`K`\] Typed properties for the given event ## Returns `void` # triggerDeepLinkWithFallback > **triggerDeepLinkWithFallback**(`deepLink`, `options?`): `void` Defined in: utils/browser/deepLinkWithFallback.ts:67 Trigger a deep link with visibility-based fallback detection. Uses the Page Visibility API to detect if the app opened (page goes hidden). If the page remains visible after the timeout, assumes app is not installed and invokes the onFallback callback. On Chromium Android, converts custom scheme to intent:// URL to avoid the "Continue to app?" confirmation bar. ## Parameters ### deepLink `string` The deep link URL to trigger (e.g., "frakwallet://wallet") ### options? [`DeepLinkFallbackOptions`](/developers/references/core-sdk/index/type-aliases/deeplinkfallbackoptions/) Optional configuration (timeout, onFallback callback) ## Returns `void` # withCache > **withCache**\<`TData`\>(`fn`, `__namedParameters`): `Promise`\<`TData`\> Defined in: utils/cache/withCache.ts:61 Returns the result of a given promise, and caches the result for subsequent invocations against a provided cache key. Also deduplicates concurrent calls — if multiple callers request the same cache key while the promise is pending, they share the same promise. ## Type Parameters ### TData `TData` ## Parameters ### fn () => `Promise`\<`TData`\> ### \_\_namedParameters `WithCacheOptions` ## Returns `Promise`\<`TData`\> ## Example ```ts // First call fetches, subsequent calls return cached data for 30s const data = await withCache( () => client.request({ method: "frak_getMerchantInformation" }), { cacheKey: "merchantInfo", cacheTime: 30_000 } ); ``` # AppSpecificSsoMetadata > **AppSpecificSsoMetadata** = [`SsoMetadata`](/developers/references/core-sdk/index/type-aliases/ssometadata/) & \{ `css?`: `string`; `name?`: `string`; \} Defined in: utils/sso/sso.ts:5 ## Type Declaration ### css? > `optional` **css?**: `string` ### name? > `optional` **name?**: `string` # AttributionDefaults > **AttributionDefaults** = `Omit`\<[`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/), `"utmContent"`\> Defined in: types/tracking.ts:45 Merchant-level attribution defaults. Same shape as [AttributionParams](/developers/references/core-sdk/index/type-aliases/attributionparams/) minus `utmContent`, because `utm_content` describes the specific content/creative being shared and is inherently per-call or per-product (never a merchant-wide default). Used as the shape for both: - `FrakWalletSdkConfig.attribution` (SDK-side compile-time defaults) - Backend merchant-config attribution (dashboard-driven defaults) # AttributionParams > **AttributionParams** = \{ `ref?`: `string`; `utmCampaign?`: `string`; `utmContent?`: `string`; `utmMedium?`: `string`; `utmSource?`: `string`; `utmTerm?`: `string`; `via?`: `string`; \} Defined in: types/tracking.ts:24 Attribution parameters appended to outbound sharing URLs. Defaults are derived from the V2 Frak context when available: - `utmSource`: `"frak"` - `utmMedium`: `"referral"` - `utmCampaign`: merchantId (`context.m`) - `via`: `"frak"` - `ref`: clientId (`context.c`) Fields explicitly set here override the defaults. Existing params on the base URL are preserved (gap-fill policy) to respect merchant-provided UTMs. ## Properties ### ref? > `optional` **ref?**: `string` Defined in: types/tracking.ts:31 *** ### utmCampaign? > `optional` **utmCampaign?**: `string` Defined in: types/tracking.ts:27 *** ### utmContent? > `optional` **utmContent?**: `string` Defined in: types/tracking.ts:28 *** ### utmMedium? > `optional` **utmMedium?**: `string` Defined in: types/tracking.ts:26 *** ### utmSource? > `optional` **utmSource?**: `string` Defined in: types/tracking.ts:25 *** ### utmTerm? > `optional` **utmTerm?**: `string` Defined in: types/tracking.ts:29 *** ### via? > `optional` **via?**: `string` Defined in: types/tracking.ts:30 # CompressedSsoData > **CompressedSsoData** = \{ `cId?`: `string`; `d?`: `boolean`; `id?`: `Hex`; `l?`: `"en"` \| `"fr"`; `m`: `string`; `md`: \{ `css?`: `string`; `h?`: `string`; `l?`: `string`; `n?`: `string`; \}; `pf?`: `string`; `r?`: `string`; \} Defined in: utils/sso/sso.ts:110 Type of compressed the sso data ## Properties ### cId? > `optional` **cId?**: `string` Defined in: utils/sso/sso.ts:114 *** ### d? > `optional` **d?**: `boolean` Defined in: utils/sso/sso.ts:118 *** ### id? > `optional` **id?**: `Hex` Defined in: utils/sso/sso.ts:112 *** ### l? > `optional` **l?**: `"en"` \| `"fr"` Defined in: utils/sso/sso.ts:120 *** ### m > **m**: `string` Defined in: utils/sso/sso.ts:122 *** ### md > **md**: \{ `css?`: `string`; `h?`: `string`; `l?`: `string`; `n?`: `string`; \} Defined in: utils/sso/sso.ts:124 #### css? > `optional` **css?**: `string` #### h? > `optional` **h?**: `string` #### l? > `optional` **l?**: `string` #### n? > `optional` **n?**: `string` *** ### pf? > `optional` **pf?**: `string` Defined in: utils/sso/sso.ts:131 *** ### r? > `optional` **r?**: `string` Defined in: utils/sso/sso.ts:116 # ConditionGroup > **ConditionGroup** = \{ `conditions`: ([`RuleCondition`](/developers/references/core-sdk/index/type-aliases/rulecondition/) \| `ConditionGroup`)[]; `logic`: `"all"` \| `"any"` \| `"none"`; \} Defined in: types/rpc/merchantInformation.ts:123 A recursive group of conditions combined through a boolean `logic`. ## Properties ### conditions > **conditions**: ([`RuleCondition`](/developers/references/core-sdk/index/type-aliases/rulecondition/) \| `ConditionGroup`)[] Defined in: types/rpc/merchantInformation.ts:125 *** ### logic > **logic**: `"all"` \| `"any"` \| `"none"` Defined in: types/rpc/merchantInformation.ts:124 # ConditionOperator > **ConditionOperator** = `"eq"` \| `"neq"` \| `"gt"` \| `"gte"` \| `"lt"` \| `"lte"` \| `"in"` \| `"not_in"` \| `"contains"` \| `"starts_with"` \| `"ends_with"` \| `"exists"` \| `"not_exists"` \| `"between"` Defined in: types/rpc/merchantInformation.ts:67 Comparison operators usable in a [RuleCondition](/developers/references/core-sdk/index/type-aliases/rulecondition/). # Currency > **Currency** = `"eur"` \| `"usd"` \| `"gbp"` Defined in: types/config.ts:7 All the currencies available # DeepLinkFallbackOptions > **DeepLinkFallbackOptions** = \{ `onFallback?`: () => `void`; `timeout?`: `number`; \} Defined in: utils/browser/deepLinkWithFallback.ts:6 Options for deep link with fallback ## Properties ### onFallback? > `optional` **onFallback?**: () => `void` Defined in: utils/browser/deepLinkWithFallback.ts:10 Callback invoked when fallback is triggered (app not installed) #### Returns `void` *** ### timeout? > `optional` **timeout?**: `number` Defined in: utils/browser/deepLinkWithFallback.ts:8 Timeout in ms before triggering fallback (default: 2500ms) # DisplayModalParamsType > **DisplayModalParamsType**\<`T`\> = \{ `metadata?`: [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/); `steps`: [`ModalRpcStepsInput`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsinput/)\<`T`\>; \} Defined in: types/rpc/displayModal.ts:79 Params used to display a modal ## Type Parameters ### T `T` *extends* [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] The list of modal steps we expect to have in the modal ## Properties ### metadata? > `optional` **metadata?**: [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) Defined in: types/rpc/displayModal.ts:81 *** ### steps > **steps**: [`ModalRpcStepsInput`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsinput/)\<`T`\> Defined in: types/rpc/displayModal.ts:80 # DisplaySharingPageParamsType > **DisplaySharingPageParamsType** = \{ `attribution?`: [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) \| `null`; `checkoutToken?`: `string`; `link?`: `string`; `metadata?`: \{ `homepageLink?`: `string`; `i18n?`: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/); `logo?`: `string`; `targetInteraction?`: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/); \}; `products?`: [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/)[]; \} Defined in: types/rpc/displaySharingPage.ts:42 Parameters to display the sharing page ## Properties ### attribution? > `optional` **attribution?**: [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) \| `null` Defined in: types/rpc/displaySharingPage.ts:70 Optional attribution overrides for the outbound sharing URL. When provided (even as an empty object), Frak adds `utm_source=frak` alongside `fCtx`; every other param (`utm_medium`, `utm_campaign`, `utm_content`, `utm_term`, `via`, `ref`) is added only when you or the merchant's resolved config supplies it. Existing UTMs on the base URL are preserved (gap-fill). Set this to `null` to disable attribution params entirely (only `fCtx` is added). #### Default ```ts {} — defaults applied ``` *** ### checkoutToken? > `optional` **checkoutToken?**: `string` Defined in: types/rpc/displaySharingPage.ts:58 Opaque per-order token (Shopify's checkout token, or a plugin equivalent). Lets the sharing page derive an identity from the order when the caller's own `clientId` is missing, so the install CTA still carries a credential. *** ### link? > `optional` **link?**: `string` Defined in: types/rpc/displaySharingPage.ts:52 Optional link override for sharing If not provided, the sharing link will be generated from the current page URL + merchant context *** ### metadata? > `optional` **metadata?**: \{ `homepageLink?`: `string`; `i18n?`: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/); `logo?`: `string`; `targetInteraction?`: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/); \} Defined in: types/rpc/displaySharingPage.ts:74 Optional metadata overrides for the sharing page #### homepageLink? > `optional` **homepageLink?**: `string` Link to the homepage of the calling website #### i18n? > `optional` **i18n?**: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/) i18n overrides for the sharing page #### logo? > `optional` **logo?**: `string` Logo override for the sharing page header #### targetInteraction? > `optional` **targetInteraction?**: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/) The target interaction behind this sharing page *** ### products? > `optional` **products?**: [`SharingPageProduct`](/developers/references/core-sdk/index/type-aliases/sharingpageproduct/)[] Defined in: types/rpc/displaySharingPage.ts:47 Products to showcase on the sharing page If provided, they will be displayed in a product card section # DisplaySharingPageResultType > **DisplaySharingPageResultType** = \{ `action`: `"shared"` \| `"copied"` \| `"dismissed"`; `installUrl?`: `string`; \} Defined in: types/rpc/displaySharingPage.ts:99 Result of the sharing page display ## Properties ### action > **action**: `"shared"` \| `"copied"` \| `"dismissed"` Defined in: types/rpc/displaySharingPage.ts:106 The action the user took - "shared": User used the native share dialog - "copied": User copied the link to clipboard - "dismissed": User dismissed the sharing page without acting *** ### installUrl? > `optional` **installUrl?**: `string` Defined in: types/rpc/displaySharingPage.ts:112 The install URL for the Frak app Can be used as a fallback to redirect the user to the install page from the merchant's top-level page (e.g. via `window.location.href`) # EstimatedReward > **EstimatedReward** = \{ `amount`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `payoutType`: `"fixed"`; \} \| \{ `maxAmount?`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `minAmount?`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `payoutType`: `"percentage"`; `percent`: `number`; `percentOf`: `"purchase_amount"` \| `"matched_items_amount"` \| `string` & `Record`\<`never`, `never`\>; \} \| \{ `payoutType`: `"tiered"`; `tierField`: `string`; `tiers`: [`RewardTier`](/developers/references/core-sdk/index/type-aliases/rewardtier/)[]; \} Defined in: types/rpc/merchantInformation.ts:37 Estimated reward amount — discriminated union by payout type - `fixed`: A known token amount (with fiat equivalents) - `percentage`: A percent of a purchase field (e.g. 5% of purchase_amount), with optional min/max caps - `tiered`: Amount depends on a field value matching tier brackets ## Union Members ### Type Literal \{ `amount`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `payoutType`: `"fixed"`; \} *** ### Type Literal \{ `maxAmount?`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `minAmount?`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `payoutType`: `"percentage"`; `percent`: `number`; `percentOf`: `"purchase_amount"` \| `"matched_items_amount"` \| `string` & `Record`\<`never`, `never`\>; \} #### maxAmount? > `optional` **maxAmount?**: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/) #### minAmount? > `optional` **minAmount?**: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/) #### payoutType > **payoutType**: `"percentage"` #### percent > **percent**: `number` #### percentOf > **percentOf**: `"purchase_amount"` \| `"matched_items_amount"` \| `string` & `Record`\<`never`, `never`\> Basis the percent is applied to: the whole order, or the sum of the line items matched by [MerchantReward.productScope](/developers/references/core-sdk/index/type-aliases/merchantreward/#productscope). Kept open so a future basis doesn't require an SDK release. *** ### Type Literal \{ `payoutType`: `"tiered"`; `tierField`: `string`; `tiers`: [`RewardTier`](/developers/references/core-sdk/index/type-aliases/rewardtier/)[]; \} # FinalActionType > **FinalActionType** = \{ `key`: `"reward"`; `options?`: `never`; \} Defined in: types/rpc/modal/final.ts:28 The different types of final actions we can display in the final step ## Properties ### key > **key**: `"reward"` Defined in: types/rpc/modal/final.ts:29 *** ### options? > `optional` **options?**: `never` Defined in: types/rpc/modal/final.ts:30 # FinalModalStepType > **FinalModalStepType** = `GenericModalStepType`\<`"final"`, \{ `action`: [`FinalActionType`](/developers/references/core-sdk/index/type-aliases/finalactiontype/); `autoSkip?`: `boolean`; `dismissedMetadata?`: [`ModalStepMetadata`](/developers/references/core-sdk/index/type-aliases/modalstepmetadata/)\[`"metadata"`\]; \}, `object`\> Defined in: types/rpc/modal/final.ts:11 The final modal step type, displaying a success reward screen. **Input**: What type final step to display? **Output**: None # FrakClient > **FrakClient** = \{ `config`: [`FrakWalletSdkConfig`](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/); `openPanel?`: `OpenPanel`; \} & [`IFrameTransport`](/developers/references/core-sdk/index/type-aliases/iframetransport/) Defined in: types/client.ts:8 Representing a Frak client, used to interact with the Frak Wallet ## Type Declaration ### config > **config**: [`FrakWalletSdkConfig`](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/) ### openPanel? > `optional` **openPanel?**: `OpenPanel` # FrakEnvironment > **FrakEnvironment** = `"prod"` \| `"dev"` \| \{ `backend`: `string`; `wallet`: `string`; \} Defined in: types/config.ts:33 The environment the SDK talks to. Either a named stage, or an explicit origin pair for local development and one-off setups. Both origins are always stated together — the backend is never guessed from the wallet url. ## Example ```ts const env: FrakEnvironment = "dev"; const local: FrakEnvironment = { wallet: "https://localhost:3000", backend: "https://localhost:3030", }; ``` # FrakLifecycleEvent > **FrakLifecycleEvent** = `IFrameLifecycleEvent` \| `ClientLifecycleEvent` Defined in: types/transport.ts:34 Represent an iframe event # FrakWalletSdkConfig > **FrakWalletSdkConfig** = \{ `attribution?`: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/); `customizations?`: \{ `css?`: `` `${string}.css` ``; `i18n?`: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/); \}; `domain?`: `string`; `env?`: [`FrakEnvironment`](/developers/references/core-sdk/index/type-aliases/frakenvironment/); `metadata`: \{ `currency?`: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/); `homepageLink?`: `string`; `lang?`: [`Language`](/developers/references/core-sdk/index/type-aliases/language/); `logoUrl?`: `string`; `merchantId?`: `string`; `name?`: `string`; \}; `preload?`: [`ListenerPreloadOption`](/developers/references/core-sdk/index/type-aliases/listenerpreloadoption/)[]; `waitForBackendConfig?`: `boolean`; \} Defined in: types/config.ts:42 Configuration for the Frak Wallet SDK ## Properties ### attribution? > `optional` **attribution?**: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/) Defined in: types/config.ts:112 Default attribution params (UTM / via / ref) appended to outbound sharing URLs. Per-call `displaySharingPage` overrides win, then backend config, then this SDK-level default. `utm_content` is intentionally excluded — it is per-content/per-product, never a merchant-wide default. *** ### customizations? > `optional` **customizations?**: \{ `css?`: `` `${string}.css` ``; `i18n?`: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/); \} Defined in: types/config.ts:84 Some customization for the modal #### css? > `optional` **css?**: `` `${string}.css` `` Custom CSS styles to apply to the modals and components #### i18n? > `optional` **i18n?**: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/) Custom i18n configuration for the modal *** ### domain? > `optional` **domain?**: `string` Defined in: types/config.ts:98 The domain name of your application #### Default Value ```ts window.location.host ``` *** ### env? > `optional` **env?**: [`FrakEnvironment`](/developers/references/core-sdk/index/type-aliases/frakenvironment/) Defined in: types/config.ts:47 The environment to run against. #### Default Value ```ts "prod" ``` *** ### metadata > **metadata**: \{ `currency?`: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/); `homepageLink?`: `string`; `lang?`: [`Language`](/developers/references/core-sdk/index/type-aliases/language/); `logoUrl?`: `string`; `merchantId?`: `string`; `name?`: `string`; \} Defined in: types/config.ts:51 Some metadata about your implementation of the Frak SDK #### currency? > `optional` **currency?**: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) The currency to display in the modal ##### Default Value `"eur"` #### homepageLink? > `optional` **homepageLink?**: `string` The homepage link that could be displayed in a few components #### lang? > `optional` **lang?**: [`Language`](/developers/references/core-sdk/index/type-aliases/language/) Language to display in the modal If undefined, will default to the browser language #### logoUrl? > `optional` **logoUrl?**: `string` The logo URL that will be displayed in a few components #### merchantId? > `optional` **merchantId?**: `string` Your merchant ID from the Frak dashboard (UUID format) Used for referral tracking and analytics If not provided, will be auto-fetched from the backend using your domain #### name? > `optional` **name?**: `string` Your application name (will be displayed in a few modals and in SSO) *** ### preload? > `optional` **preload?**: [`ListenerPreloadOption`](/developers/references/core-sdk/index/type-aliases/listenerpreloadoption/)[] Defined in: types/config.ts:117 Preload specific UI views inside the listener iframe for better UX. Default: ["sharing"] *** ### waitForBackendConfig? > `optional` **waitForBackendConfig?**: `boolean` Defined in: types/config.ts:105 Wait for backend config before rendering components. When true (default), components show a spinner until backend config is resolved. When false, components render immediately with SDK static config / HTML attributes. #### Default Value ```ts true ``` # FullSsoParams > **FullSsoParams** = `Omit`\<[`PrepareSsoParamsType`](/developers/references/core-sdk/index/type-aliases/preparessoparamstype/), `"metadata"`\> & \{ `clientId?`: `string`; `merchantId`: `string`; `metadata`: [`AppSpecificSsoMetadata`](/developers/references/core-sdk/index/type-aliases/appspecificssometadata/); `proof?`: `string`; \} Defined in: utils/sso/sso.ts:13 The full SSO params that will be used for compression ## Type Declaration ### clientId? > `optional` **clientId?**: `string` Absent when the client could not derive a provable id (see `getClientIdAsync`). ### merchantId > **merchantId**: `string` ### metadata > **metadata**: [`AppSpecificSsoMetadata`](/developers/references/core-sdk/index/type-aliases/appspecificssometadata/) ### proof? > `optional` **proof?**: `string` Proof-of-possession for `clientId`, see `signProof` (identity/sign.ts). # GetMerchantInformationReturnType > **GetMerchantInformationReturnType** = \{ `id`: `string`; `onChainMetadata`: \{ `domain`: `string`; `name`: `string`; \}; `rewards`: [`MerchantReward`](/developers/references/core-sdk/index/type-aliases/merchantreward/)[]; \} Defined in: types/rpc/merchantInformation.ts:181 Response of the `frak_getMerchantInformation` RPC method ## Properties ### id > **id**: `string` Defined in: types/rpc/merchantInformation.ts:185 Current merchant id *** ### onChainMetadata > **onChainMetadata**: \{ `domain`: `string`; `name`: `string`; \} Defined in: types/rpc/merchantInformation.ts:189 Some metadata #### domain > **domain**: `string` Domain of the merchant on-chain #### name > **name**: `string` Name of the merchant on-chain *** ### rewards > **rewards**: [`MerchantReward`](/developers/references/core-sdk/index/type-aliases/merchantreward/)[] Defined in: types/rpc/merchantInformation.ts:199 # I18nConfig > **I18nConfig** = `Record`\<[`Language`](/developers/references/core-sdk/index/type-aliases/language/), [`LocalizedI18nConfig`](/developers/references/core-sdk/index/type-aliases/localizedi18nconfig/)\> \| [`LocalizedI18nConfig`](/developers/references/core-sdk/index/type-aliases/localizedi18nconfig/) Defined in: types/config.ts:152 Custom i18n configuration for the modal See [i18next json format](https://www.i18next.com/misc/json-format#i18next-json-v4) Available variables - `{{ productName }}` : The name of your website (`metadata.name`) - `{{ productOrigin }}` : The origin url of your website - `{{ estimatedReward }}` : The estimated reward for the user (based on the specific `targetInteraction` you can specify, or the max referrer reward if no target interaction is specified) Context of the translation [see i18n context](https://www.i18next.com/translation-function/context) - For modal display, the key of the final action (`reward` or undefined) ## Example ```ts // Multi language config const multiI18n = { fr: { "sdk.modal.title": "Titre de modal", "sdk.modal.description": "Description de modal, avec {{ estimatedReward }} de gains possible", }, en: "https://example.com/en.json" } // Single language config const singleI18n = { "sdk.modal.title": "Modal title", "sdk.modal.description": "Modal description, with {{ estimatedReward }} of gains possible", } ``` # IFrameRpcSchema > **IFrameRpcSchema** = \[\{ `Method`: `"frak_listenToWalletStatus"`; `Parameters?`: `undefined`; `ReturnType`: [`WalletStatusReturnType`](/developers/references/core-sdk/index/type-aliases/walletstatusreturntype/); \}, \{ `Method`: `"frak_displayModal"`; `Parameters`: \[[`ModalRpcStepsInput`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsinput/), [`ModalRpcMetadata`](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/) \| `undefined`, [`FrakWalletSdkConfig`](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/)\[`"metadata"`\], `string`\]; `ReturnType`: [`ModalRpcStepsResultType`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsresulttype/); \}, \{ `Method`: `"frak_prepareSso"`; `Parameters`: \[[`PrepareSsoParamsType`](/developers/references/core-sdk/index/type-aliases/preparessoparamstype/), `string`, `string`\]; `ReturnType`: [`PrepareSsoReturnType`](/developers/references/core-sdk/index/type-aliases/preparessoreturntype/); \}, \{ `Method`: `"frak_openSso"`; `Parameters`: \[[`OpenSsoParamsType`](/developers/references/core-sdk/index/type-aliases/openssoparamstype/), `string`, `string`\]; `ReturnType`: [`OpenSsoReturnType`](/developers/references/core-sdk/index/type-aliases/openssoreturntype/); \}, \{ `Method`: `"frak_getMerchantInformation"`; `Parameters?`: `undefined`; `ReturnType`: [`GetMerchantInformationReturnType`](/developers/references/core-sdk/index/type-aliases/getmerchantinformationreturntype/); \}, \{ `Method`: `"frak_sendInteraction"`; `Parameters`: \[[`SendInteractionParamsType`](/developers/references/core-sdk/index/type-aliases/sendinteractionparamstype/), \{ `clientId?`: `string`; \}\]; `ReturnType`: `undefined`; \}, \{ `Method`: `"frak_getUserReferralStatus"`; `Parameters?`: `undefined`; `ReturnType`: [`UserReferralStatusType`](/developers/references/core-sdk/index/type-aliases/userreferralstatustype/) \| `null`; \}, \{ `Method`: `"frak_displaySharingPage"`; `Parameters`: \[[`DisplaySharingPageParamsType`](/developers/references/core-sdk/index/type-aliases/displaysharingpageparamstype/), [`FrakWalletSdkConfig`](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/)\[`"metadata"`\], `string`\]; `ReturnType`: [`DisplaySharingPageResultType`](/developers/references/core-sdk/index/type-aliases/displaysharingpageresulttype/); \}, \{ `Method`: `"frak_getMergeToken"`; `Parameters?`: \[`string`\]; `ReturnType`: `string` \| `null`; \}\] Defined in: types/rpc.ts:61 RPC interface that's used for the iframe communication Define all the methods available within the iFrame RPC client with response type annotations ## Remarks Each method in the schema now includes a ResponseType field that indicates: - "promise": One-shot request that resolves once - "stream": Streaming request that can emit multiple values ### Methods: #### frak_listenToWalletStatus - Params: None - Returns: [WalletStatusReturnType](/developers/references/core-sdk/index/type-aliases/walletstatusreturntype/) - Response Type: stream (emits updates when wallet status changes) #### frak_displayModal - Params: [requests: [ModalRpcStepsInput](/developers/references/core-sdk/index/type-aliases/modalrpcstepsinput/), metadata?: [ModalRpcMetadata](/developers/references/core-sdk/index/type-aliases/modalrpcmetadata/), configMetadata: [FrakWalletSdkConfig](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/)["metadata"], placement?: string] - Returns: [ModalRpcStepsResultType](/developers/references/core-sdk/index/type-aliases/modalrpcstepsresulttype/) - Response Type: promise (one-shot) #### frak_sso - Params: [params: [OpenSsoParamsType](/developers/references/core-sdk/index/type-aliases/openssoparamstype/), name: string, customCss?: string] - Returns: [OpenSsoReturnType](/developers/references/core-sdk/index/type-aliases/openssoreturntype/) - Response Type: promise (one-shot) #### frak_getMerchantInformation - Params: None - Returns: [GetMerchantInformationReturnType](/developers/references/core-sdk/index/type-aliases/getmerchantinformationreturntype/) - Response Type: promise (one-shot) #### frak_displaySharingPage - Params: [request: [DisplaySharingPageParamsType](/developers/references/core-sdk/index/type-aliases/displaysharingpageparamstype/), configMetadata: [FrakWalletSdkConfig](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/)["metadata"], placement?: string] - Returns: [DisplaySharingPageResultType](/developers/references/core-sdk/index/type-aliases/displaysharingpageresulttype/) - Response Type: promise (one-shot) # IFrameTransport > **IFrameTransport** = \{ `destroy`: () => `Promise`\<`void`\>; `listenerRequest`: `RpcClient`\<[`IFrameRpcSchema`](/developers/references/core-sdk/index/type-aliases/iframerpcschema/), `LifecycleMessage`\>\[`"listen"`\]; `request`: `RpcClient`\<[`IFrameRpcSchema`](/developers/references/core-sdk/index/type-aliases/iframerpcschema/), `LifecycleMessage`\>\[`"request"`\]; `waitForConnection`: `Promise`\<`boolean`\>; `waitForSetup`: `Promise`\<`void`\>; \} Defined in: types/transport.ts:8 IFrame transport interface ## Properties ### destroy > **destroy**: () => `Promise`\<`void`\> Defined in: types/transport.ts:28 Function used to destroy the iframe transport #### Returns `Promise`\<`void`\> *** ### listenerRequest > **listenerRequest**: `RpcClient`\<[`IFrameRpcSchema`](/developers/references/core-sdk/index/type-aliases/iframerpcschema/), `LifecycleMessage`\>\[`"listen"`\] Defined in: types/transport.ts:24 Function used to listen to a request response via the iframe transport *** ### request > **request**: `RpcClient`\<[`IFrameRpcSchema`](/developers/references/core-sdk/index/type-aliases/iframerpcschema/), `LifecycleMessage`\>\[`"request"`\] Defined in: types/transport.ts:20 Function used to perform a single request via the iframe transport *** ### waitForConnection > **waitForConnection**: `Promise`\<`boolean`\> Defined in: types/transport.ts:12 Wait for the connection to be established *** ### waitForSetup > **waitForSetup**: `Promise`\<`void`\> Defined in: types/transport.ts:16 Wait for the setup to be done # InteractionTypeKey > **InteractionTypeKey** = `"referral"` \| `"create_referral_link"` \| `"purchase"` \| `` `custom.${string}` `` Defined in: constants/interactionTypes.ts:11 The supported interaction type keys - `referral` - User arrived via a referral link - `create_referral_link` - User created/shared a referral link - `purchase` - User completed a purchase - `custom.${string}` - Custom interaction type defined per campaign # Language > **Language** = `"fr"` \| `"en"` Defined in: types/config.ts:13 All the languages available # ListenerPreloadOption > **ListenerPreloadOption** = `"modal"` \| `"sharing"` Defined in: types/config.ts:160 Options for preloading the listener UI # LocalizedI18nConfig > **LocalizedI18nConfig** = \{\[`key`: `string`\]: `string`; \} Defined in: types/config.ts:166 A localized i18n config (inline objects only — URL-based i18n removed) ## Index Signature \[`key`: `string`\]: `string` # LoginModalStepType > **LoginModalStepType** = `GenericModalStepType`\<`"login"`, \{ `allowSso`: `true`; `ssoMetadata?`: [`SsoMetadata`](/developers/references/core-sdk/index/type-aliases/ssometadata/); \} \| \{ `allowSso?`: `false`; `ssoMetadata?`: `undefined`; \}, \{ `wallet`: `Address`; `webauthnProof?`: \{ `authenticatorResponse`: `string`; `challenge`: `Hex`; \}; \}\> Defined in: types/rpc/modal/login.ts:26 The login step for a Modal **Input**: Do we allow SSO or not? Is yes then the SSO metadata **Output**: The logged in wallet address # MerchantConfigResponse > **MerchantConfigResponse** = \{ `allowedDomains`: `string`[]; `domain`: `string`; `merchantId`: `string`; `name`: `string`; `sdkConfig?`: [`ResolvedSdkConfig`](/developers/references/core-sdk/index/type-aliases/resolvedsdkconfig/); \} Defined in: types/resolvedConfig.ts:8 Response from the merchant resolve endpoint ## Properties ### allowedDomains > **allowedDomains**: `string`[] Defined in: types/resolvedConfig.ts:12 *** ### domain > **domain**: `string` Defined in: types/resolvedConfig.ts:11 *** ### merchantId > **merchantId**: `string` Defined in: types/resolvedConfig.ts:9 *** ### name > **name**: `string` Defined in: types/resolvedConfig.ts:10 *** ### sdkConfig? > `optional` **sdkConfig?**: [`ResolvedSdkConfig`](/developers/references/core-sdk/index/type-aliases/resolvedsdkconfig/) Defined in: types/resolvedConfig.ts:13 # MerchantReward > **MerchantReward** = \{ `campaignId`: `string`; `conditions`: [`RuleConditions`](/developers/references/core-sdk/index/type-aliases/ruleconditions/); `defaultLockupSeconds?`: `number`; `expiresAt?`: `string` \| `null`; `interactionTypeKey`: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/); `maxRewardsPerUser?`: `number`; `merchantMaxRewardsPerUser?`: `number`; `name`: `string`; `pendingRewardExpirationDays?`: `number`; `productScope?`: [`RuleConditions`](/developers/references/core-sdk/index/type-aliases/ruleconditions/); `referee?`: [`EstimatedReward`](/developers/references/core-sdk/index/type-aliases/estimatedreward/); `referrer?`: [`EstimatedReward`](/developers/references/core-sdk/index/type-aliases/estimatedreward/); `token?`: `Address`; \} Defined in: types/rpc/merchantInformation.ts:144 A reward offer exposed by a merchant campaign. Mirrors the backend `EstimatedRewardItem` one-to-one, enforced by `schemas/merchantRewardParity.ts`. ## Properties ### campaignId > **campaignId**: `string` Defined in: types/rpc/merchantInformation.ts:148 Identifier of the campaign rule this reward originates from. *** ### conditions > **conditions**: [`RuleConditions`](/developers/references/core-sdk/index/type-aliases/ruleconditions/) Defined in: types/rpc/merchantInformation.ts:158 Raw gating rules — inspect to derive start date, minimum purchase, … *** ### defaultLockupSeconds? > `optional` **defaultLockupSeconds?**: `number` Defined in: types/rpc/merchantInformation.ts:166 Seconds a reward stays locked before settlement. *** ### expiresAt? > `optional` **expiresAt?**: `string` \| `null` Defined in: types/rpc/merchantInformation.ts:174 ISO-8601 campaign end date, or `null` when open-ended. *** ### interactionTypeKey > **interactionTypeKey**: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/) Defined in: types/rpc/merchantInformation.ts:152 Interaction that triggers the reward. *** ### maxRewardsPerUser? > `optional` **maxRewardsPerUser?**: `number` Defined in: types/rpc/merchantInformation.ts:170 Per-user reward cap for this campaign. *** ### merchantMaxRewardsPerUser? > `optional` **merchantMaxRewardsPerUser?**: `number` Defined in: types/rpc/merchantInformation.ts:172 Merchant-wide per-user reward cap across every campaign. *** ### name > **name**: `string` Defined in: types/rpc/merchantInformation.ts:150 Campaign display name. *** ### pendingRewardExpirationDays? > `optional` **pendingRewardExpirationDays?**: `number` Defined in: types/rpc/merchantInformation.ts:168 Days before a pending reward expires. *** ### productScope? > `optional` **productScope?**: [`RuleConditions`](/developers/references/core-sdk/index/type-aliases/ruleconditions/) Defined in: types/rpc/merchantInformation.ts:164 Per-item scope: when set, this reward only applies to purchases with at least one line item matching these conditions. Absent means it applies to the whole basket. *** ### referee? > `optional` **referee?**: [`EstimatedReward`](/developers/references/core-sdk/index/type-aliases/estimatedreward/) Defined in: types/rpc/merchantInformation.ts:156 Reward paid to the referee, when the campaign defines one. *** ### referrer? > `optional` **referrer?**: [`EstimatedReward`](/developers/references/core-sdk/index/type-aliases/estimatedreward/) Defined in: types/rpc/merchantInformation.ts:154 Reward paid to the referrer, when the campaign defines one. *** ### token? > `optional` **token?**: `Address` Defined in: types/rpc/merchantInformation.ts:146 Reward token address; falls back to the merchant token when omitted. # MergeAttributionInput > **MergeAttributionInput** = \{ `defaults?`: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/); `perCall`: [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) \| `null` \| `undefined`; `productUtmContent?`: `string`; \} Defined in: context/mergeAttribution.ts:6 Inputs for [mergeAttribution](/developers/references/core-sdk/index/functions/mergeattribution/). ## Properties ### defaults? > `optional` **defaults?**: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/) Defined in: context/mergeAttribution.ts:19 Pre-merged merchant-level defaults (backend config > SDK static config). `utm_content` is intentionally absent from this shape. *** ### perCall > **perCall**: [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) \| `null` \| `undefined` Defined in: context/mergeAttribution.ts:14 Per-call attribution override passed to actions like `displaySharingPage`. - `null` explicitly disables attribution (no UTM/ref/via params are added). - `undefined` means "no per-call override" — defaults apply if present. - An object (including `{}`) merges field-by-field with defaults. *** ### productUtmContent? > `optional` **productUtmContent?**: `string` Defined in: context/mergeAttribution.ts:24 Per-product `utm_content` override (from the currently selected `SharingPageProduct`). Takes precedence over `perCall.utmContent`. # ModalRpcMetadata > **ModalRpcMetadata** = \{ `header?`: \{ `icon?`: `string`; `title?`: `string`; \}; `i18n?`: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/); `targetInteraction?`: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/); \} & \{ `dismissActionTxt?`: `string`; `isDismissible`: `true`; \} \| \{ `dismissActionTxt?`: `never`; `isDismissible?`: `false`; \} Defined in: types/rpc/displayModal.ts:50 RPC metadata for the modal, used on top level modal configuration ## Type Declaration ### header? > `optional` **header?**: \{ `icon?`: `string`; `title?`: `string`; \} #### header.icon? > `optional` **icon?**: `string` #### header.title? > `optional` **title?**: `string` ### i18n? > `optional` **i18n?**: [`I18nConfig`](/developers/references/core-sdk/index/type-aliases/i18nconfig/) Some i18n override for the displayed modal (i.e. update the displayed text only for this modal) ### targetInteraction? > `optional` **targetInteraction?**: [`InteractionTypeKey`](/developers/references/core-sdk/index/type-aliases/interactiontypekey/) # ModalRpcStepsInput > **ModalRpcStepsInput**\<`T`\> = `{ [K in T[number]["key"]]?: Extract["params"] }` Defined in: types/rpc/displayModal.ts:40 Type for the RPC input of a modal Just the `params` type of each `ModalStepTypes` ## Type Parameters ### T `T` *extends* [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] = [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] The list of modal steps we expect to have in the modal # ModalRpcStepsResultType > **ModalRpcStepsResultType**\<`T`\> = `{ [K in T[number]["key"]]: Extract["returns"] }` Defined in: types/rpc/displayModal.ts:27 Type for the result of a modal request Just the `returns` type of each `ModalStepTypes` ## Type Parameters ### T `T` *extends* [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] = [`ModalStepTypes`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/)[] The list of modal steps we expect to have in the modal # ModalStepMetadata > **ModalStepMetadata** = \{ `metadata?`: \{ `description?`: `string`; `primaryActionText?`: `string`; `secondaryActionText?`: `string`; `title?`: `string`; \}; \} Defined in: types/rpc/modal/generic.ts:19 Metadata that can be used to customize a modal step :::caution[Deprecated] Use the top level `config.customizations.i18n`, or `metadata.i18n` instead ::: ## Properties ### ~~metadata?~~ > `optional` **metadata?**: \{ `description?`: `string`; `primaryActionText?`: `string`; `secondaryActionText?`: `string`; `title?`: `string`; \} Defined in: types/rpc/modal/generic.ts:20 #### ~~description?~~ > `optional` **description?**: `string` Custom description for the step If none provided, it will use an internationalized text :::caution[Deprecated] Use the top level `config.customizations.i18n`, or `metadata.i18n` instead ::: #### ~~primaryActionText?~~ > `optional` **primaryActionText?**: `string` Custom text for the primary action of the step If none provided, it will use an internationalized text :::caution[Deprecated] Use the top level `config.customizations.i18n`, or `metadata.i18n` instead ::: #### ~~secondaryActionText?~~ > `optional` **secondaryActionText?**: `string` Custom text for the secondary action of the step If none provided, it will use an internationalized text :::caution[Deprecated] Use the top level `config.customizations.i18n`, or `metadata.i18n` instead ::: #### ~~title?~~ > `optional` **title?**: `string` Custom title for the step If none provided, it will use an internationalized text :::caution[Deprecated] Use the top level `config.customizations.i18n`, or `metadata.i18n` instead ::: # ModalStepTypes > **ModalStepTypes** = [`LoginModalStepType`](/developers/references/core-sdk/index/type-aliases/loginmodalsteptype/) \| [`SiweAuthenticateModalStepType`](/developers/references/core-sdk/index/type-aliases/siweauthenticatemodalsteptype/) \| [`SendTransactionModalStepType`](/developers/references/core-sdk/index/type-aliases/sendtransactionmodalsteptype/) \| [`FinalModalStepType`](/developers/references/core-sdk/index/type-aliases/finalmodalsteptype/) Defined in: types/rpc/displayModal.ts:14 Generic type of steps we will display in the modal to the end user # OpenSsoArgsType > **OpenSsoArgsType** = [`OpenSsoParamsType`](/developers/references/core-sdk/index/type-aliases/openssoparamstype/) \| [`OpenSsoUrlParamsType`](/developers/references/core-sdk/index/type-aliases/openssourlparamstype/) Defined in: types/rpc/sso.ts:109 Arguments accepted by [\`openSso()\`](/developers/references/core-sdk/actions/functions/opensso/): either the full parameters (built and opened in one call) or a URL already built by `prepareSsoUrl()`. # OpenSsoParamsType > **OpenSsoParamsType** = [`PrepareSsoParamsType`](/developers/references/core-sdk/index/type-aliases/preparessoparamstype/) & \{ `openInSameWindow?`: `boolean`; `ssoPopupUrl?`: `string`; \} Defined in: types/rpc/sso.ts:73 Params to start a SSO ## Type Declaration ### openInSameWindow? > `optional` **openInSameWindow?**: `boolean` Indicate whether we want todo the flow within the same window context, or if we want to do it with an external popup window openned Note: Default true if redirectUrl is present, otherwise, false ### ssoPopupUrl? > `optional` **ssoPopupUrl?**: `string` Custom SSO popup url if user want additionnal customisation # OpenSsoReturnType > **OpenSsoReturnType** = \{ `wallet?`: `Hex`; \} Defined in: types/rpc/sso.ts:61 Response after an SSO has been openned ## Properties ### wallet? > `optional` **wallet?**: `Hex` Defined in: types/rpc/sso.ts:66 Optional wallet address, returned when SSO completes via postMessage Note: Only present when SSO flow completes (not immediately on open) # OpenSsoUrlParamsType > **OpenSsoUrlParamsType** = \{ `ssoUrl`: `string`; \} Defined in: types/rpc/sso.ts:94 A pre-built SSO URL, as returned by [\`prepareSsoUrl()\`](/developers/references/core-sdk/actions/functions/preparessourl/). Passing this to `openSso()` skips every await before `window.open`, so the popup opens in the same tick as the user's click and survives popup blockers. ## Properties ### ssoUrl > **ssoUrl**: `string` Defined in: types/rpc/sso.ts:100 A URL from `prepareSsoUrl()`. Opened as-is: the ids and the proof-of-possession are already baked in, so none of the other parameters apply. # PrepareSsoParamsType > **PrepareSsoParamsType** = \{ `directExit?`: `boolean`; `lang?`: `"en"` \| `"fr"`; `metadata?`: [`SsoMetadata`](/developers/references/core-sdk/index/type-aliases/ssometadata/); `redirectUrl?`: `string`; \} Defined in: types/rpc/sso.ts:22 Params for preparing SSO (generating URL) Same as OpenSsoParamsType but without openInSameWindow (popup-only operation) ## Properties ### directExit? > `optional` **directExit?**: `boolean` Defined in: types/rpc/sso.ts:35 If the SSO should directly exit (close the popup) after completion. Defaults to `true` when `redirectUrl` is omitted, `false` otherwise. The default is applied by [\`openSso()\`](/developers/references/core-sdk/actions/functions/opensso/) before the SSO URL is generated and by the wallet SSO route as a fallback for older SDK callers. *** ### lang? > `optional` **lang?**: `"en"` \| `"fr"` Defined in: types/rpc/sso.ts:40 Language of the SSO page (optional) It will default to the current user language (or "en" if unsupported language) *** ### metadata? > `optional` **metadata?**: [`SsoMetadata`](/developers/references/core-sdk/index/type-aliases/ssometadata/) Defined in: types/rpc/sso.ts:44 Custom SSO metadata *** ### redirectUrl? > `optional` **redirectUrl?**: `string` Defined in: types/rpc/sso.ts:26 Redirect URL after the SSO (optional) # PrepareSsoReturnType > **PrepareSsoReturnType** = \{ `ssoUrl`: `string`; \} Defined in: types/rpc/sso.ts:51 Response after preparing SSO ## Properties ### ssoUrl > **ssoUrl**: `string` Defined in: types/rpc/sso.ts:55 The SSO URL that should be opened in a popup # ProductDetails > **ProductDetails** = \{ `name?`: `string`; `productId?`: `string`; `quantity?`: `number`; `sku?`: `string`; `totalPrice?`: `number`; `unitPrice?`: `number`; \} Defined in: types/product.ts:7 The purchase line item fields a campaign's `productScope` can target. Mirrors the backend's `PRODUCT_SCOPE_FIELDS` allowlist exactly — a campaign field outside this set cannot have been published. ## Properties ### name? > `optional` **name?**: `string` Defined in: types/product.ts:10 *** ### productId? > `optional` **productId?**: `string` Defined in: types/product.ts:8 *** ### quantity? > `optional` **quantity?**: `number` Defined in: types/product.ts:11 *** ### sku? > `optional` **sku?**: `string` Defined in: types/product.ts:9 *** ### totalPrice? > `optional` **totalPrice?**: `number` Defined in: types/product.ts:13 *** ### unitPrice? > `optional` **unitPrice?**: `number` Defined in: types/product.ts:12 # ResolvedEnvironment > **ResolvedEnvironment** = \{ `backend`: `string`; `wallet`: `string`; \} Defined in: config/environment.ts:25 A fully resolved environment: both origins known, no derivation left. ## Properties ### backend > **backend**: `string` Defined in: config/environment.ts:29 Backend origin — hosts the REST API. *** ### wallet > **wallet**: `string` Defined in: config/environment.ts:27 Wallet origin — hosts the listener iframe, SSO and sharing pages. # ResolvedPlacement > **ResolvedPlacement** = \{ `components?`: \{ `banner?`: \{ `css?`: `string`; `imageUrl?`: `string`; `inappCta?`: `string`; `inappDescription?`: `string`; `inappTitle?`: `string`; `referralCta?`: `string`; `referralDescription?`: `string`; `referralTitle?`: `string`; \}; `buttonShare?`: \{ `clickAction?`: `"embedded-wallet"` \| `"share-modal"` \| `"sharing-page"`; `css?`: `string`; `noRewardText?`: `string`; `text?`: `string`; \}; `buttonWallet?`: \{ `css?`: `string`; `position?`: `"right"` \| `"left"`; \}; `openInApp?`: \{ `css?`: `string`; `text?`: `string`; \}; `postPurchase?`: \{ `badgeText?`: `string`; `css?`: `string`; `ctaNoRewardText?`: `string`; `ctaText?`: `string`; `imageUrl?`: `string`; `refereeNoRewardText?`: `string`; `refereeText?`: `string`; `referrerNoRewardText?`: `string`; `referrerText?`: `string`; \}; \}; `css?`: `string`; `targetInteraction?`: `string`; `translations?`: `Record`\<`string`, `string`\>; \} Defined in: types/resolvedConfig.ts:21 Resolved placement config from backend Translations already flattened: default + lang-specific merged into one record ## Properties ### components? > `optional` **components?**: \{ `banner?`: \{ `css?`: `string`; `imageUrl?`: `string`; `inappCta?`: `string`; `inappDescription?`: `string`; `inappTitle?`: `string`; `referralCta?`: `string`; `referralDescription?`: `string`; `referralTitle?`: `string`; \}; `buttonShare?`: \{ `clickAction?`: `"embedded-wallet"` \| `"share-modal"` \| `"sharing-page"`; `css?`: `string`; `noRewardText?`: `string`; `text?`: `string`; \}; `buttonWallet?`: \{ `css?`: `string`; `position?`: `"right"` \| `"left"`; \}; `openInApp?`: \{ `css?`: `string`; `text?`: `string`; \}; `postPurchase?`: \{ `badgeText?`: `string`; `css?`: `string`; `ctaNoRewardText?`: `string`; `ctaText?`: `string`; `imageUrl?`: `string`; `refereeNoRewardText?`: `string`; `refereeText?`: `string`; `referrerNoRewardText?`: `string`; `referrerText?`: `string`; \}; \} Defined in: types/resolvedConfig.ts:23 Per-component configuration within this placement #### banner? > `optional` **banner?**: \{ `css?`: `string`; `imageUrl?`: `string`; `inappCta?`: `string`; `inappDescription?`: `string`; `inappTitle?`: `string`; `referralCta?`: `string`; `referralDescription?`: `string`; `referralTitle?`: `string`; \} ##### banner.css? > `optional` **css?**: `string` ##### banner.imageUrl? > `optional` **imageUrl?**: `string` Custom illustration URL replacing the built-in gift icon. ##### banner.inappCta? > `optional` **inappCta?**: `string` ##### banner.inappDescription? > `optional` **inappDescription?**: `string` ##### banner.inappTitle? > `optional` **inappTitle?**: `string` ##### banner.referralCta? > `optional` **referralCta?**: `string` ##### banner.referralDescription? > `optional` **referralDescription?**: `string` ##### banner.referralTitle? > `optional` **referralTitle?**: `string` #### buttonShare? > `optional` **buttonShare?**: \{ `clickAction?`: `"embedded-wallet"` \| `"share-modal"` \| `"sharing-page"`; `css?`: `string`; `noRewardText?`: `string`; `text?`: `string`; \} ##### buttonShare.clickAction? > `optional` **clickAction?**: `"embedded-wallet"` \| `"share-modal"` \| `"sharing-page"` Which UI the share button opens. `"embedded-wallet"` and `"share-modal"` are retired surfaces kept in the union because this is a wire type: the backend still stores and emits them for merchant configs created before the migration. The SDK routes both to the sharing page. ##### buttonShare.css? > `optional` **css?**: `string` ##### buttonShare.noRewardText? > `optional` **noRewardText?**: `string` ##### buttonShare.text? > `optional` **text?**: `string` #### buttonWallet? > `optional` **buttonWallet?**: \{ `css?`: `string`; `position?`: `"right"` \| `"left"`; \} Legacy embedded-wallet button config. The drawer it used to open is gone; `` now opens the sharing page and only still reads `position`. Kept because the backend emits it for pre-migration merchant configs. ##### buttonWallet.css? > `optional` **css?**: `string` ##### buttonWallet.position? > `optional` **position?**: `"right"` \| `"left"` #### openInApp? > `optional` **openInApp?**: \{ `css?`: `string`; `text?`: `string`; \} ##### openInApp.css? > `optional` **css?**: `string` ##### openInApp.text? > `optional` **text?**: `string` #### postPurchase? > `optional` **postPurchase?**: \{ `badgeText?`: `string`; `css?`: `string`; `ctaNoRewardText?`: `string`; `ctaText?`: `string`; `imageUrl?`: `string`; `refereeNoRewardText?`: `string`; `refereeText?`: `string`; `referrerNoRewardText?`: `string`; `referrerText?`: `string`; \} ##### postPurchase.badgeText? > `optional` **badgeText?**: `string` ##### postPurchase.css? > `optional` **css?**: `string` ##### postPurchase.ctaNoRewardText? > `optional` **ctaNoRewardText?**: `string` ##### postPurchase.ctaText? > `optional` **ctaText?**: `string` ##### postPurchase.imageUrl? > `optional` **imageUrl?**: `string` Custom illustration URL replacing the built-in gift icon. ##### postPurchase.refereeNoRewardText? > `optional` **refereeNoRewardText?**: `string` ##### postPurchase.refereeText? > `optional` **refereeText?**: `string` ##### postPurchase.referrerNoRewardText? > `optional` **referrerNoRewardText?**: `string` ##### postPurchase.referrerText? > `optional` **referrerText?**: `string` *** ### css? > `optional` **css?**: `string` Defined in: types/resolvedConfig.ts:80 Global placement CSS (applied to modals/listener) *** ### targetInteraction? > `optional` **targetInteraction?**: `string` Defined in: types/resolvedConfig.ts:76 *** ### translations? > `optional` **translations?**: `Record`\<`string`, `string`\> Defined in: types/resolvedConfig.ts:78 Already flattened: default + lang-specific merged into one record # ResolvedSdkConfig > **ResolvedSdkConfig** = \{ `attribution?`: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/); `components?`: [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\[`"components"`\]; `css?`: `string`; `currency?`: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/); `hidden?`: `boolean`; `homepageLink?`: `string`; `lang?`: [`Language`](/developers/references/core-sdk/index/type-aliases/language/); `logoUrl?`: `string`; `name?`: `string`; `placements?`: `Record`\<`string`, [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\>; `translations?`: `Record`\<`string`, `string`\>; \} Defined in: types/resolvedConfig.ts:88 Resolved SDK config from backend `/resolve` endpoint Language resolution and translation merging already applied ## Properties ### attribution? > `optional` **attribution?**: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/) Defined in: types/resolvedConfig.ts:106 Default attribution params applied when building outbound sharing URLs. Per-call overrides win over these backend defaults; `utm_content` is intentionally excluded (per-content/per-product, never a merchant default). *** ### components? > `optional` **components?**: [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\[`"components"`\] Defined in: types/resolvedConfig.ts:100 Global component defaults (used when no placement override exists) *** ### css? > `optional` **css?**: `string` Defined in: types/resolvedConfig.ts:96 *** ### currency? > `optional` **currency?**: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) Defined in: types/resolvedConfig.ts:92 *** ### hidden? > `optional` **hidden?**: `boolean` Defined in: types/resolvedConfig.ts:95 When true, all SDK components should be hidden *** ### homepageLink? > `optional` **homepageLink?**: `string` Defined in: types/resolvedConfig.ts:91 *** ### lang? > `optional` **lang?**: [`Language`](/developers/references/core-sdk/index/type-aliases/language/) Defined in: types/resolvedConfig.ts:93 *** ### logoUrl? > `optional` **logoUrl?**: `string` Defined in: types/resolvedConfig.ts:90 *** ### name? > `optional` **name?**: `string` Defined in: types/resolvedConfig.ts:89 *** ### placements? > `optional` **placements?**: `Record`\<`string`, [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\> Defined in: types/resolvedConfig.ts:98 *** ### translations? > `optional` **translations?**: `Record`\<`string`, `string`\> Defined in: types/resolvedConfig.ts:97 # RewardTier > **RewardTier** = \{ `amount`: [`TokenAmountType`](/developers/references/core-sdk/index/type-aliases/tokenamounttype/); `maxValue?`: `number`; `minValue`: `number`; \} \| \{ `maxValue?`: `number`; `minValue`: `number`; `percent`: `number`; \} Defined in: types/rpc/merchantInformation.ts:18 A tier definition for tiered rewards — pays either a flat token amount or a percent of the tier field value # RuleCondition > **RuleCondition** = \{ `field`: [`RuleField`](/developers/references/core-sdk/index/type-aliases/rulefield/); `operator`: [`ConditionOperator`](/developers/references/core-sdk/index/type-aliases/conditionoperator/); `value`: `string` \| `number` \| `boolean` \| `null` \| (`string` \| `number` \| `boolean`)[]; `valueTo?`: `string` \| `number` \| `boolean` \| `null` \| (`string` \| `number` \| `boolean`)[]; \} Defined in: types/rpc/merchantInformation.ts:112 A single leaf rule condition. Compares the value found at [RuleField](/developers/references/core-sdk/index/type-aliases/rulefield/) in the evaluation context against `value` (and `valueTo` for `between`). The array variant of `value`/`valueTo` is only meaningful with `in`/`not_in`; every other operator treats an array operand as a non-match. ## Properties ### field > **field**: [`RuleField`](/developers/references/core-sdk/index/type-aliases/rulefield/) Defined in: types/rpc/merchantInformation.ts:113 *** ### operator > **operator**: [`ConditionOperator`](/developers/references/core-sdk/index/type-aliases/conditionoperator/) Defined in: types/rpc/merchantInformation.ts:114 *** ### value > **value**: `string` \| `number` \| `boolean` \| `null` \| (`string` \| `number` \| `boolean`)[] Defined in: types/rpc/merchantInformation.ts:115 *** ### valueTo? > `optional` **valueTo?**: `string` \| `number` \| `boolean` \| `null` \| (`string` \| `number` \| `boolean`)[] Defined in: types/rpc/merchantInformation.ts:116 # RuleConditions > **RuleConditions** = [`RuleCondition`](/developers/references/core-sdk/index/type-aliases/rulecondition/)[] \| [`ConditionGroup`](/developers/references/core-sdk/index/type-aliases/conditiongroup/) Defined in: types/rpc/merchantInformation.ts:135 Campaign gating rules: a flat list of [RuleCondition](/developers/references/core-sdk/index/type-aliases/rulecondition/) (implicitly AND-ed) or a nested [ConditionGroup](/developers/references/core-sdk/index/type-aliases/conditiongroup/) tree. Surfaced raw so integrators can inspect the rules and derive their own display (start date, minimum purchase, …) instead of relying on pre-computed fields. # RuleField > **RuleField** = `"purchase.amount"` \| `"time.timestamp"` \| `"attribution.referrerIdentityGroupId"` \| `` `custom.${string}` `` \| `string` & `Record`\<`never`, `never`\> Defined in: types/rpc/merchantInformation.ts:92 Dot-path of the rule-evaluation context field a [RuleCondition](/developers/references/core-sdk/index/type-aliases/rulecondition/) targets. Only the paths the SDK actually reads are listed (for editor autocompletion); the trailing `string` member keeps the type open to any other path the backend may emit, so it never lies at runtime. Custom interaction data is addressed through `custom.${string}`. # SdkEventMap > **SdkEventMap** = `SdkLifecycleEventMap` & `SdkComponentEventMap` & `SdkReferralEventMap` Defined in: utils/analytics/events/index.ts:18 Merged SDK event map. Consumed by the SDK's typed `trackEvent`. Stays isolated from wallet-shared because the SDK ships in partner bundles (different OpenPanel client id, no wallet-shared dependency allowed). # SdkHandshakeFailureReason > **SdkHandshakeFailureReason** = `"timeout"` \| `"origin"` \| `"asset_push"` \| `"unknown"` Defined in: utils/analytics/events/lifecycle.ts:1 # SdkResolvedConfig > **SdkResolvedConfig** = \{ `allowedDomains?`: `string`[]; `attribution?`: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/); `components?`: [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\[`"components"`\]; `css?`: `string`; `currency?`: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/); `domain?`: `string`; `hasRawSdkConfig?`: `boolean`; `hidden?`: `boolean`; `homepageLink?`: `string`; `isResolved`: `boolean`; `lang?`: [`Language`](/developers/references/core-sdk/index/type-aliases/language/); `logoUrl?`: `string`; `merchantId`: `string`; `name?`: `string`; `placements?`: `Record`\<`string`, [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\>; `translations?`: `Record`\<`string`, `string`\>; \} Defined in: types/resolvedConfig.ts:115 Internal SDK config store state Merged config: backend > SDK static > defaults Components subscribe to this reactively ## Properties ### allowedDomains? > `optional` **allowedDomains?**: `string`[] Defined in: types/resolvedConfig.ts:126 Domains allowed for this merchant (used by iframe trust check) *** ### attribution? > `optional` **attribution?**: [`AttributionDefaults`](/developers/references/core-sdk/index/type-aliases/attributiondefaults/) Defined in: types/resolvedConfig.ts:154 Merged attribution defaults: backend > SDK static config *** ### components? > `optional` **components?**: [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\[`"components"`\] Defined in: types/resolvedConfig.ts:151 Global component defaults (fallback for placement-level overrides) *** ### css? > `optional` **css?**: `string` Defined in: types/resolvedConfig.ts:142 Global CSS from backend config (passed to iframe) *** ### currency? > `optional` **currency?**: [`Currency`](/developers/references/core-sdk/index/type-aliases/currency/) Defined in: types/resolvedConfig.ts:136 *** ### domain? > `optional` **domain?**: `string` Defined in: types/resolvedConfig.ts:123 Domain returned by the resolve endpoint *** ### hasRawSdkConfig? > `optional` **hasRawSdkConfig?**: `boolean` Defined in: types/resolvedConfig.ts:129 Whether the resolve returned a backend sdkConfig object *** ### hidden? > `optional` **hidden?**: `boolean` Defined in: types/resolvedConfig.ts:139 When true, all SDK components should be hidden *** ### homepageLink? > `optional` **homepageLink?**: `string` Defined in: types/resolvedConfig.ts:134 *** ### isResolved > **isResolved**: `boolean` Defined in: types/resolvedConfig.ts:117 Whether the backend config has been resolved *** ### lang? > `optional` **lang?**: [`Language`](/developers/references/core-sdk/index/type-aliases/language/) Defined in: types/resolvedConfig.ts:135 *** ### logoUrl? > `optional` **logoUrl?**: `string` Defined in: types/resolvedConfig.ts:133 *** ### merchantId > **merchantId**: `string` Defined in: types/resolvedConfig.ts:120 Merchant ID from resolution *** ### name? > `optional` **name?**: `string` Defined in: types/resolvedConfig.ts:132 Merged metadata fields *** ### placements? > `optional` **placements?**: `Record`\<`string`, [`ResolvedPlacement`](/developers/references/core-sdk/index/type-aliases/resolvedplacement/)\> Defined in: types/resolvedConfig.ts:148 Named placements (keyed by placement ID) *** ### translations? > `optional` **translations?**: `Record`\<`string`, `string`\> Defined in: types/resolvedConfig.ts:145 Global translations (for reference / component fallback) # SendInteractionParamsType > **SendInteractionParamsType** = \{ `referralTimestamp?`: `number`; `referrerClientId?`: `string`; `referrerMerchantId?`: `string`; `referrerWallet?`: `Address`; `type`: `"arrival"`; \} \| \{ `purchaseId?`: `string`; `sharingTimestamp?`: `number`; `type`: `"sharing"`; \} \| \{ `customType`: `string`; `data?`: `Record`\<`string`, `unknown`\>; `idempotencyKey?`: `string`; `type`: `"custom"`; \} Defined in: types/rpc/interaction.ts:11 Parameters for sending interactions via RPC Note: merchantId and clientId come from WalletRpcContext and are NOT included in the params - they are resolved by the listener ## Union Members ### Type Literal \{ `referralTimestamp?`: `number`; `referrerClientId?`: `string`; `referrerMerchantId?`: `string`; `referrerWallet?`: `Address`; `type`: `"arrival"`; \} #### referralTimestamp? > `optional` **referralTimestamp?**: `number` Epoch seconds timestamp from the referral link creation #### referrerClientId? > `optional` **referrerClientId?**: `string` #### referrerMerchantId? > `optional` **referrerMerchantId?**: `string` #### referrerWallet? > `optional` **referrerWallet?**: `Address` Sharer wallet address. Accepted in both wallet-only legacy contexts and merchant-context (V2) contexts. #### type > **type**: `"arrival"` *** ### Type Literal \{ `purchaseId?`: `string`; `sharingTimestamp?`: `number`; `type`: `"sharing"`; \} #### purchaseId? > `optional` **purchaseId?**: `string` Merchant order ID linking this sharing event to a purchase (stays server-side, never in URL) #### sharingTimestamp? > `optional` **sharingTimestamp?**: `number` Epoch seconds timestamp matching the V2 context `t` field embedded in the referral link URL, used for backend correlation #### type > **type**: `"sharing"` *** ### Type Literal \{ `customType`: `string`; `data?`: `Record`\<`string`, `unknown`\>; `idempotencyKey?`: `string`; `type`: `"custom"`; \} # SendTransactionModalStepType > **SendTransactionModalStepType** = `GenericModalStepType`\<`"sendTransaction"`, \{ `tx`: [`SendTransactionTxType`](/developers/references/core-sdk/index/type-aliases/sendtransactiontxtype/) \| [`SendTransactionTxType`](/developers/references/core-sdk/index/type-aliases/sendtransactiontxtype/)[]; \}, \{ `hash`: `` `0x${string}` ``; \}\> Defined in: types/rpc/modal/transaction.ts:29 The send transaction step for a Modal **Input**: Either a single tx or an array of tx to be sent **Output**: The hash of the tx(s) hash (in case of multiple tx, still returns a single hash because it's bundled on the wallet level) # SendTransactionReturnType > **SendTransactionReturnType** = \{ `hash`: `Hex`; \} Defined in: types/rpc/modal/transaction.ts:17 Return type of the send transaction rpc request ## Properties ### hash > **hash**: `Hex` Defined in: types/rpc/modal/transaction.ts:18 # SendTransactionTxType > **SendTransactionTxType** = \{ `data?`: `Hex`; `to`: `Address`; `value?`: `Hex`; \} Defined in: types/rpc/modal/transaction.ts:7 Generic format representing a tx to be sent ## Properties ### data? > `optional` **data?**: `Hex` Defined in: types/rpc/modal/transaction.ts:9 *** ### to > **to**: `Address` Defined in: types/rpc/modal/transaction.ts:8 *** ### value? > `optional` **value?**: `Hex` Defined in: types/rpc/modal/transaction.ts:10 # SharingPageProduct > **SharingPageProduct** = [`ProductDetails`](/developers/references/core-sdk/index/type-aliases/productdetails/) & \{ `imageUrl?`: `string`; `link?`: `string`; `title?`: `string`; `utmContent?`: `string`; \} Defined in: types/rpc/displaySharingPage.ts:13 Product information to display on the sharing page. Extends [ProductDetails](/developers/references/core-sdk/index/type-aliases/productdetails/) so reward selection can consume the same array the product cards render from, without a second parallel array. ## Type Declaration ### imageUrl? > `optional` **imageUrl?**: `string` Optional product image URL ### link? > `optional` **link?**: `string` Optional product-specific sharing link When provided and the product is selected, this link is used instead of the default sharing link ### title? > `optional` **title?**: `string` The product title / name. Optional: an entry carrying only scope fields (e.g. `sku`) still drives reward selection, it just renders no product card. ### utmContent? > `optional` **utmContent?**: `string` Optional `utm_content` value to apply when this product is selected. Falls back to the page-level `attribution.utmContent` when omitted. # SiweAuthenticateModalStepType > **SiweAuthenticateModalStepType** = `GenericModalStepType`\<`"siweAuthenticate"`, \{ `siwe`: [`SiweAuthenticationParams`](/developers/references/core-sdk/index/type-aliases/siweauthenticationparams/); \}, \{ `message`: `string`; `signature`: `` `0x${string}` ``; \}\> Defined in: types/rpc/modal/siweAuthenticate.ts:33 The SIWE authentication step for a Modal **Input**: SIWE message parameters **Output**: SIWE result (message signed and wallet signature) # SiweAuthenticateReturnType > **SiweAuthenticateReturnType** = \{ `message`: `string`; `signature`: `Hex`; \} Defined in: types/rpc/modal/siweAuthenticate.ts:20 Return type of the Siwe transaction rpc request ## Properties ### message > **message**: `string` Defined in: types/rpc/modal/siweAuthenticate.ts:22 *** ### signature > **signature**: `Hex` Defined in: types/rpc/modal/siweAuthenticate.ts:21 # SiweAuthenticationParams > **SiweAuthenticationParams** = `Omit`\<`SiweMessage`, `"address"` \| `"chainId"` \| `"expirationTime"` \| `"issuedAt"` \| `"notBefore"`\> & \{ `expirationTimeTimestamp?`: `number`; `notBeforeTimestamp?`: `number`; \} Defined in: types/rpc/modal/siweAuthenticate.ts:8 Parameters used send a SIWE rpc request ## Type Declaration ### expirationTimeTimestamp? > `optional` **expirationTimeTimestamp?**: `number` ### notBeforeTimestamp? > `optional` **notBeforeTimestamp?**: `number` # SsoMetadata > **SsoMetadata** = \{ `homepageLink?`: `string`; `logoUrl?`: `string`; \} Defined in: types/rpc/sso.ts:6 SSO Metadata ## Properties ### homepageLink? > `optional` **homepageLink?**: `string` Defined in: types/rpc/sso.ts:14 Link to your homepage, if referenced your app name will contain a link on the sso page *** ### logoUrl? > `optional` **logoUrl?**: `string` Defined in: types/rpc/sso.ts:10 URL to your client, if provided will be displayed in the SSO header # TokenAmountType > **TokenAmountType** = \{ `amount`: `number`; `eurAmount`: `number`; `gbpAmount`: `number`; `usdAmount`: `number`; \} Defined in: types/rpc/merchantInformation.ts:7 The type for the amount of tokens ## Properties ### amount > **amount**: `number` Defined in: types/rpc/merchantInformation.ts:8 *** ### eurAmount > **eurAmount**: `number` Defined in: types/rpc/merchantInformation.ts:9 *** ### gbpAmount > **gbpAmount**: `number` Defined in: types/rpc/merchantInformation.ts:11 *** ### usdAmount > **usdAmount**: `number` Defined in: types/rpc/merchantInformation.ts:10 # TrackArrivalParams > **TrackArrivalParams** = \{ `referralTimestamp?`: `number`; `referrerClientId?`: `string`; `referrerMerchantId?`: `string`; `referrerWallet?`: `Address`; \} Defined in: types/tracking.ts:47 ## Properties ### referralTimestamp? > `optional` **referralTimestamp?**: `number` Defined in: types/tracking.ts:53 Epoch seconds timestamp from the referral link creation *** ### referrerClientId? > `optional` **referrerClientId?**: `string` Defined in: types/tracking.ts:50 *** ### referrerMerchantId? > `optional` **referrerMerchantId?**: `string` Defined in: types/tracking.ts:51 *** ### referrerWallet? > `optional` **referrerWallet?**: `Address` Defined in: types/tracking.ts:49 Sharer wallet address. Accepted in both V1 (legacy) and V2 (authenticated sharer) contexts. # TrackArrivalResult > **TrackArrivalResult** = \{ `error?`: `string`; `identityGroupId?`: `string`; `referralLinkId?`: `string`; `success`: `boolean`; \} Defined in: types/tracking.ts:56 ## Properties ### error? > `optional` **error?**: `string` Defined in: types/tracking.ts:60 *** ### identityGroupId? > `optional` **identityGroupId?**: `string` Defined in: types/tracking.ts:58 *** ### referralLinkId? > `optional` **referralLinkId?**: `string` Defined in: types/tracking.ts:59 *** ### success > **success**: `boolean` Defined in: types/tracking.ts:57 # UserReferralStatusType > **UserReferralStatusType** = \{ `isReferred`: `boolean`; \} Defined in: types/rpc/userReferralStatus.ts:13 User referral status returned by `frak_getUserReferralStatus`. Generic referral context for the current user on a merchant. Used by components like `` and `` to adapt their display based on the user's referral relationship. Returns `null` when the user's identity cannot be resolved (e.g. no clientId and no wallet session). ## Properties ### isReferred > **isReferred**: `boolean` Defined in: types/rpc/userReferralStatus.ts:19 Whether the user was referred to this merchant by someone else. `true` means a referral link exists where this user is the referee. # UtmParams > **UtmParams** = \{ `campaign?`: `string`; `content?`: `string`; `medium?`: `string`; `source?`: `string`; `term?`: `string`; \} Defined in: types/tracking.ts:3 ## Properties ### campaign? > `optional` **campaign?**: `string` Defined in: types/tracking.ts:6 *** ### content? > `optional` **content?**: `string` Defined in: types/tracking.ts:8 *** ### medium? > `optional` **medium?**: `string` Defined in: types/tracking.ts:5 *** ### source? > `optional` **source?**: `string` Defined in: types/tracking.ts:4 *** ### term? > `optional` **term?**: `string` Defined in: types/tracking.ts:7 # WalletStatusReturnType > **WalletStatusReturnType** = \{ `interactionToken?`: `string`; `key`: `"connected"`; `wallet`: `` `0x${string}` ``; \} \| \{ `interactionToken?`: `undefined`; `key`: `"not-connected"`; `wallet?`: `undefined`; \} Defined in: types/rpc/walletStatus.ts:7 RPC Response for the method `frak_listenToWalletStatus` # DEEP_LINK_SCHEME > `const` **DEEP\_LINK\_SCHEME**: `string` Defined in: constants.ts:14 Deep link scheme for Frak Wallet mobile app. Replaced at build time via tsdown/Vite `define`. Defaults to the prod scheme; in-monorepo dev builds (listener at wallet-dev.frak.id) override this with `frakwallet-dev://` so deep links open the dev wallet variant (id.frak.wallet.dev). External integrators consuming the published NPM/CDN bundle always see the prod scheme. # FrakContextManager > `const` **FrakContextManager**: \{ `compress`: (`context?`) => `string` \| `undefined`; `decompress`: (`context?`) => `FrakContext` \| `undefined`; `parse`: (`args`) => `FrakContext` \| `null` \| `undefined`; `remove`: (`url`) => `string`; `replaceUrl`: (`args`) => `void`; `update`: (`args`) => `string` \| `null`; \} Defined in: context/frakContext.ts:256 Manager for Frak referral context in URLs. Handles compression, decompression, URL parsing, and browser history updates for both V1 (wallet address) and V2 (anonymous clientId) referral contexts. ## Type Declaration ### compress > **compress**: (`context?`) => `string` \| `undefined` Compress a Frak context into a URL-safe string. - V2 contexts are encoded using a compact binary layout (see encodeFrakContextV2) then base64url-encoded. - V1 contexts encode the wallet address as raw bytes (base64url). #### Parameters ##### context? `FrakContextV1` \| `FrakContextV2` The context to compress (V1 or V2) #### Returns `string` \| `undefined` A compressed base64url string, or undefined on failure ### decompress > **decompress**: (`context?`) => `FrakContext` \| `undefined` Decompress a base64url string back into a Frak context. V1 (exactly 20 bytes) and V2 (37, 41, or 57 bytes) are distinguished by their decoded byte length, so there is no ambiguity. #### Parameters ##### context? `string` The compressed context string #### Returns `FrakContext` \| `undefined` The decompressed FrakContext, or undefined on failure ### parse > **parse**: (`args`) => `FrakContext` \| `null` \| `undefined` Parse a URL to extract the Frak referral context from the `fCtx` query parameter. The key is matched case-insensitively: some link channels (emails, messaging apps) lowercase query-param keys in transit, so `fCtx` can arrive as `fctx`. #### Parameters ##### args ###### url `string` The URL to parse #### Returns `FrakContext` \| `null` \| `undefined` The parsed FrakContext, or null when absent or the URL is unparseable ### remove > **remove**: (`url`) => `string` Remove the `fCtx` query parameter from a URL. #### Parameters ##### url `string` The URL to strip the context from #### Returns `string` The cleaned URL string, or `url` unchanged when it is not parseable ### replaceUrl > **replaceUrl**: (`args`) => `void` Replace the current browser URL with an updated Frak context. - If `context` is non-null, embeds it via update. - If `context` is null, strips the context via remove. #### Parameters ##### args ###### context `FrakContextV1` \| `FrakContextV2` \| `null` Context to set, or null to remove ###### url? `string` Base URL (defaults to `window.location.href`) #### Returns `void` ### update > **update**: (`args`) => `string` \| `null` Add or replace the `fCtx` query parameter in a URL with the given context. Standard affiliation params (`utm_source`, `utm_medium`, `utm_campaign`, `ref`, `via`, ...) are always appended using gap-fill semantics: pre-existing params on the URL are preserved, defaults are derived from the context when applicable, and `attribution` overrides take precedence when provided. #### Parameters ##### args ###### attribution? [`AttributionParams`](/developers/references/core-sdk/index/type-aliases/attributionparams/) Optional attribution overrides. Defaults are applied even when omitted. ###### context `FrakContextV1` \| `FrakContextV2` The context to embed (V1 or V2) ###### url? `string` The URL to update #### Returns `string` \| `null` The updated URL string, or null on failure # isInAppBrowser > `const` **isInAppBrowser**: `boolean` Defined in: utils/browser/inAppBrowser.ts:53 Whether the current browser is a social media in-app browser (Instagram, Facebook). # isIOS > `const` **isIOS**: `boolean` Defined in: utils/browser/inAppBrowser.ts:19 Whether the current device runs iOS (including iPadOS 13+). # sdkConfigStore > `const` **sdkConfigStore**: \{ `getConfig`: () => [`SdkResolvedConfig`](/developers/references/core-sdk/index/type-aliases/sdkresolvedconfig/); get `isCacheFresh`(): `boolean`; get `isResolved`(): `boolean`; `clearCache`: `void`; `getMerchantId`: `string` \| `undefined`; `reset`: `void`; `resolve`: `Promise`\<[`MerchantConfigResponse`](/developers/references/core-sdk/index/type-aliases/merchantconfigresponse/) \| `undefined`\>; `resolveMerchantId`: `Promise`\<`string` \| `undefined`\>; `setCacheScope`: `void`; `setConfig`: `void`; \} Defined in: config/sdkConfigStore.ts:166 ## Type Declaration ### getConfig > **getConfig**: () => [`SdkResolvedConfig`](/developers/references/core-sdk/index/type-aliases/sdkresolvedconfig/) #### Returns [`SdkResolvedConfig`](/developers/references/core-sdk/index/type-aliases/sdkresolvedconfig/) ### isCacheFresh #### Get Signature > **get** **isCacheFresh**(): `boolean` ##### Returns `boolean` ### isResolved #### Get Signature > **get** **isResolved**(): `boolean` ##### Returns `boolean` ### clearCache() > **clearCache**(): `void` #### Returns `void` ### getMerchantId() > **getMerchantId**(): `string` \| `undefined` #### Returns `string` \| `undefined` ### reset() > **reset**(): `void` #### Returns `void` ### resolve() > **resolve**(`domain?`, `lang?`): `Promise`\<[`MerchantConfigResponse`](/developers/references/core-sdk/index/type-aliases/merchantconfigresponse/) \| `undefined`\> #### Parameters ##### domain? `string` ##### lang? [`Language`](/developers/references/core-sdk/index/type-aliases/language/) #### Returns `Promise`\<[`MerchantConfigResponse`](/developers/references/core-sdk/index/type-aliases/merchantconfigresponse/) \| `undefined`\> ### resolveMerchantId() > **resolveMerchantId**(`domain?`): `Promise`\<`string` \| `undefined`\> #### Parameters ##### domain? `string` #### Returns `Promise`\<`string` \| `undefined`\> ### setCacheScope() > **setCacheScope**(`domain`, `lang?`): `void` #### Parameters ##### domain `string` ##### lang? `string` #### Returns `void` ### setConfig() > **setConfig**(`config`): `void` #### Parameters ##### config [`SdkResolvedConfig`](/developers/references/core-sdk/index/type-aliases/sdkresolvedconfig/) #### Returns `void` # ssoPopupFeatures > `const` **ssoPopupFeatures**: `"menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800"` = `"menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800"` Defined in: actions/openSso.ts:5 # ssoPopupName > `const` **ssoPopupName**: `"frak-sso"` = `"frak-sso"` Defined in: actions/openSso.ts:7 # iOS SDK ## Modules | Name | Contents | |---|---| | [FrakSDK](/developers/references/ios/fraksdk/) | 43 type(s) | | [FrakSDKUI](/developers/references/ios/fraksdkui/) | 9 type(s) | # FrakSDK ## Types | Name | Summary | |---|---| | [AppLinkAPI](/developers/references/ios/fraksdk/applinkapi/) | Inbound referral links and the wallet app handoff. | | [AttributionDefaults](/developers/references/ios/fraksdk/attributiondefaults/) | Default attribution parameters applied to a share link when the caller omits them. | | [AttributionParams](/developers/references/ios/fraksdk/attributionparams/) | Attribution parameters to hang off a share link, overriding the merchant's defaults. | | [BannerConfig](/developers/references/ios/fraksdk/bannerconfig/) | Copy for the referral banner, in both the referral and in-app contexts. | | [BestReward](/developers/references/ios/fraksdk/bestreward/) | The single reward worth advertising, selected and formatted by the server, so every surface shows an identical number. | | [ButtonShareConfig](/developers/references/ios/fraksdk/buttonshareconfig/) | Copy for the share button. | | [ButtonWalletConfig](/developers/references/ios/fraksdk/buttonwalletconfig/) | Copy for the wallet button. | | [Campaign](/developers/references/ios/fraksdk/campaign/) | One active campaign, as returned by `GET /user/merchant/estimated-rewards`. | | [ConfigAPI](/developers/references/ios/fraksdk/configapi/) | Config resolution. | | [DeepLinkHandling](/developers/references/ios/fraksdk/deeplinkhandling/) | | | [EstimatedReward](/developers/references/ios/fraksdk/estimatedreward/) | What a campaign pays out. | | [Frak](/developers/references/ios/fraksdk/frak/) | Entry point. | | [FrakClient](/developers/references/ios/fraksdk/frakclient/) | Everything the SDK can do. | | [FrakConfig](/developers/references/ios/fraksdk/frakconfig/) | Everything the SDK needs to start, supplied once to `Frak.initialize(_:)`. | | [FrakContext](/developers/references/ios/fraksdk/frakcontext/) | Who a share link came from, as carried in its `fCtx` query parameter. | | [FrakCurrency](/developers/references/ios/fraksdk/frakcurrency/) | | | [FrakEnvironment](/developers/references/ios/fraksdk/frakenvironment/) | | | [FrakError](/developers/references/ios/fraksdk/frakerror/) | Every failure the SDK can hand back. | | [FrakLanguage](/developers/references/ios/fraksdk/fraklanguage/) | | | [FrakLogLevel](/developers/references/ios/fraksdk/frakloglevel/) | | | [FrakLogSink](/developers/references/ios/fraksdk/fraklogsink/) | | | [FrakMetadata](/developers/references/ios/fraksdk/frakmetadata/) | Static merchant-supplied facts about the app, fixed at build time. | | [FrakResolvedConfig](/developers/references/ios/fraksdk/frakresolvedconfig/) | What the backend knows about this merchant, as resolved by `GET /user/merchant/resolve`. | | [Interaction](/developers/references/ios/fraksdk/interaction/) | | | [OpenAppResult](/developers/references/ios/fraksdk/openappresult/) | | | [OpenInAppConfig](/developers/references/ios/fraksdk/openinappconfig/) | Copy for the "open in app" prompt. | | [PercentEncoding](/developers/references/ios/fraksdk/percentencoding/) | | | [PostPurchaseConfig](/developers/references/ios/fraksdk/postpurchaseconfig/) | Copy shown after a purchase, for both the referee and referrer. | | [ProductDetails](/developers/references/ios/fraksdk/productdetails/) | The purchase line-item fields a campaign's `productScope` can target. | | [ResolvedComponents](/developers/references/ios/fraksdk/resolvedcomponents/) | Merchant-configured copy for each SDK-rendered component. | | [ResolvedPlacement](/developers/references/ios/fraksdk/resolvedplacement/) | Copy and component overrides scoped to one placement, such as a product page. | | [ResolvedSdkConfig](/developers/references/ios/fraksdk/resolvedsdkconfig/) | The `sdkConfig` block of a resolve response: merchant-configured copy overrides, translations, per-placement components and attribution defaults. | | [RewardAudience](/developers/references/ios/fraksdk/rewardaudience/) | Who a reward is estimated for: the sharer (`.referrer`) or the person arriving through the link (`.referee`). | | [RewardRequest](/developers/references/ios/fraksdk/rewardrequest/) | What to look a reward up for. | | [RewardsAPI](/developers/references/ios/fraksdk/rewardsapi/) | Campaigns and reward selection. | | [RewardTier](/developers/references/ios/fraksdk/rewardtier/) | One band of a tiered reward. | | [SharingAPI](/developers/references/ios/fraksdk/sharingapi/) | Share link construction. | | [SharingProduct](/developers/references/ios/fraksdk/sharingproduct/) | One product card on the sharing page. | | [SharingRequest](/developers/references/ios/fraksdk/sharingrequest/) | What to share, and how to attribute it. | | [TokenAmount](/developers/references/ios/fraksdk/tokenamount/) | A reward amount in raw token units and in each fiat currency the backend prices. | | [TrackingAPI](/developers/references/ios/fraksdk/trackingapi/) | Interaction and purchase tracking. | # AppLinkAPI ```swift struct AppLinkAPI ``` Inbound referral links and the wallet app handoff. Obtained from `FrakClient.appLink`. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/AppLinkAPI.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/AppLinkAPI.swift#L4) ## Methods ### handleReferral(_:) ```swift @discardableResult func handleReferral(_ url: String) async -> Bool ``` - Returns: whether the link carried a Frak referral context. Not a "stop routing" signal — still navigate to the URL either way. ### handleReferral(_:) ```swift @discardableResult func handleReferral(_ url: URL) async -> Bool ``` ### installPageURL(returnScheme:sessionId:) ```swift func installPageURL(returnScheme: String, sessionId: String) async throws -> String ``` The wallet's hosted install page for this device. Not the store listing — `openFrakApp()` handles that handoff itself. This page shows the install code that carries attribution across an install, plus the store link, and it carries a freshly minted `frak-install-v1` proof. The sharing sheet navigates to it in place, so the user never leaves the merchant app to reach it. - Throws: `FrakError` when the page cannot be minted: tracking is disabled, the device refused key material, or no merchant could be resolved. ### isFrakAppInstalled() ```swift func isFrakAppInstalled() async -> Bool ``` ### openFrakApp() ```swift func openFrakApp() async -> OpenAppResult ``` # AttributionDefaults ```swift struct AttributionDefaults ``` Default attribution parameters applied to a share link when the caller omits them. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:226](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L226) ## Initializers ### init(utmSource:utmMedium:utmCampaign:utmTerm:via:ref:) ```swift init( utmSource: String? = nil, utmMedium: String? = nil, utmCampaign: String? = nil, utmTerm: String? = nil, via: String? = nil, ref: String? = nil ) ``` ## Properties ### ref ```swift let ref: String? ``` ### utmCampaign ```swift let utmCampaign: String? ``` ### utmMedium ```swift let utmMedium: String? ``` ### utmSource ```swift let utmSource: String? ``` ### utmTerm ```swift let utmTerm: String? ``` ### via ```swift let via: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # AttributionParams ```swift struct AttributionParams ``` Attribution parameters to hang off a share link, overriding the merchant's defaults. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Sharing/SharingRequest.swift:2](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Sharing/SharingRequest.swift#L2) ## Initializers ### init(utmSource:utmMedium:utmCampaign:utmContent:utmTerm:via:ref:) ```swift init( utmSource: String? = nil, utmMedium: String? = nil, utmCampaign: String? = nil, utmContent: String? = nil, utmTerm: String? = nil, via: String? = nil, ref: String? = nil ) ``` ## Properties ### ref ```swift let ref: String? ``` ### utmCampaign ```swift let utmCampaign: String? ``` ### utmContent ```swift let utmContent: String? ``` What was shared. Only ever per-call or per-product — a merchant-level default cannot know it. ### utmMedium ```swift let utmMedium: String? ``` ### utmSource ```swift let utmSource: String? ``` ### utmTerm ```swift let utmTerm: String? ``` ### via ```swift let via: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # BannerConfig ```swift struct BannerConfig ``` Copy for the referral banner, in both the referral and in-app contexts. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:197](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L197) ## Initializers ### init(referralTitle:referralDescription:referralCta:inappTitle:inappDescription:inappCta:imageUrl:) ```swift init( referralTitle: String? = nil, referralDescription: String? = nil, referralCta: String? = nil, inappTitle: String? = nil, inappDescription: String? = nil, inappCta: String? = nil, imageUrl: String? = nil ) ``` ## Properties ### imageUrl ```swift let imageUrl: String? ``` ### inappCta ```swift let inappCta: String? ``` ### inappDescription ```swift let inappDescription: String? ``` ### inappTitle ```swift let inappTitle: String? ``` ### referralCta ```swift let referralCta: String? ``` ### referralDescription ```swift let referralDescription: String? ``` ### referralTitle ```swift let referralTitle: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # BestReward ```swift struct BestReward ``` The single reward worth advertising, selected and formatted by the server, so every surface shows an identical number. `formatted` contains a non-breaking space (U+00A0) before the currency symbol — render it as-is, never compare it against an ordinary-space string. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/Rewards.swift:98](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/Rewards.swift#L98) ## Properties ### formatted ```swift let formatted: String ``` ### isProductScoped ```swift let isProductScoped: Bool ``` Whether the selected campaign is gated to a `productScope`. The gate, not the reward's basis — a product-gated campaign can still pay a percentage of the whole basket. Defaults to `false` so a backend that predates this field still decodes. ### lockupDurationDays ```swift let lockupDurationDays: Double? ``` ### matchedProducts ```swift let matchedProducts: [ProductDetails]? ``` The subset of the products this call supplied that matched the winning campaign's scope. `nil` for an unscoped winner, or when no products were supplied. ### minPurchaseAmount ```swift let minPurchaseAmount: String? ``` ### minPurchaseValue ```swift let minPurchaseValue: Double? ``` ### payoutType ```swift let payoutType: String ``` Which shape `formatted` describes: `fixed`, `percentage` or `tiered`. A plain `String` so a payout type newer than this binary still decodes. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ButtonShareConfig ```swift struct ButtonShareConfig ``` Copy for the share button. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:130](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L130) ## Initializers ### init(text:noRewardText:clickAction:) ```swift init(text: String? = nil, noRewardText: String? = nil, clickAction: String? = nil) ``` ## Properties ### clickAction ```swift let clickAction: String? ``` ### noRewardText ```swift let noRewardText: String? ``` ### text ```swift let text: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ButtonWalletConfig ```swift struct ButtonWalletConfig ``` Copy for the wallet button. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:147](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L147) ## Initializers ### init(position:) ```swift init(position: String? = nil) ``` ## Properties ### position ```swift let position: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # Campaign ```swift struct Campaign ``` One active campaign, as returned by `GET /user/merchant/estimated-rewards`. Arrives sorted by campaign priority, descending; do not re-sort it. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/Rewards.swift:58](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/Rewards.swift#L58) ## Properties ### campaignId ```swift let campaignId: String ``` ### defaultLockupSeconds ```swift let defaultLockupSeconds: Double? ``` ### expiresAt ```swift let expiresAt: String? ``` ISO-8601 expiry, or nil for a campaign that never expires. ### interactionTypeKey ```swift let interactionTypeKey: String ``` The interaction that triggers this campaign, e.g. `purchase`. Open on the wire. ### maxRewardsPerUser ```swift let maxRewardsPerUser: Double? ``` ### name ```swift let name: String ``` ### referee ```swift let referee: EstimatedReward? ``` What the person arriving through the link earns. ### referrer ```swift let referrer: EstimatedReward? ``` What the sharer earns. Absent when the campaign rewards only the referee. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ConfigAPI ```swift struct ConfigAPI ``` Config resolution. Obtained from `FrakClient.config`. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/ConfigAPI.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/ConfigAPI.swift#L4) ## Properties ### current ```swift var current: FrakResolvedConfig? { get async } ``` The most recently resolved config, or nil before the first resolve. ### updates ```swift var updates: AsyncStream { get async } ``` Multicast. Emits on a network resolve that changed the config, and replays the last such value; a warm start served from a fresh cache emits nothing, so read `current` first. ## Methods ### resolve(forceRefresh:) ```swift func resolve(forceRefresh: Bool = false) async throws -> FrakResolvedConfig ``` Stale-while-revalidate cache; forceRefresh still respects failure backoff. # DeepLinkHandling ```swift enum DeepLinkHandling ``` **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakConfig.swift:27](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakConfig.swift#L27) ## Cases ### DeepLinkHandling.disabled ```swift case disabled ``` ### DeepLinkHandling.manual ```swift case manual ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # EstimatedReward ```swift enum EstimatedReward ``` What a campaign pays out. `.percentage` has no concrete amount to advertise, so it is suppressed from display. `.unknown` covers a `payoutType` newer than this binary. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/Rewards.swift:48](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/Rewards.swift#L48) ## Cases ### EstimatedReward.fixed(amount:) ```swift case fixed(amount: TokenAmount) ``` ### EstimatedReward.percentage(percent:percentOf:maxAmount:minAmount:) ```swift case percentage( percent: Double, percentOf: String, maxAmount: TokenAmount?, minAmount: TokenAmount? ) ``` ### EstimatedReward.tiered(tierField:tiers:) ```swift case tiered(tierField: String, tiers: [RewardTier]) ``` ### EstimatedReward.unknown(payoutType:) ```swift case unknown(payoutType: String) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # Frak ```swift enum Frak ``` Entry point. Call `initialize(_:)` once, then use `client`. ```swift Frak.initialize(FrakConfig(merchantId: "...", metadata: FrakMetadata(name: "Acme"))) let reward = try await Frak.client.rewards.best(RewardRequest(targetInteraction: "purchase")) ``` Defined in: [Sources/FrakSDK/Frak.swift:10](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Frak.swift#L10) ## Type properties ### client ```swift static var client: FrakClient { get throws } ``` ### clientOrNull ```swift static var clientOrNull: FrakClient? { get } ``` Same as `client`, but nil instead of throwing: for a call site that would just `try?` it anyway. Exists for parity with the Android surface, and for a call site that reads better without `try?`. ### isInitialized ```swift static var isInitialized: Bool { get } ``` ## Type methods ### initialize(_:) ```swift static func initialize(_ config: FrakConfig) ``` ### parseReferralLink(_:) ```swift static func parseReferralLink(_ url: String) -> FrakContext? ``` ### parseReferralLink(_:) ```swift static func parseReferralLink(_ url: URL) -> FrakContext? ``` ### shutdown() ```swift static func shutdown() async ``` Tears the SDK down: cancels the background work it owns and drops the client so `initialize(_:)` can run again with a different `FrakConfig`. Not a privacy control — use `FrakClient.setTrackingEnabled(_:)` for that; shutting the SDK down neither records a consent decision nor erases anything, so a merchant who calls only this has stopped tracking for exactly as long as their process lives. Exists so a host can deterministically release the SDK, and so the facade is testable at all. Idempotent and safe before `initialize(_:)`. # FrakClient ```swift final class FrakClient ``` Everything the SDK can do. Obtained from `Frak.client`. A concrete class, not a protocol: adding a member here is additive on both platforms, where adding a requirement to a protocol invalidates every witness table built before it. There is no supported way for a merchant to substitute a fake; point `FrakEnvironment.custom(wallet:backend:)` at a stub server instead and exercise the real client. Capabilities are grouped into five namespaces — ``config``, ``rewards``, ``sharing``, ``tracking``, ``appLink`` — rather than kept flat, so the wallet-session cluster (SSO, embedded wallet, pairing) can land as a new namespace without touching this one. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/FrakClient.swift:14](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/FrakClient.swift#L14) ## Properties ### anonymousId ```swift var anonymousId: String? { get async } ``` Nil when tracking is disabled or the device refused key material. ### appLink ```swift let appLink: AppLinkAPI ``` Inbound referral links and the wallet app handoff. ### config ```swift let config: ConfigAPI ``` Config resolution and its live stream. ### environment ```swift nonisolated var environment: FrakEnvironment { get } ``` The stage this client talks to. Merchants never set it directly, see `FrakConfig.env`. ### rewards ```swift let rewards: RewardsAPI ``` Campaigns and the single best reward to advertise. ### sharing ```swift let sharing: SharingAPI ``` Share link construction. ### tracking ```swift let tracking: TrackingAPI ``` Interaction and purchase tracking. ## Methods ### isTrackingEnabled() ```swift func isTrackingEnabled() async -> Bool ``` Whether tracking is currently allowed: `FrakConfig.trackingEnabled` AND the persisted runtime decision. For a consent screen that has to render the current state, and for the accountability record a data-protection authority asks for. ### resetAnonymousId() ```swift @discardableResult func resetAnonymousId() async -> Bool ``` Destroys the keypair (next `anonymousId` read mints a new one) and purges the queue. This is a local identity rotation, not an Art. 17 erasure: events already sent stay attributed to the old id on Frak's side. Route an actual erasure request to https://frak.id/account-deletion. Returns false when erasure failed and the id did NOT rotate. On this platform the underlying delete cannot fail, so this always returns true — the value exists to keep one cross-platform contract for merchants writing shared erasure logic. ### setTrackingEnabled(_:) ```swift func setTrackingEnabled(_ enabled: Bool) async ``` Turns tracking on or off at runtime, and persists the decision for this install. Call it from your consent-management flow; call it as often as the user changes their mind. `false` stops all tracking immediately and purges anything still queued. `true` re-enables it **unless** this build ships `FrakConfig(trackingEnabled: false)`, which is a hard floor a runtime call cannot lift. This does **not** destroy the identity: a user who opts back in is still the same `anonymousId`, which is what makes a temporary opt-out a pause rather than an amputation. For a genuine withdrawal of consent, the recipe is both calls in this order: ```swift await client.setTrackingEnabled(false) // stop, and drop what is queued await client.resetAnonymousId() // then sever the device from the id ``` Purging the queue can discard purchase events that have not reached the backend yet. That is deliberate — they were captured under a consent decision that no longer holds — but it is a revenue consequence, not only a privacy one. # FrakConfig ```swift struct FrakConfig ``` Everything the SDK needs to start, supplied once to `Frak.initialize(_:)`. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakConfig.swift:62](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakConfig.swift#L62) ## Initializers ### init(merchantId:bundleId:metadata:env:deepLink:trackingEnabled:logLevel:logSink:) ```swift init( merchantId: String? = nil, bundleId: String? = nil, metadata: FrakMetadata = FrakMetadata(), env: FrakEnvironment = .production, deepLink: DeepLinkHandling = .manual, trackingEnabled: Bool = true, logLevel: FrakLogLevel = .none, logSink: (any FrakLogSink)? = nil ) ``` ## Properties ### bundleId ```swift let bundleId: String? ``` ### deepLink ```swift let deepLink: DeepLinkHandling ``` ### env ```swift let env: FrakEnvironment ``` ### logLevel ```swift let logLevel: FrakLogLevel ``` ### logSink ```swift let logSink: (any FrakLogSink)? ``` ### merchantId ```swift let merchantId: String? ``` ### metadata ```swift let metadata: FrakMetadata ``` ### trackingEnabled ```swift let trackingEnabled: Bool ``` Whether tracking may run. `false` means no anonymous id is ever minted and no tracking request is issued; it is a hard floor that `FrakClient.setTrackingEnabled(_:)` cannot lift at runtime. Not a whole-SDK off switch: merchant config and reward resolution still run, since they carry no identifier for the user. Sharing does stop, since a share link is the anonymous id. Leave it `true` and drive consent through `FrakClient.setTrackingEnabled(_:)` instead unless you want a build that can never track. ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` Hashes the essential components of this value by feeding them into the given hasher. Implement this method to conform to the `Hashable` protocol. The components used for hashing must be the same as the components compared in your type's `==` operator implementation. Call `hasher.combine(_:)` with each of these components. - Important: In your implementation of `hash(into:)`, don't call `finalize()` on the `hasher` instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future. - Parameter hasher: The hasher to use when combining the components of this instance. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. ### ==(_:_:) ```swift static func == (lhs: FrakConfig, rhs: FrakConfig) -> Bool ``` Returns a Boolean value indicating whether two values are equal. Equality is the inverse of inequality. For any values `a` and `b`, `a == b` implies that `a != b` is `false`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakContext ```swift enum FrakContext ``` Who a share link came from, as carried in its `fCtx` query parameter. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Sharing/FrakContext.swift:2](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Sharing/FrakContext.swift#L2) ## Cases ### FrakContext.v1(wallet:) ```swift case v1(wallet: String) ``` ### FrakContext.v2(_:) ```swift case v2(FrakContext.V2) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakContext.V2 ```swift struct V2 ``` **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Sharing/FrakContext.swift:7](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Sharing/FrakContext.swift#L7) ## Initializers ### init(merchantId:timestamp:clientId:wallet:) ```swift init(merchantId: String, timestamp: Int64, clientId: String? = nil, wallet: String? = nil) ``` ## Properties ### clientId ```swift let clientId: String? ``` ### merchantId ```swift let merchantId: String ``` ### timestamp ```swift let timestamp: Int64 ``` ### wallet ```swift let wallet: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakCurrency ```swift enum FrakCurrency ``` **Conforms to** `Swift.CaseIterable`, `Swift.Decodable`, `Swift.Equatable`, `Swift.Hashable`, `Swift.RawRepresentable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakConfig.swift:3](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakConfig.swift#L3) ## Cases ### FrakCurrency.eur ```swift case eur ``` ### FrakCurrency.gbp ```swift case gbp ``` ### FrakCurrency.usd ```swift case usd ``` ## Initializers ### init(from:) ```swift init(from decoder: any Decoder) throws ``` Creates a new instance by decoding from the given decoder, when the type's `RawValue` is `String`. This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid. - Parameter decoder: The decoder to read data from. ### init(rawValue:) ```swift init?(rawValue: String) ``` Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance. ## Properties ### hashValue ```swift var hashValue: Int { get } ``` ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakEnvironment ```swift enum FrakEnvironment ``` **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakEnvironment.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakEnvironment.swift#L4) ## Cases ### FrakEnvironment.custom(wallet:backend:walletScheme:) ```swift case custom(wallet: String, backend: String, walletScheme: String) ``` ### FrakEnvironment.development ```swift case development ``` ### FrakEnvironment.production ```swift case production ``` ## Properties ### backend ```swift var backend: String { get } ``` ### wallet ```swift var wallet: String { get } ``` ### walletScheme ```swift var walletScheme: String { get } ``` ## Type methods ### custom(wallet:backend:) ```swift static func custom(wallet: String, backend: String) -> FrakEnvironment ``` Local backend serves self-signed HTTPS; needs an ATS exception on device. `walletScheme` defaults to Frak's own dev wallet, which is almost never right for a merchant's stub server: use `custom(wallet:backend:walletScheme:)` to override it. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakError ```swift enum FrakError ``` Every failure the SDK can hand back. **Conforms to** `Foundation.LocalizedError`, `Swift.Copyable`, `Swift.Error`, `Swift.Escapable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakError.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakError.swift#L4) ## Cases ### FrakError.alreadyPresenting ```swift case alreadyPresenting ``` A sharing sheet was presented while one was already up. ### FrakError.backingOff(retryAfterSeconds:) ```swift case backingOff(retryAfterSeconds: TimeInterval) ``` This resource is in a backoff window, so nothing was sent — unlike `network`, where a request was attempted. Any cached copy is served in preference to raising this. ### FrakError.decoding(message:) ```swift case decoding(message: String) ``` A 2xx response arrived but could not be read as the shape we expect. ### FrakError.internalFailure(message:) ```swift case internalFailure(message: String) ``` A failure inside the SDK: an unexpected error that escaped an internal boundary, or a device capability it needs and cannot get. Not `decoding`, which describes a backend body. ### FrakError.merchantResolutionFailed(reason:) ```swift case merchantResolutionFailed(reason: String) ``` No merchant could be identified for this app. ### FrakError.network(underlying:) ```swift case network(underlying: any Error) ``` The request never reached the backend, or the response never came back. ### FrakError.notInitialized ```swift case notInitialized ``` A client method was reached before `Frak.initialize(_:)`. ### FrakError.server(status:code:retryAfterSeconds:) ```swift case server(status: Int, code: String?, retryAfterSeconds: Int?) ``` The backend answered with a non-2xx status. ### FrakError.trackingDisabled ```swift case trackingDisabled ``` A tracking call was made while tracking is not permitted — either because this build ships `FrakConfig(trackingEnabled: false)` or because `FrakClient.setTrackingEnabled(false)` was called at runtime. Not raised by config or reward resolution, which are deliberately ungated. ## Properties ### errorDescription ```swift var errorDescription: String? { get } ``` A localized message describing what error occurred. ### failureReason ```swift var failureReason: String? { get } ``` A localized message describing the reason for the failure. ### helpAnchor ```swift var helpAnchor: String? { get } ``` A localized message providing "help" text if the user requests help. ### kind ```swift var kind: FrakError.Kind { get } ``` ### localizedDescription ```swift var localizedDescription: String { get } ``` Retrieve the localized description for this error. ### recoverySuggestion ```swift var recoverySuggestion: String? { get } ``` A localized message describing how one might recover from the failure. # FrakError.Kind ```swift enum Kind ``` Stable discriminator, one per case. A `switch` over ``Kind`` with a `default` survives a new case; an exhaustive `switch` over the error does not. Spelled identically on Android. **Conforms to** `Swift.CaseIterable`, `Swift.Equatable`, `Swift.Hashable`, `Swift.RawRepresentable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakError.swift:31](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakError.swift#L31) ## Cases ### FrakError.Kind.alreadyPresenting ```swift case alreadyPresenting ``` ### FrakError.Kind.backingOff ```swift case backingOff ``` ### FrakError.Kind.decoding ```swift case decoding ``` ### FrakError.Kind.internalFailure ```swift case internalFailure ``` ### FrakError.Kind.merchantResolutionFailed ```swift case merchantResolutionFailed ``` ### FrakError.Kind.network ```swift case network ``` ### FrakError.Kind.notInitialized ```swift case notInitialized ``` ### FrakError.Kind.server ```swift case server ``` ### FrakError.Kind.trackingDisabled ```swift case trackingDisabled ``` ## Initializers ### init(rawValue:) ```swift init?(rawValue: String) ``` Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance. ## Properties ### hashValue ```swift var hashValue: Int { get } ``` ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakLanguage ```swift enum FrakLanguage ``` **Conforms to** `Swift.CaseIterable`, `Swift.Decodable`, `Swift.Equatable`, `Swift.Hashable`, `Swift.RawRepresentable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakConfig.swift:9](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakConfig.swift#L9) ## Cases ### FrakLanguage.en ```swift case en ``` ### FrakLanguage.fr ```swift case fr ``` ## Initializers ### init(from:) ```swift init(from decoder: any Decoder) throws ``` Creates a new instance by decoding from the given decoder, when the type's `RawValue` is `String`. This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid. - Parameter decoder: The decoder to read data from. ### init(rawValue:) ```swift init?(rawValue: String) ``` Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance. ## Properties ### hashValue ```swift var hashValue: Int { get } ``` ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakLogLevel ```swift enum FrakLogLevel ``` **Conforms to** `Swift.Comparable`, `Swift.Equatable`, `Swift.Hashable`, `Swift.RawRepresentable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakConfig.swift:15](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakConfig.swift#L15) ## Cases ### FrakLogLevel.debug ```swift case debug ``` ### FrakLogLevel.error ```swift case error ``` ### FrakLogLevel.info ```swift case info ``` ### FrakLogLevel.none ```swift case none ``` ### FrakLogLevel.warn ```swift case warn ``` ## Initializers ### init(rawValue:) ```swift init?(rawValue: Int) ``` Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance. ## Properties ### hashValue ```swift var hashValue: Int { get } ``` ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. ### ...(_:_:) ```swift static func ... (minimum: Self, maximum: Self) -> ClosedRange ``` Returns a closed range that contains both of its bounds. Use the closed range operator (`...`) to create a closed range of any type that conforms to the `Comparable` protocol. This example creates a `ClosedRange` from "a" up to, and including, "z". let lowercase = "a"..."z" print(lowercase.contains("z")) // Prints "true" - Parameters: - minimum: The lower bound for the range. - maximum: The upper bound for the range. - Precondition: `minimum <= maximum`. ### ...(_:) ```swift static func ... (maximum: Self) -> PartialRangeThrough ``` Returns a partial range up to, and including, its upper bound. Use the prefix closed range operator (prefix `...`) to create a partial range of any type that conforms to the `Comparable` protocol. This example creates a `PartialRangeThrough` instance that includes any value less than or equal to `5.0`. let throughFive = ...5.0 throughFive.contains(4.0) // true throughFive.contains(5.0) // true throughFive.contains(6.0) // false You can use this type of partial range of a collection's indices to represent the range from the start of the collection up to, and including, the partial range's upper bound. let numbers = [10, 20, 30, 40, 50, 60, 70] print(numbers[...3]) // Prints "[10, 20, 30, 40]" - Parameter maximum: The upper bound for the range. - Precondition: `maximum` must compare equal to itself (i.e. cannot be NaN). ### ...(_:) ```swift static func ... (minimum: Self) -> PartialRangeFrom ``` Returns a partial range extending upward from a lower bound. Use the postfix range operator (postfix `...`) to create a partial range of any type that conforms to the `Comparable` protocol. This example creates a `PartialRangeFrom` instance that includes any value greater than or equal to `5.0`. let atLeastFive = 5.0... atLeastFive.contains(4.0) // false atLeastFive.contains(5.0) // true atLeastFive.contains(6.0) // true You can use this type of partial range of a collection's indices to represent the range from the partial range's lower bound up to the end of the collection. let numbers = [10, 20, 30, 40, 50, 60, 70] print(numbers[3...]) // Prints "[40, 50, 60, 70]" - Parameter minimum: The lower bound for the range. - Precondition: `minimum` must compare equal to itself (i.e. cannot be NaN). ### ..<(_:_:) ```swift static func ..< (minimum: Self, maximum: Self) -> Range ``` Returns a half-open range that contains its lower bound but not its upper bound. Use the half-open range operator (`..<`) to create a range of any type that conforms to the `Comparable` protocol. This example creates a `Range` from zero up to, but not including, 5.0. let lessThanFive = 0.0..<5.0 print(lessThanFive.contains(3.14)) // Prints "true" print(lessThanFive.contains(5.0)) // Prints "false" - Parameters: - minimum: The lower bound for the range. - maximum: The upper bound for the range. - Precondition: `minimum <= maximum`. ### ..<(_:) ```swift static func ..< (maximum: Self) -> PartialRangeUpTo ``` Returns a partial range up to, but not including, its upper bound. Use the prefix half-open range operator (prefix `..<`) to create a partial range of any type that conforms to the `Comparable` protocol. This example creates a `PartialRangeUpTo` instance that includes any value less than `5.0`. let upToFive = ..<5.0 upToFive.contains(3.14) // true upToFive.contains(6.28) // false upToFive.contains(5.0) // false You can use this type of partial range of a collection's indices to represent the range from the start of the collection up to, but not including, the partial range's upper bound. let numbers = [10, 20, 30, 40, 50, 60, 70] print(numbers[..<3]) // Prints "[10, 20, 30]" - Parameter maximum: The upper bound for the range. - Precondition: `maximum` must compare equal to itself (i.e. cannot be NaN). ### <(_:_:) ```swift static func < (lhs: FrakLogLevel, rhs: FrakLogLevel) -> Bool ``` Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument. This function is the only requirement of the `Comparable` protocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms to `Comparable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. ### <=(_:_:) ```swift static func <= (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument. This is the default implementation of the less-than-or-equal-to operator (`<=`) for any type that conforms to `Comparable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. ### >(_:_:) ```swift static func > (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument. This is the default implementation of the greater-than operator (`>`) for any type that conforms to `Comparable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. ### >=(_:_:) ```swift static func >= (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument. This is the default implementation of the greater-than-or-equal-to operator (`>=`) for any type that conforms to `Comparable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. - Returns: `true` if `lhs` is greater than or equal to `rhs`; otherwise, `false`. # FrakLogSink ```swift protocol FrakLogSink : Sendable ``` **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakLogger.swift:12](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakLogger.swift#L12) ## Methods ### log(level:message:error:) ```swift func log(level: FrakLogLevel, message: String, error: (any Error)?) throws ``` # FrakMetadata ```swift struct FrakMetadata ``` Static merchant-supplied facts about the app, fixed at build time. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/FrakConfig.swift:38](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/FrakConfig.swift#L38) ## Initializers ### init(name:currency:lang:logoURL:homepageLink:) ```swift init( name: String? = nil, currency: FrakCurrency = .eur, lang: FrakLanguage? = nil, logoURL: String? = nil, homepageLink: String? = nil ) ``` ## Properties ### currency ```swift let currency: FrakCurrency ``` ### homepageLink ```swift let homepageLink: String? ``` ### lang ```swift let lang: FrakLanguage? ``` ### logoURL ```swift let logoURL: String? ``` ### name ```swift let name: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakResolvedConfig ```swift struct FrakResolvedConfig ``` What the backend knows about this merchant, as resolved by `GET /user/merchant/resolve`. The whole tree is `public` because its actual reader, the sharing sheet, lives in the separate `FrakSDKUI` target. `css`, `productId` and `allowedDomains` are deliberately absent. Nothing here is `Decodable`, and adding it back is a one-way door: the conformance is public API. Decoding lives on private wire types in `ResolvedConfigDecoder.swift`. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:8](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L8) ## Initializers ### init(merchantId:name:domain:lang:currency:hidden:sdkConfig:) ```swift init( merchantId: String, name: String, domain: String, lang: FrakLanguage? = nil, currency: FrakCurrency? = nil, hidden: Bool = false, sdkConfig: ResolvedSdkConfig? = nil ) ``` ## Properties ### currency ```swift let currency: FrakCurrency? ``` Informational only — reward formatting always reads currency from `FrakMetadata`. ### displayLogoURL ```swift var displayLogoURL: String? { get } ``` Logo to show alongside ``displayName``, or nil when the backend has none on file. ### displayName ```swift var displayName: String { get } ``` Name to show a user: the `sdkConfig` override when the backend sent one, else ``name``. ### domain ```swift let domain: String ``` Merchant's canonical domain, not whatever domain was queried. ### hidden ```swift let hidden: Bool ``` Merchant asked to be hidden from the explorer. Rarely relevant natively. ### lang ```swift let lang: FrakLanguage? ``` ### merchantId ```swift let merchantId: String ``` Server-issued merchant UUID; the identity everything else is keyed by. ### name ```swift let name: String ``` ### sdkConfig ```swift let sdkConfig: ResolvedSdkConfig? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # Interaction ```swift struct Interaction ``` **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Tracking/Interaction.swift:3](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Tracking/Interaction.swift#L3) ## Type methods ### arrival(referrerWallet:referrerClientId:referrerMerchantId:referralTimestamp:) ```swift static func arrival( referrerWallet: String? = nil, referrerClientId: String? = nil, referrerMerchantId: String? = nil, referralTimestamp: Int64? = nil ) -> Interaction ``` ### custom(_:data:idempotencyKey:) ```swift static func custom( _ customType: String, data: [String : String] = [:], idempotencyKey: String? = nil ) -> Interaction ``` ### sharing(sharingTimestamp:purchaseId:) ```swift static func sharing(sharingTimestamp: Int64? = nil, purchaseId: String? = nil) -> Interaction ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # OpenAppResult ```swift enum OpenAppResult ``` **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/FrakClient.swift:102](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/FrakClient.swift#L102) ## Cases ### OpenAppResult.failed ```swift case failed ``` ### OpenAppResult.openedApp ```swift case openedApp ``` ### OpenAppResult.openedStore ```swift case openedStore ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # OpenInAppConfig ```swift struct OpenInAppConfig ``` Copy for the "open in app" prompt. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:156](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L156) ## Initializers ### init(text:) ```swift init(text: String? = nil) ``` ## Properties ### text ```swift let text: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # PercentEncoding ```swift enum PercentEncoding ``` Defined in: [Sources/FrakSDK/Net/PercentEncoding.swift:5](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Net/PercentEncoding.swift#L5) ## Type methods ### encode(_:) ```swift static func encode(_ value: String) -> String ``` # PostPurchaseConfig ```swift struct PostPurchaseConfig ``` Copy shown after a purchase, for both the referee and referrer. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:165](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L165) ## Initializers ### init(badgeText:refereeText:refereeNoRewardText:referrerText:referrerNoRewardText:ctaText:ctaNoRewardText:imageUrl:) ```swift init( badgeText: String? = nil, refereeText: String? = nil, refereeNoRewardText: String? = nil, referrerText: String? = nil, referrerNoRewardText: String? = nil, ctaText: String? = nil, ctaNoRewardText: String? = nil, imageUrl: String? = nil ) ``` ## Properties ### badgeText ```swift let badgeText: String? ``` ### ctaNoRewardText ```swift let ctaNoRewardText: String? ``` ### ctaText ```swift let ctaText: String? ``` ### imageUrl ```swift let imageUrl: String? ``` ### refereeNoRewardText ```swift let refereeNoRewardText: String? ``` ### refereeText ```swift let refereeText: String? ``` ### referrerNoRewardText ```swift let referrerNoRewardText: String? ``` ### referrerText ```swift let referrerText: String? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ProductDetails ```swift struct ProductDetails ``` The purchase line-item fields a campaign's `productScope` can target. Mirrors the backend's `PRODUCT_SCOPE_FIELDS` allowlist and `sdk/core`'s `ProductDetails` exactly (`sdk/core/src/types/product.ts`) — a field outside this set cannot have been published on a campaign, so adding one here without a matching backend change would be dead weight. `Double`, not `Int`, for every numeric: the wire type is a JSON number and the backend compares numerically; an `Int` would silently truncate a fractional `unitPrice`. Decoding lives on a private wire type in `RewardsDecoder.swift`: a synthesized `Decodable` throws on a present-but-wrong-typed value even for an `Optional` property, which would let one reshaped field inside `matchedProducts` take down the whole rewards response. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Core/ProductDetails.swift:16](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/ProductDetails.swift#L16) ## Initializers ### init(productId:sku:name:quantity:unitPrice:totalPrice:) ```swift init( productId: String? = nil, sku: String? = nil, name: String? = nil, quantity: Double? = nil, unitPrice: Double? = nil, totalPrice: Double? = nil ) ``` ## Properties ### name ```swift let name: String? ``` ### productId ```swift let productId: String? ``` ### quantity ```swift let quantity: Double? ``` ### sku ```swift let sku: String? ``` ### totalPrice ```swift let totalPrice: Double? ``` ### unitPrice ```swift let unitPrice: Double? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ResolvedComponents ```swift struct ResolvedComponents ``` Merchant-configured copy for each SDK-rendered component. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:107](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L107) ## Initializers ### init(buttonShare:buttonWallet:openInApp:postPurchase:banner:) ```swift init( buttonShare: ButtonShareConfig? = nil, buttonWallet: ButtonWalletConfig? = nil, openInApp: OpenInAppConfig? = nil, postPurchase: PostPurchaseConfig? = nil, banner: BannerConfig? = nil ) ``` ## Properties ### banner ```swift let banner: BannerConfig? ``` ### buttonShare ```swift let buttonShare: ButtonShareConfig? ``` ### buttonWallet ```swift let buttonWallet: ButtonWalletConfig? ``` ### openInApp ```swift let openInApp: OpenInAppConfig? ``` ### postPurchase ```swift let postPurchase: PostPurchaseConfig? ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ResolvedPlacement ```swift struct ResolvedPlacement ``` Copy and component overrides scoped to one placement, such as a product page. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:89](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L89) ## Initializers ### init(components:targetInteraction:translations:) ```swift init( components: ResolvedComponents? = nil, targetInteraction: String? = nil, translations: [String : String] = [:] ) ``` ## Properties ### components ```swift let components: ResolvedComponents? ``` ### targetInteraction ```swift let targetInteraction: String? ``` The interaction type this placement targets, e.g. `"purchase"`. ### translations ```swift let translations: [String : String] ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # ResolvedSdkConfig ```swift struct ResolvedSdkConfig ``` The `sdkConfig` block of a resolve response: merchant-configured copy overrides, translations, per-placement components and attribution defaults. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Config/FrakResolvedConfig.swift:48](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Config/FrakResolvedConfig.swift#L48) ## Initializers ### init(name:logoURL:homepageLink:currency:lang:hidden:translations:placements:components:attribution:) ```swift init( name: String? = nil, logoURL: String? = nil, homepageLink: String? = nil, currency: FrakCurrency? = nil, lang: FrakLanguage? = nil, hidden: Bool = false, translations: [String : String] = [:], placements: [String : ResolvedPlacement] = [:], components: ResolvedComponents? = nil, attribution: AttributionDefaults? = nil ) ``` ## Properties ### attribution ```swift let attribution: AttributionDefaults? ``` ### components ```swift let components: ResolvedComponents? ``` Merchant-global component copy, used when a placement does not override it. ### currency ```swift let currency: FrakCurrency? ``` ### hidden ```swift let hidden: Bool ``` ### homepageLink ```swift let homepageLink: String? ``` ### lang ```swift let lang: FrakLanguage? ``` ### logoURL ```swift let logoURL: String? ``` ### name ```swift let name: String? ``` ### placements ```swift let placements: [String : ResolvedPlacement] ``` Keyed by placement id. ### translations ```swift let translations: [String : String] ``` Overrides keyed by translation key (e.g. `"sharing.title"`). ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # RewardAudience ```swift enum RewardAudience ``` Who a reward is estimated for: the sharer (`.referrer`) or the person arriving through the link (`.referee`). **Conforms to** `Swift.CaseIterable`, `Swift.Equatable`, `Swift.Hashable`, `Swift.RawRepresentable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/Rewards.swift:135](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/Rewards.swift#L135) ## Cases ### RewardAudience.referee ```swift case referee ``` ### RewardAudience.referrer ```swift case referrer ``` ## Initializers ### init(rawValue:) ```swift init?(rawValue: String) ``` Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance. ## Properties ### hashValue ```swift var hashValue: Int { get } ``` ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # RewardRequest ```swift struct RewardRequest ``` What to look a reward up for. One value rather than a parameter list so the two SDKs read the same on the hottest path: Android has to group these (a Kotlin default argument is a binary break), and a request that grows a field grows it in one place on both. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/RewardRequest.swift:6](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/RewardRequest.swift#L6) ## Initializers ### init(targetInteraction:audience:products:) ```swift init( targetInteraction: String? = nil, audience: RewardAudience? = nil, products: [ProductDetails] = [] ) ``` ## Properties ### audience ```swift var audience: RewardAudience? ``` Referrer or referee. `nil` ranks both. ### products ```swift var products: [ProductDetails] ``` Products currently in view, when known. Advisory: a campaign scoped to none of them is ranked below one matching at least one. ### targetInteraction ```swift var targetInteraction: String? ``` Which interaction the reward is for, e.g. `purchase`. Free-form; a typo silently never matches. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # RewardsAPI ```swift struct RewardsAPI ``` Campaigns and reward selection. Obtained from `FrakClient.rewards`. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/RewardsAPI.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/RewardsAPI.swift#L4) ## Methods ### best(_:forceRefresh:) ```swift func best( _ request: RewardRequest = RewardRequest(), forceRefresh: Bool = false ) async throws -> BestReward? ``` The best reward worth advertising for `request`, formatted server-side. One call answers for the whole set it describes and cannot say which item earned it, so a listing screen calls this once for every visible product rather than once per row. - Parameters: - request: what to look the reward up for; `products` is advisory ranking context. - forceRefresh: skips the cache and the backoff. - Returns: nil when nothing matches. - Throws: `FrakError` when the lookup itself fails. ### campaigns(forceRefresh:) ```swift func campaigns(forceRefresh: Bool = false) async throws -> [Campaign] ``` Active campaigns for this merchant, highest priority first. # RewardTier ```swift enum RewardTier ``` One band of a tiered reward. `maxValue` is absent on an open-ended top tier rather than set to a sentinel, so nil genuinely means "no upper bound". **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/Rewards.swift:24](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/Rewards.swift#L24) ## Cases ### RewardTier.amount(minValue:maxValue:amount:) ```swift case amount(minValue: Double, maxValue: Double?, amount: TokenAmount) ``` ### RewardTier.percentage(minValue:maxValue:percent:) ```swift case percentage(minValue: Double, maxValue: Double?, percent: Double) ``` ### RewardTier.unknown(minValue:maxValue:) ```swift case unknown(minValue: Double, maxValue: Double?) ``` A tier shape this binary does not know, so one unrecognised band cannot fail the whole reward. The twin of `EstimatedReward.unknown`; the bounds are what every tier carries. ## Properties ### maxValue ```swift var maxValue: Double? { get } ``` ### minValue ```swift var minValue: Double { get } ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # SharingAPI ```swift struct SharingAPI ``` Share link construction. Obtained from `FrakClient.sharing`. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/SharingAPI.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/SharingAPI.swift#L4) ## Methods ### buildLink(_:) ```swift func buildLink(_ request: SharingRequest) async throws -> String? ``` Builds a share link for `request`. Returns nil only when there is nothing to link to: the request carried no link, none of its products did, and neither the resolved config nor `FrakMetadata.homepageLink` supplies one. That is answerable without a network round trip, so it is an absence rather than a failure. - Throws: `FrakError` when a link could have been built but could not be: tracking is disabled, the device refused key material, or no merchant could be resolved. # SharingProduct ```swift struct SharingProduct ``` One product card on the sharing page. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Sharing/SharingRequest.swift:33](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Sharing/SharingRequest.swift#L33) ## Initializers ### init(title:link:imageURL:utmContent:details:) ```swift init( title: String, link: String, imageURL: String? = nil, utmContent: String? = nil, details: ProductDetails? = nil ) ``` ## Properties ### details ```swift let details: ProductDetails? ``` Scope fields a campaign's `productScope` can target. Composed rather than flattened so `bestReward(products:)` can take scope-only products with no `title` at all. ### imageURL ```swift let imageURL: String? ``` ### link ```swift let link: String ``` ### title ```swift let title: String ``` ### utmContent ```swift let utmContent: String? ``` Highest-priority source for `utm_content`. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # SharingRequest ```swift struct SharingRequest ``` What to share, and how to attribute it. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Sharing/SharingRequest.swift:59](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Sharing/SharingRequest.swift#L59) ## Initializers ### init(link:products:attribution:targetInteraction:placement:logoURL:shareTitle:shareText:shareImageURL:) ```swift init( link: String? = nil, products: [SharingProduct] = [], attribution: AttributionParams? = nil, targetInteraction: String? = nil, placement: String? = nil, logoURL: String? = nil, shareTitle: String? = nil, shareText: String? = nil, shareImageURL: String? = nil ) ``` ## Properties ### attribution ```swift let attribution: AttributionParams? ``` ### link ```swift let link: String? ``` Base URL to build the link from. Falls back to the first product's link, then the merchant's homepage. ### logoURL ```swift let logoURL: String? ``` ### placement ```swift let placement: String? ``` Where in the app the share was offered, e.g. `product-page`. ### products ```swift let products: [SharingProduct] ``` ### shareImageURL ```swift let shareImageURL: String? ``` ### shareText ```swift let shareText: String? ``` ### shareTitle ```swift let shareTitle: String? ``` Per-call overrides for the OS share sheet's title/body/preview image; highest precedence. ### targetInteraction ```swift let targetInteraction: String? ``` Narrows the seeded reward to campaigns with this trigger, e.g. `purchase`. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # TokenAmount ```swift struct TokenAmount ``` A reward amount in raw token units and in each fiat currency the backend prices. Fiat fields are `0` when unpriced, not when the reward is worthless — prefer `BestReward.formatted`. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDK/Rewards/Rewards.swift:5](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Rewards/Rewards.swift#L5) ## Properties ### amount ```swift let amount: Double ``` Raw token units. Non-zero even when every fiat field is zero. ### eurAmount ```swift let eurAmount: Double ``` ### gbpAmount ```swift let gbpAmount: Double ``` ### usdAmount ```swift let usdAmount: Double ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # TrackingAPI ```swift struct TrackingAPI ``` Interaction and purchase tracking. Obtained from `FrakClient.tracking`. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDK/TrackingAPI.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/TrackingAPI.swift#L4) ## Methods ### purchase(customerId:orderId:token:) ```swift @discardableResult func purchase( customerId: String, orderId: String, token: String ) async -> Result ``` ### track(_:) ```swift @discardableResult func track(_ interaction: Interaction) async -> Result ``` Succeeds once durable, not once delivered. # FrakSDKUI ## Types | Name | Summary | |---|---| | [FrakInstallPresentation](/developers/references/ios/fraksdkui/frakinstallpresentation/) | Which StoreKit surface offers the wallet install from the sheet's install step. | | [FrakSharing](/developers/references/ios/fraksdkui/fraksharing/) | The Frak sharing sheet for a UIKit app. | | [FrakSharingConfiguration](/developers/references/ios/fraksdkui/fraksharingconfiguration/) | How the sharing sheet is presented, as opposed to what it shares. | | [FrakSharingDefaults](/developers/references/ios/fraksdkui/fraksharingdefaults/) | Tunable defaults for `FrakSharingConfiguration`. | | [SharingResult](/developers/references/ios/fraksdkui/sharingresult/) | How a sharing sheet ended. | ## Extensions | Name | Contents | |---|---| | [extension View](/developers/references/ios/fraksdkui/view/) | 1 member(s) | # FrakInstallPresentation ```swift enum FrakInstallPresentation ``` Which StoreKit surface offers the wallet install from the sheet's install step. Neither carries App Store attribution: `campaignToken`, `providerToken` and `customProductPageIdentifier` all resolve inside the presented app's own App Store Connect account, which is the wallet's, never the merchant's. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDKUI/FrakSharingConfiguration.swift:45](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/FrakSharingConfiguration.swift#L45) ## Cases ### FrakInstallPresentation.overlay(_:) ```swift case overlay(FrakInstallPresentation.Overlay) ``` A banner attached to the window scene. It installs in place and does not cover the sheet, at the cost of no styling control and no report of whether it drew. ### FrakInstallPresentation.storeProductPage ```swift case storeProductPage ``` A modal store page over the sheet. The user comes back to the sheet when it closes. ## Type properties ### overlay ```swift static var overlay: FrakInstallPresentation { get } ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakInstallPresentation.Overlay ```swift struct Overlay ``` Where the banner sits on the merchant's own screen. A struct rather than a bare associated value so a later knob is additive: adding a defaulted property cannot break a caller, adding a case parameter can. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDKUI/FrakSharingConfiguration.swift:59](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/FrakSharingConfiguration.swift#L59) ## Initializers ### init(position:) ```swift init(position: FrakInstallPresentation.Overlay.Position = .bottom) ``` ## Properties ### position ```swift var position: FrakInstallPresentation.Overlay.Position ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakInstallPresentation.Overlay.Position ```swift enum Position ``` Mirrors `SKOverlay.Position`, which does not exist on Mac Catalyst. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDKUI/FrakSharingConfiguration.swift:61](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/FrakSharingConfiguration.swift#L61) ## Cases ### FrakInstallPresentation.Overlay.Position.bottom ```swift case bottom ``` ### FrakInstallPresentation.Overlay.Position.bottomRaised ```swift case bottomRaised ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakSharing ```swift @MainActor final class FrakSharing ``` The Frak sharing sheet for a UIKit app. Build it once per screen, ``warm()`` it when a share affordance becomes visible, then ``present(_:)`` on the tap. SwiftUI apps use `View.frakSharingSheet(isPresented:request:)`; both drive one `SharingPresenter`. Hold the instance for as long as the screen lives: releasing it takes the warm web view. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDKUI/FrakSharing.swift:12](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/FrakSharing.swift#L12) ## Initializers ### init(presentingFrom:configuration:onResult:) ```swift @MainActor init( presentingFrom host: UIViewController, configuration: FrakSharingConfiguration = FrakSharingConfiguration(), onResult: @escaping FrakSharing.ResultHandler = { _ in } ) ``` - Parameters: - host: the view controller the sheet is presented from. Held weakly; the sheet stops working once it goes away, which is the same lifetime a screen-scoped instance wants. - configuration: sheet height and which store surface the install step raises. - onResult: called once per presentation with the most significant outcome. ## Methods ### present(_:) ```swift @MainActor func present(_ request: SharingRequest) ``` Presents the sheet for `request`. A second call while a sheet is up is a no-op. ### warm() ```swift @MainActor func warm() ``` Starts warming the pooled web view and the identity/config reads. Call when a share affordance becomes visible; cheap to call repeatedly, and ``present(_:)`` implies it. ## Other members ### FrakSharing.ResultHandler ```swift typealias ResultHandler = @MainActor @Sendable (SharingResult) -> Void ``` How a sharing session ended. Called once per ``present(_:)``, on the main actor. # FrakSharingConfiguration ```swift struct FrakSharingConfiguration ``` How the sharing sheet is presented, as opposed to what it shares. **Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable` Defined in: [Sources/FrakSDKUI/FrakSharingConfiguration.swift:5](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/FrakSharingConfiguration.swift#L5) ## Initializers ### init(heightFraction:install:detectInstall:language:) ```swift init( heightFraction: CGFloat = FrakSharingDefaults.heightFraction, install: FrakInstallPresentation = FrakSharingDefaults.install, detectInstall: Bool = FrakSharingDefaults.detectInstall, language: String? = nil ) ``` ## Properties ### detectInstall ```swift var detectInstall: Bool ``` Whether the sheet notices the wallet becoming installable while its store surface is up and hands off deterministically, instead of falling back to the install code. iOS-only. ### heightFraction ```swift var heightFraction: CGFloat ``` Fraction of the screen height the sheet occupies, clamped to `0.3...1.0`. ### install ```swift var install: FrakInstallPresentation ``` How the wallet's App Store listing is raised when the user asks to install it. ### language ```swift var language: String? ``` Language of the sheet's contents as a BCP-47 tag (`"en"`, `"fr-CA"`); `nil` uses the device locale. The page falls back to its own default for a tag it has no translation for, so this selects among what the page ships rather than adding a language. ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # FrakSharingDefaults ```swift enum FrakSharingDefaults ``` Tunable defaults for `FrakSharingConfiguration`. `heightFraction` is mirrored on the other platform; keep both in step. `install` is iOS-only. Defined in: [Sources/FrakSDKUI/SharingSheetLogic.swift:577](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/SharingSheetLogic.swift#L577) ## Type properties ### detectInstall ```swift static let detectInstall: Bool ``` Follows the opt-in `isFrakAppInstalled()` already requires; see `FrakSharingConfiguration`. ### heightFraction ```swift static let heightFraction: CGFloat ``` ### install ```swift static let install: FrakInstallPresentation ``` The store page, not the overlay: it reports whether it drew, it can be styled through a custom product page, and it hands the sheet back when the user closes it. # SharingResult ```swift enum SharingResult ``` How a sharing sheet ended. **Conforms to** `Swift.Sendable` Defined in: [Sources/FrakSDKUI/SharingResult.swift:4](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/SharingResult.swift#L4) ## Cases ### SharingResult.copied(link:) ```swift case copied(link: String) ``` ### SharingResult.dismissed ```swift case dismissed ``` ### SharingResult.failed(_:) ```swift case failed(FrakError) ``` ### SharingResult.installStarted ```swift case installStarted ``` The user asked to install and the sheet took them to the wallet's install page (or, with no identity to hand it, to the store). Informational only — do not call `openFrakApp()` in response; the sheet owns the step from here. Does not mean anything installed. ### SharingResult.shared(link:) ```swift case shared(link: String) ``` ### SharingResult.walletOpened ```swift case walletOpened ``` `openFrakApp()` answered `.openedApp` — an install this SDK observed and handed off, not a claim the backend has linked it. A merchant who needs "linked" reads that from the backend. ## Properties ### kind ```swift var kind: SharingResult.Kind { get } ``` # SharingResult.Kind ```swift enum Kind ``` Stable discriminator, one per case. A `switch` over ``Kind`` with a `default` survives a new case; an exhaustive `switch` over the result does not. Spelled identically on Android. **Conforms to** `Swift.CaseIterable`, `Swift.Equatable`, `Swift.Hashable`, `Swift.RawRepresentable`, `Swift.Sendable` Defined in: [Sources/FrakSDKUI/SharingResult.swift:19](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/SharingResult.swift#L19) ## Cases ### SharingResult.Kind.copied ```swift case copied ``` ### SharingResult.Kind.dismissed ```swift case dismissed ``` ### SharingResult.Kind.failed ```swift case failed ``` ### SharingResult.Kind.installStarted ```swift case installStarted ``` ### SharingResult.Kind.shared ```swift case shared ``` ### SharingResult.Kind.walletOpened ```swift case walletOpened ``` ## Initializers ### init(rawValue:) ```swift init?(rawValue: String) ``` Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance. ## Properties ### hashValue ```swift var hashValue: Int { get } ``` ## Methods ### hash(into:) ```swift func hash(into hasher: inout Hasher) ``` ## Operators ### !=(_:_:) ```swift static func != (lhs: Self, rhs: Self) -> Bool ``` Returns a Boolean value indicating whether two values are not equal. Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`. This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`. - Parameters: - lhs: A value to compare. - rhs: Another value to compare. # extension View ```swift extension View ``` Adds the members below to `SwiftUICore.View`. Defined in: [Sources/FrakSDKUI/FrakSharingSheet.swift:5](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDKUI/FrakSharingSheet.swift#L5) ## Methods ### frakSharingSheet(isPresented:request:configuration:onResult:) ```swift @MainActor func frakSharingSheet( isPresented: Binding, request: SharingRequest, configuration: FrakSharingConfiguration = FrakSharingConfiguration(), onResult: @escaping (SharingResult) -> Void = { _ in } ) -> some View ``` Presents the Frak sharing sheet while `isPresented` is true. Hoist onto a screen-level view, not a list row: attaching this modifier always warms a pooled `WKWebView`, so one per row is one engine per row. - Parameters: - isPresented: whether the sheet is up. - request: what to share. - configuration: sheet height and which store surface the install step raises. - onResult: called once per presentation with the most significant outcome. - Returns: `content` wrapped with the sheet's presentation, warm-up and teardown. # FrakConfigProvider > **FrakConfigProvider**(`parameters`): `FunctionComponentElement`\<`ProviderProps`\<`FrakWalletSdkConfig` \| `undefined`\>\> Defined in: react/src/provider/FrakConfigProvider.ts:39 Simple config provider for the Frak Wallet SDK Should be wrapped within a @tanstack/react-query!QueryClientProvider \| \`QueryClientProvider\` ## Parameters ### parameters `PropsWithChildren`\<[`FrakConfigProviderProps`](/developers/references/react-sdk/type-aliases/frakconfigproviderprops/)\> ## Returns `FunctionComponentElement`\<`ProviderProps`\<`FrakWalletSdkConfig` \| `undefined`\>\> # FrakIFrameClientProvider > **FrakIFrameClientProvider**(`args`): `FunctionComponentElement`\<`FragmentProps`\> Defined in: react/src/provider/FrakIFrameClientProvider.ts:50 IFrame client provider for the Frak Wallet SDK It will automatically create the frak wallet iFrame (required for the wallet to communicate with the SDK securely), and provide it in the context ## Parameters ### args #### children? `ReactNode` Descedant components that will have access to the Frak Client #### style? `CSSProperties` Some custom styles to apply to the iFrame ## Returns `FunctionComponentElement`\<`FragmentProps`\> ## Remarks This provider must be wrapped within a [FrakConfigProvider](/developers/references/react-sdk/functions/frakconfigprovider/) to work properly # useDisplayModal > **useDisplayModal**\<`T`\>(`args?`): `UseMutationResult`\<`ModalRpcStepsResultType`\<`T`\>, `FrakRpcError`\<`undefined`\>, `DisplayModalParamsType`\<`T`\> & \{ `placement?`: `string`; \}, `unknown`\> Defined in: react/src/hook/useDisplayModal.ts:51 Hook that return a mutation helping to display a modal to the user It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`displayModal()\`](/developers/references/core-sdk/actions/functions/displaymodal/) action ## Type Parameters ### T `T` *extends* `ModalStepTypes`[] = `ModalStepTypes`[] The modal steps types to display (the result will correspond to the steps types asked in params) An array of [\`ModalStepTypes\`](/developers/references/core-sdk/index/type-aliases/modalsteptypes/) If not provided, it will default to a generic array of `ModalStepTypes` ## Parameters ### args? Optional config object with `mutations` for customizing the underlying @tanstack/react-query!useMutation \| \`useMutation()\` #### mutations? `MutationOptions`\<`T`\> Optional mutation options, see @tanstack/react-query!useMutation \| \`useMutation()\` for more infos ## Returns `UseMutationResult`\<`ModalRpcStepsResultType`\<`T`\>, `FrakRpcError`\<`undefined`\>, `DisplayModalParamsType`\<`T`\> & \{ `placement?`: `string`; \}, `unknown`\> The mutation hook wrapping the `displayModal()` action The `mutate` and `mutateAsync` argument is of type [\`DisplayModalParamsType\\`](/developers/references/core-sdk/index/type-aliases/displaymodalparamstype/), with type params `T` being the modal steps types to display The `data` result is a [\`ModalRpcStepsResultType\`](/developers/references/core-sdk/index/type-aliases/modalrpcstepsresulttype/) ## See - [\`displayModal()\`](/developers/references/core-sdk/actions/functions/displaymodal/) for more info about the underlying action - @tanstack/react-query!useMutation \| \`useMutation()\` for more info about the mutation options and response # useDisplaySharingPage > **useDisplaySharingPage**(`args?`): `UseMutationResult`\<`DisplaySharingPageResultType`, `FrakRpcError`\<`undefined`\>, `DisplaySharingPageParamsType` & \{ `placement?`: `string`; \}, `unknown`\> Defined in: react/src/hook/useDisplaySharingPage.ts:45 Hook that return a mutation helping to display a sharing page to the user It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`displaySharingPage()\`](/developers/references/core-sdk/actions/functions/displaysharingpage/) action ## Parameters ### args? Optional config object with `mutations` for customizing the underlying @tanstack/react-query!useMutation \| \`useMutation()\` #### mutations? `MutationOptions` Optional mutation options, see @tanstack/react-query!useMutation \| \`useMutation()\` for more infos ## Returns `UseMutationResult`\<`DisplaySharingPageResultType`, `FrakRpcError`\<`undefined`\>, `DisplaySharingPageParamsType` & \{ `placement?`: `string`; \}, `unknown`\> The mutation hook wrapping the `displaySharingPage()` action The `mutate` and `mutateAsync` argument is of type [\`DisplaySharingPageParamsType\`](/developers/references/core-sdk/index/type-aliases/displaysharingpageparamstype/) with optional `placement` The `data` result is a [\`DisplaySharingPageResultType\`](/developers/references/core-sdk/index/type-aliases/displaysharingpageresulttype/) ## See - [\`displaySharingPage()\`](/developers/references/core-sdk/actions/functions/displaysharingpage/) for more info about the underlying action - @tanstack/react-query!useMutation \| \`useMutation()\` for more info about the mutation options and response # useFrakClient > **useFrakClient**(): `FrakClient` \| `undefined` Defined in: react/src/hook/useFrakClient.ts:9 Get the current Frak client ## Returns `FrakClient` \| `undefined` # useFrakConfig > **useFrakConfig**(): `FrakWalletSdkConfig` Defined in: react/src/hook/useFrakConfig.ts:13 Get the current Frak config ## Returns `FrakWalletSdkConfig` ## Throws if the config is not found (only if this hooks is used outside a FrakConfigProvider) ## See - [FrakConfigProvider](/developers/references/react-sdk/functions/frakconfigprovider/) for the config provider - [FrakWalletSdkConfig](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/) for the config type # useGetMerchantInformation > **useGetMerchantInformation**(`args?`): `UseQueryResult`\<`NoInfer`\<`GetMerchantInformationReturnType`\>, `FrakRpcError`\<`undefined`\>\> Defined in: react/src/hook/useGetMerchantInformation.ts:45 Hook that return a query helping to get the current merchant information It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`getMerchantInformation()\`](/developers/references/core-sdk/actions/functions/getmerchantinformation/) action ## Parameters ### args? Optional config object with `query` for customizing the underlying @tanstack/react-query!useQuery \| \`useQuery()\` #### cacheTime? `number` Time in ms to cache the result at the core SDK level. Default: 30_000 (30s). Set to 0 to disable. #### query? `QueryOptions` Optional query options, see @tanstack/react-query!useQuery \| \`useQuery()\` for more infos ## Returns `UseQueryResult`\<`NoInfer`\<`GetMerchantInformationReturnType`\>, `FrakRpcError`\<`undefined`\>\> The query hook wrapping the `getMerchantInformation()` action The `data` result is a [\`GetMerchantInformationReturnType\`](/developers/references/core-sdk/index/type-aliases/getmerchantinformationreturntype/) ## See - [\`getMerchantInformation()\`](/developers/references/core-sdk/actions/functions/getmerchantinformation/) for more info about the underlying action - @tanstack/react-query!useQuery \| \`useQuery()\` for more info about the useQuery options and response # useGetMergeToken > **useGetMergeToken**(`args?`): `UseQueryResult`\<`string` \| `null`, `FrakRpcError`\<`undefined`\>\> Defined in: react/src/hook/useGetMergeToken.ts:43 Hook that return a query to fetch a merge token for the current anonymous identity Used by in-app browser redirect flows to preserve identity when switching from a WebView to the system browser. It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`getMergeToken()\`](/developers/references/core-sdk/actions/functions/getmergetoken/) action ## Parameters ### args? Optional config object with `query` for customizing the underlying @tanstack/react-query!useQuery \| \`useQuery()\` #### cacheTime? `number` Time in ms to cache the result at the core SDK level. Default: 30_000 (30s). Set to 0 to disable. #### query? `QueryOptions` Optional query options, see @tanstack/react-query!useQuery \| \`useQuery()\` for more infos ## Returns `UseQueryResult`\<`string` \| `null`, `FrakRpcError`\<`undefined`\>\> The query hook wrapping the `getMergeToken()` action The `data` result is a `string | null` ## See - [\`getMergeToken()\`](/developers/references/core-sdk/actions/functions/getmergetoken/) for more info about the underlying action - @tanstack/react-query!useQuery \| \`useQuery()\` for more info about the useQuery options and response # useGetUserReferralStatus > **useGetUserReferralStatus**(`args?`): `UseQueryResult`\<`NoInfer`\<`UserReferralStatusType` \| `null`\>, `FrakRpcError`\<`undefined`\>\> Defined in: react/src/hook/useGetUserReferralStatus.ts:47 Hook that return a query to fetch the current user's referral status on the current merchant Returns `null` when the user's identity cannot be resolved. It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`getUserReferralStatus()\`](/developers/references/core-sdk/actions/functions/getuserreferralstatus/) action ## Parameters ### args? Optional config object with `query` for customizing the underlying @tanstack/react-query!useQuery \| \`useQuery()\` #### cacheTime? `number` Time in ms to cache the result at the core SDK level. Default: 30_000 (30s). Set to 0 to disable. #### query? `QueryOptions` Optional query options, see @tanstack/react-query!useQuery \| \`useQuery()\` for more infos ## Returns `UseQueryResult`\<`NoInfer`\<`UserReferralStatusType` \| `null`\>, `FrakRpcError`\<`undefined`\>\> The query hook wrapping the `getUserReferralStatus()` action The `data` result is a [\`UserReferralStatusType\`](/developers/references/core-sdk/index/type-aliases/userreferralstatustype/) or `null` ## See - [\`getUserReferralStatus()\`](/developers/references/core-sdk/actions/functions/getuserreferralstatus/) for more info about the underlying action - @tanstack/react-query!useQuery \| \`useQuery()\` for more info about the useQuery options and response # useOpenSso > **useOpenSso**(`args?`): `UseMutationResult`\<`OpenSsoReturnType`, `FrakRpcError`\<`undefined`\>, `OpenSsoArgsType`, `unknown`\> Defined in: react/src/hook/useOpenSso.ts:40 Hook that return a mutation helping to open the SSO page It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`openSso()\`](/developers/references/core-sdk/actions/functions/opensso/) action ## Parameters ### args? Optional config object with `mutations` for customizing the underlying @tanstack/react-query!useMutation \| \`useMutation()\` #### mutations? `MutationOptions` Optional mutation options, see @tanstack/react-query!useMutation \| \`useMutation()\` for more infos ## Returns `UseMutationResult`\<`OpenSsoReturnType`, `FrakRpcError`\<`undefined`\>, `OpenSsoArgsType`, `unknown`\> The mutation hook wrapping the `openSso()` action The `mutate` and `mutateAsync` argument is of type [\`OpenSsoArgsType\`](/developers/references/core-sdk/index/type-aliases/openssoargstype/): either the full SSO params, or `{ ssoUrl }` from [\`usePrepareSsoUrl()\`](/developers/references/react-sdk/functions/usepreparessourl/) to open the popup without awaiting anything first. The mutation doesn't output any value ## See - [\`openSso()\`](/developers/references/core-sdk/actions/functions/opensso/) for more info about the underlying action - @tanstack/react-query!useMutation \| \`useMutation()\` for more info about the mutation options and response # usePrepareSso > **usePrepareSso**(`params`): `UseQueryResult`\<`NoInfer`\<`PrepareSsoReturnType`\>, `Error`\> Defined in: react/src/hook/usePrepareSso.ts:43 Hook that generates SSO URL for popup flow This is a **synchronous** hook (no async calls) that generates the SSO URL client-side without communicating with the wallet iframe. ## Parameters ### params `PrepareSsoParamsType` SSO parameters for URL generation ## Returns `UseQueryResult`\<`NoInfer`\<`PrepareSsoReturnType`\>, `Error`\> Object containing: - `ssoUrl`: Generated SSO URL (or undefined if client not ready) - `isReady`: Boolean indicating if URL is available ## Example ```tsx function MyComponent() { const { data } = usePrepareSso({ metadata: { logoUrl: "..." }, directExit: true }); const handleClick = () => { if (ssoUrl) { window.open(data?.ssoUrl, "_blank"); } }; return ; } ``` ## See - [\`prepareSso()\`](/developers/references/core-sdk/actions/functions/preparesso/) for the underlying action - [\`openSso()\`](/developers/references/core-sdk/actions/functions/opensso/) for the recommended high-level API # usePrepareSsoUrl > **usePrepareSsoUrl**(`params`): `UseQueryResult`\<`NoInfer`\<`PrepareSsoReturnType`\>, `Error`\> Defined in: react/src/hook/usePrepareSsoUrl.ts:45 Hook that builds the SSO popup URL ahead of the user's click. Wraps [\`prepareSsoUrl()\`](/developers/references/core-sdk/actions/functions/preparessourl/) in a @tanstack/react-query!useQuery \| \`useQuery()\`, so the URL is resolved while the page is idle. Handing the result to `useOpenSso()` as `{ ssoUrl }` lets the popup open in the same tick as the click, which is what keeps popup blockers out of the flow. ## Parameters ### params `PrepareSsoParamsType` SSO parameters for URL generation ## Returns `UseQueryResult`\<`NoInfer`\<`PrepareSsoReturnType`\>, `Error`\> The query wrapping the `prepareSsoUrl()` action, resolving to `{ ssoUrl }` ## Example ```tsx const { data } = usePrepareSsoUrl({ metadata }); const { mutate: openSso } = useOpenSso(); ``` ## Remarks The URL embeds a proof-of-possession valid for 10 minutes. Past that the SSO still opens and the user still logs in — only the anonymous-to-wallet identity link is lost. On a page that can sit open for a long time, refetch rather than holding one URL indefinitely. ## See - [\`prepareSsoUrl()\`](/developers/references/core-sdk/actions/functions/preparessourl/) for the underlying action - [\`useOpenSso()\`](/developers/references/react-sdk/functions/useopensso/) for opening the prepared URL # useReferralInteraction > **useReferralInteraction**(`args?`): `Error` \| `"idle"` \| `"processing"` \| `"success"` \| `"no-referrer"` \| `"self-referral"` Defined in: react/src/hook/helper/useReferralInteraction.ts:26 Helper hook to automatically submit a referral interaction when detected Runs once when the Frak client becomes available. ## Parameters ### args? #### options? `ProcessReferralOptions` Some options for the referral interaction ## Returns `Error` \| `"idle"` \| `"processing"` \| `"success"` \| `"no-referrer"` \| `"self-referral"` The resulting referral state, or a potential error ## Description This function will automatically handle the referral interaction process ## See [\`referralInteraction()\`](/developers/references/core-sdk/actions/functions/referralinteraction/) for more details on the automatic referral handling process # useSendTransactionAction > **useSendTransactionAction**(`args?`): `UseMutationResult`\<\{ `hash`: `` `0x${string}` ``; \}, `FrakRpcError`\<`undefined`\>, \{ `metadata?`: `ModalRpcMetadata`; `tx`: `SendTransactionTxType` \| `SendTransactionTxType`[]; \}, `unknown`\> Defined in: react/src/hook/useSendTransaction.ts:45 Hook that return a mutation helping to send a transaction It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`sendTransaction()\`](/developers/references/core-sdk/actions/functions/sendtransaction/) action ## Parameters ### args? Optional config object with `mutations` for customizing the underlying @tanstack/react-query!useMutation \| \`useMutation()\` #### mutations? `MutationOptions` Optional mutation options, see @tanstack/react-query!useMutation \| \`useMutation()\` for more infos ## Returns `UseMutationResult`\<\{ `hash`: `` `0x${string}` ``; \}, `FrakRpcError`\<`undefined`\>, \{ `metadata?`: `ModalRpcMetadata`; `tx`: `SendTransactionTxType` \| `SendTransactionTxType`[]; \}, `unknown`\> The mutation hook wrapping the `sendTransaction()` action The `mutate` and `mutateAsync` argument is of type [\`SendTransactionParams\`](/developers/references/core-sdk/actions/type-aliases/sendtransactionparams/) The `data` result is a [\`SendTransactionReturnType\`](/developers/references/core-sdk/index/type-aliases/sendtransactionreturntype/) ## See - [\`sendTransaction()\`](/developers/references/core-sdk/actions/functions/sendtransaction/) for more info about the underlying action - @tanstack/react-query!useMutation \| \`useMutation()\` for more info about the mutation options and response # useSetupReferral > **useSetupReferral**(): `UseQueryResult`\<`null`, `Error`\> Defined in: react/src/hook/useSetupReferral.ts:20 Hook that automatically processes referral context and emits a DOM event on success Runs once when the Frak client becomes available. Fire-and-forget — the referral result is tracked via a `"frak:referral-success"` DOM event on `window`, not via the returned query data. ## Returns `UseQueryResult`\<`null`, `Error`\> The query handle (data is not meaningful — listen for `REFERRAL_SUCCESS_EVENT` on `window` instead) ## See - [\`setupReferral()\`](/developers/references/core-sdk/actions/functions/setupreferral/) for more info about the underlying action - [\`REFERRAL\_SUCCESS\_EVENT\`](/developers/references/core-sdk/actions/variables/referral_success_event/) for the event name constant # useSiweAuthenticate > **useSiweAuthenticate**(`args?`): `UseMutationResult`\<\{ `message`: `string`; `signature`: `` `0x${string}` ``; \}, `FrakRpcError`\<`undefined`\>, \{ `metadata?`: `ModalRpcMetadata`; `siwe?`: `Partial`\<`SiweAuthenticationParams`\>; \}, `unknown`\> Defined in: react/src/hook/useSiweAuthenticate.ts:45 Hook that return a mutation helping to send perform a SIWE authentication It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`siweAuthenticate()\`](/developers/references/core-sdk/actions/functions/siweauthenticate/) action ## Parameters ### args? `UseSiweAuthenticateParams` = `{}` Optional config object with `mutations` for customizing the underlying @tanstack/react-query!useMutation \| \`useMutation()\` ## Returns `UseMutationResult`\<\{ `message`: `string`; `signature`: `` `0x${string}` ``; \}, `FrakRpcError`\<`undefined`\>, \{ `metadata?`: `ModalRpcMetadata`; `siwe?`: `Partial`\<`SiweAuthenticationParams`\>; \}, `unknown`\> The mutation hook wrapping the `siweAuthenticate()` action The `mutate` and `mutateAsync` argument is of type [\`SiweAuthenticateModalParams\`](/developers/references/core-sdk/actions/type-aliases/siweauthenticatemodalparams/) The `data` result is a [\`SiweAuthenticateReturnType\`](/developers/references/core-sdk/index/type-aliases/siweauthenticatereturntype/) ## See - [\`siweAuthenticate()\`](/developers/references/core-sdk/actions/functions/siweauthenticate/) for more info about the underlying action - @tanstack/react-query!useMutation \| \`useMutation()\` for more info about the mutation options and response # useWalletStatus > **useWalletStatus**(): `UseQueryResult`\<`NoInfer`\<`WalletStatusReturnType`\>, `Error`\> Defined in: react/src/hook/useWalletStatus.ts:22 Hook that return a query helping to get the current wallet status. It's a @tanstack/react-query!home \| \`tanstack\` wrapper around the [\`watchWalletStatus()\`](/developers/references/core-sdk/actions/functions/watchwalletstatus/) action ## Returns `UseQueryResult`\<`NoInfer`\<`WalletStatusReturnType`\>, `Error`\> The query hook wrapping the `watchWalletStatus()` action The `data` result is a [\`WalletStatusReturnType\`](/developers/references/core-sdk/index/type-aliases/walletstatusreturntype/) ## See - [\`watchWalletStatus()\`](/developers/references/core-sdk/actions/functions/watchwalletstatus/) for more info about the underlying action - @tanstack/react-query!useQuery \| \`useQuery()\` for more info about the useQuery response # FrakConfigProviderProps > **FrakConfigProviderProps** = \{ `config`: `FrakWalletSdkConfig`; \} Defined in: react/src/provider/FrakConfigProvider.ts:22 Props to instantiate the Frak Wallet SDK configuration provider ## Properties ### config > **config**: `FrakWalletSdkConfig` Defined in: react/src/provider/FrakConfigProvider.ts:27 The wanted Frak configuration #### See [FrakWalletSdkConfig](/developers/references/core-sdk/index/type-aliases/frakwalletsdkconfig/) # FrakIFrameClientProps > **FrakIFrameClientProps** = \{ `config`: `FrakWalletSdkConfig`; \} Defined in: react/src/provider/FrakIFrameClientProvider.ts:33 Props to instantiate the Frak Wallet SDK configuration provider ## Properties ### config > **config**: `FrakWalletSdkConfig` Defined in: react/src/provider/FrakIFrameClientProvider.ts:34 # Documentation ## Packages - @frak-labs/components - @frak-labs/core-sdk - @frak-labs/react-sdk # How does it work? > How the frak wallet work under the hood? # How does it work? In this section, we will go through the different technologies and smart contracts used by the Frak Wallet, and how they are working together. ## Knowledge base Before deep diving into the Frak Wallet, it is important to understand a few blockchain technologies. ### Account Abstraction The frak wallet is using the [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) standard, which is a standard for account abstraction on EVM blockchain. If you are not familiar with this standard, here is a few great resources to get started: - [Awesome account abstraction](https://github.com/4337Mafia/awesome-account-abstraction) - [Stackup intro to account abstraction](https://docs.stackup.sh/docs/account-abstraction) - The EIP itself: [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) A few key takeaways from the account abstraction standard: - It permit to execute transaction without having to pay for the gas fees directly - It can be used with any type of validation (password, biometric, etc.) ### WebAuthN Then, the Frak wallet is using the [WebAuthN](https://w3c.github.io/webauthn/) standard for the authentication and the signing of the transactions. If you are not familiar with this standard, here is a few great resources to get started: - [Awesome WebAuthN](https://github.com/herrjemand/awesome-webauthn) - [Detailed WebAuthN demo by Auth0](https://webauthn.me/) - [WebAuthN demo by Matthew Miller](https://webauthn.io/) - [WebAuthN official documentation](https://w3c.github.io/webauthn/) - [WebAuthN on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API) A few key takeaways from the WebAuthN standard: - It's a standard for **passwordless** authentication - It's a standard for **secure message signing** - The authentication is bounded to a **specific domain**. ### P-256 Signature WebAuthN rely on the [secp256r1](https://neuromancer.sk/std/secg/secp256r1) signature algorithm (or in short *P-256*) to sign the transaction. This signature curve isn't supported on EVM chains by default. The [RIP-7212](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md) provides native support of this curve on rollup chains and is now live on several L2s including Base, Optimism, Arbitrum, and others. For chains that don't yet support this precompile, we fall back to the [FreshCryptoLib](https://github.com/rdubois-crypto/FreshCryptoLib) to verify the signature in Solidity. ## SmartWallet side In this section we will go through the smart contract related to the Smart wallet side of the Frak Wallet. We are using the [Kernel Smart Wallet](https://github.com/zerodevapp/kernel) by the [ZeroDev](https://zerodev.app/) team for core logic of the Smart Wallet. It's audited, battle tested, and has a lot of features that we can leverage (for example the [ERC-7579](https://erc7579.com/) support) Since kernel wallet support modular validation, we are mainly using two type of validator for the Frak Wallet: 1. The main one being the [FCL WebAuthN validator](https://github.com/zerodevapp/kernel/blob/dev/src/validator/webauthn/WebAuthnFclValidator.sol), a custom validator developed by us, using the [FreshCryptoLib](https://github.com/rdubois-crypto/FreshCryptoLib) to verify P-256 signatures on chains that don't yet support the RIP-7212 precompile (and using the native precompile where available). 2. The second one being the [ECDSAValidator](https://github.com/zerodevapp/kernel/blob/dev/src/validator/ECDSAValidator.sol), for users that set up recovery options. They can set up an EOA as a recovery wallet, enabling an ECDSAValidator. This permits them to execute transactions via either the WebAuthN validator or the ECDSA one. On the infrastructure side, we are using the [Pimlico bundler](https://www.pimlico.io/) to manage the smart wallet transactions and data fetching. Transaction gas fees are sponsored by Frak for standard SDK interactions. The paymaster handles gas sponsorship automatically through the Pimlico infrastructure. ## Communication side Since the WebAuthN standard is bounded to a specific domain, we use two principal ways of communication: 1. An **iFrame**, for bidirectional communication between the Frak Wallet and the implementing website. This is the primary communication channel used for all SDK actions (modals, the sharing page, interactions, wallet status, etc.). 2. **URL-based redirection**, used specifically for SSO flows where the user needs to authenticate on the Frak Wallet domain. Working this way, with a **client first** approach, provides us a few key benefits: - We are not relying on third-party cookies - We don't rely on a centralised server to manage the communication, so you don't have to trust us with up-time, server provisioning, db going down or anything. - Your app can communicate with the client storage, even if the client is offline (so you can still fetch wallet address, transaction history etc. even if the client is offline) - All the frak related storage is stored on the client storage, in a secure way, and is only accessible by the frak wallet and allowed dApps. :::note On the centralisation side, yeah you are not relying on a centralised server, but you are relying on the frak website, **how is that different?** Firstly, the website hosting the Frak wallet is a PWA, meaning that user can install it on their devices (if compatible), and enjoy it everytime (even if our website come down for whatever reason). Secondly, it's all open source, meaning that you can easily redeploy it on your own infrastructure if you want to. ::: ### iFrame communication The iFrame communication side isn't that complex really. We are basically using an iFrame with a two-way communication (using regular `window.addEventListener('message', handler)`). The init flow is as follows: 1. The dApp create an iFrame with the right URL (can be built using an SDK helper or react component directly) 2. When the iFrame is loaded, it should be loaded on the **Frak query listener** page: no UI, just handling incoming message requests. 3. Once the frak query listener is loaded, and have warmed up a few key storage slots, it will send a `ready` message to the dApp. 4. Once the dApp receive the `ready` message, it can start sending message to the Frak Wallet, and receive message from it. On top of the classical postMessage communication, we added some abstraction around all of that, helping to have: - a `createIFrameFrakClient` method, that will build a `transport` (similar to [Viem transports](https://viem.sh/docs/clients/intro.html)) used for the communication - The `IFrameTransport` can handle every data types specified in the `IFrameRpcSchema`, - To query data via that transport directly, you can either: - Use the `request` method, returning a Promise of the expected `ReturnType` of the given request - Use the `listenerRequest` method, and passing a `callback` args, that will be invoked with the expected `ReturnType` of the given request, and every time the `ReturnType` change. Under the hood, both `request` and `listenerRequest` are using a small abstraction around `postMessage`, building a notification system, and a request/response system, on both sides. ### SSO redirect flow For SSO (Single Sign-On) authentication, the SDK uses a redirect-based flow: 1. The SDK builds a URL with compressed SSO parameters using `prepareSso` / `openSso` 2. The user is redirected to the Frak Wallet SSO page 3. The Frak Wallet handles authentication and creates the session 4. The user is redirected back to the dApp, and the SDK picks up the compressed SSO result from the URL ### Cross-origin WebAuthn Cross-origin WebAuthN via iFrame is an evolving w3c standard (see [this discussion](https://github.com/w3c/webauthn/issues/1656) for background). Browser support is tracked at: - [Chromium](https://issues.chromium.org/issues/40258856) - [Mozilla](https://github.com/mozilla/standards-positions/issues/964) - [WebKit](https://github.com/WebKit/standards-positions/issues/304) ### Communication security Since sensitive data can be shared between the dApp and the Frak Wallet, we built a secured communication layer. For data exchanged via URL (SSO params, referral context), the SDK uses: 1. JSON serialization of the message payload 2. A **sha256** validation hash of the primordial message keys (varies by message type) 3. Base64url encoding of the data + validation hash for URL-safe transport 4. On the receiving side, the data is decoded and the validation hash is verified against the payload For iFrame communication, the `postMessage` transport includes origin checks to ensure messages are only accepted from the expected Frak Wallet domain. :::note The hash validation mechanism is used for both iFrame communication and URL-based data exchange. ::: ## Transaction side Now, how does the transaction process work exactly? We won't enter in depth with the account abstraction way of working, since it's a bit out of the scope of this documentation, and samewise for the WebAuthN signing standard. Here is the flow when a user want to execute a transaction: 1. Build the transaction data 2. Prepare a `userOperation` bundle 3. Sign the `userOperation.hash` via the current webAuthN validator 4. Send the `userOperation` to the pimlico bundler, and receive the `userOpHash` 5. Wait for the `userOpHash` to be bundled in a transaction, and then wait for the `txHash` to be executed # Welcome to Frak > Turn your customers into advocates. Set up Frak on your store in about 5 minutes. No technical skills required for most platforms. import { LinkCard, Steps } from '@astrojs/starlight/components'; # Welcome to Frak Frak rewards your customers for sharing your store with friends, and rewards their friends for buying. It's word-of-mouth marketing that runs itself, and you only pay out when a real sale happens. Getting started takes about **5 minutes**. Pick the path that matches your store: ## What you'll set up 1. **Connect your store.** Link your shop to Frak so we can recognize your customers and the friends they refer. 2. **Add a share button.** Let customers share your products, and earn when their friends buy. 3. **Fund your rewards.** Add a budget by card. Rewards leave your balance only on real, confirmed purchases. ## You're in good hands - **No code for most stores.** Shopify, WordPress, and PrestaShop all have ready-made apps. - **You only pay for results.** Rewards are paid out only when a sale is confirmed. - **You stay in control.** Adjust your budget, rewards, and where buttons appear at any time. New to some of the words we use? The [glossary](/guides/glossary/) explains them in a minute. # Best practices > Simple ways to get more shares and more sales from Frak. Where to place prompts, how to set rewards, and how to keep momentum. import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components'; # Best practices Frak works best when customers are nudged to share at the right moment, with a reward worth talking about. None of this is complicated. Here's what makes the biggest difference. ## Ask at the moment of excitement The single best place to ask for a share is **right after checkout**, when your customer is happiest. Lead with the post-purchase card, then add the others: - **Post-purchase card**: shown straight after an order. This converts best, so set it up first. - **Share button on product pages**: lets customers share something specific they love. - **Welcome banner**: greets visitors who arrive from a friend's link, so they feel recognized. ## Bring in your existing customers Your email list is full of people who already like you. Drop your **newsletter sharing link** into a campaign email: one click opens your store with the sharing window ready and your rewards pre-filled. It's the fastest way to kick off a campaign on day one. ## Set rewards worth sharing - **Reward both sides.** A little reward for the friend who buys makes the link far more clickable. Frak suggests an **80/20 split** in the ambassador's favor, one tap to apply. - **Make it meaningful.** A reward big enough to mention ("get €6") travels further than a token amount. - **Match the reward to the goal.** Reward purchases for sales, sign-ups for leads. Pick the one goal that matters most for this campaign. ## Keep the momentum going - **Stay funded.** Campaigns pause when the budget runs dry. Keep a buffer so sharing never stops mid-stream. [Add funds](/guides/dashboard/configure/funds/). - **Re-engage your members.** Send an occasional [push notification](/guides/campaigns/push/) to announce a new campaign or product. The customers who already shared are your best ambassadors. - **Get discovered.** List your brand in the **Frak Explorer** so app users can find and share you. [Customize your listing](/guides/dashboard/configure/explorer/). ## Watch what works Open [Track performance](/guides/campaigns/performance/) to see which campaigns and placements drive the most shares and sales, then double down on the winners. # Create a campaign > Set up a Frak campaign in a short guided wizard. Choose your goal, budget, and rewards, then publish and go live. import { Steps, Aside, CardGrid, LinkCard } from '@astrojs/starlight/components'; # Create a campaign A campaign decides what your customers earn for sharing your store, and what action pays out. Setup is a short guided wizard, and you can **Save as draft** at any point and come back later. ## The wizard, step by step 1. **Campaign basics.** Give the campaign a title (only you see it) and pick the **merchant** it belongs to. You can keep your store's default reward currency, which is recommended, or choose another. 2. **Goal.** Pick the one action that triggers rewards: - **Sales**: reward purchases. The most popular choice for shops. - **Traffic**: reward visits to your site or app. - **Registration**: reward sign-ups and qualified leads. 3. **Territory & categories.** Choose the countries where your campaign runs. (Special advertising categories like credit or housing aren't supported yet, so you can move on.) 4. **Budget & schedule.** Set how much to spend and when. Pick a budget **period** (one global pot, or daily, weekly, monthly) and a **cap**. Then choose to start immediately, on a date, or over a fixed window. With no end date, the campaign simply runs until the budget is used up. 5. **Reward setup.** Decide how much customers earn and how it's calculated: - **Fixed amount**: the same reward per sale. - **% of basket**: the reward scales with order value. - **Tiered**: bigger baskets earn bigger rewards. You split the reward between the **ambassador** (your customer who shares) and the **referee** (the friend who buys). Frak suggests an 80/20 split in the ambassador's favor, one tap with **Apply reco**. 6. **Review & publish.** The last screen shows everything read-only so you can check it over. When it looks right, click **Publish**. ## You published, what happens next Your campaign goes live right away, and the Frak ambassador community gets a notification that you've launched, so sharing can start immediately. For the best results, give people somewhere to share from: # Track performance > See how your campaigns are doing in plain numbers: shares, sales, your real cost per result, and how it compares to paid ads. import { Aside, LinkCard } from '@astrojs/starlight/components'; # Track performance Once a campaign is live, the **Campaigns** area shows exactly how it's doing: who's sharing, what's selling, and what each result actually costs you. No spreadsheets, it updates on its own. ## The big picture The **Data overview** opens with the numbers that matter most: - **Ambassadors**: customers who shared your store. - **Shares**: how many times your store was shared. - **Generated revenue**: sales that came from those shares. - **Sharing rate**: how many people who saw the prompt actually shared. - **Avg. CPA**: your average cost per result. Below that you'll find a **sharing funnel** (from "share prompt seen" all the way to "converted"), **purchases generated** over time, a **projected revenue** trend, where shares come from (site vs the Frak app, mobile vs desktop), and your **top campaigns**. ## Your campaign list The **List** shows every campaign with its **status** (Active, Paused, Draft, Ended, or Archived) and key figures side by side: sharing rate, rewards paid, click-through rate, revenue, and budget spent. From the menu on each row you can **open performance**, **view parameters**, **edit**, **pause**, **resume**, **archive**, or **delete**. You can also select several at once to pause or archive them together. ## Inside a single campaign Open a campaign for the full story, organized in three tabs: - **Funnel & ROI**: the conversion funnel plus your return on investment. - **Ambassadors**: who's driving results, with a **top ambassadors** leaderboard (shares, sales, revenue, and what they earned). - **Configuration**: the campaign's settings, read-only. You'll also see a **cost breakdown** (how each reward splits between the ambassador, the referee, and Frak) and headline stats like the share of active ambassadors and how many referred friends converted. ## Export your data Need the raw numbers for your own reports? Use **Export** to download them. # Send push notifications > Reach the customers who joined your store with a push notification on their phone. Pick your audience, write your message, and send. import { Steps, Aside } from '@astrojs/starlight/components'; # Send push notifications Push notifications let you reach your **members**, the customers who joined by sharing your store, with a message straight to their phone. They're great for bringing people back: a new campaign, a fresh drop, or a seasonal nudge. ## Write and send 1. **Name it.** Give the notification an internal name (like "Summer reactivation"). Only you see this, your members never do. 2. **Write your message.** Add a **title** and a **message**. You can include an optional **image** and a **launch URL**, the page that opens when someone taps the notification. A live **preview** shows how it'll look. 3. **Choose your audience.** Pick which members should receive it. The dashboard shows how many people you'll reach as you adjust the selection. 4. **Pick when to send.** Choose **Send immediately**. (Scheduling for later is coming soon.) 5. **Review and send.** Check the audience and timing on the review screen, then **Send notification**. # What your customers see > A look at the customer side of Frak. How someone shares your store, how their friend buys, and how both get rewarded. import { Steps, Aside, CardGrid, LinkCard } from '@astrojs/starlight/components'; # What your customers see Here's the experience you're giving your customers, from the first share to money in the bank. Frak is word-of-mouth: your happy customers share your store with friends, the friends buy, and both sides earn a reward. No coupons to manage, no crypto knowledge needed on either side. There are two people in every story: - The **ambassador**: your customer, the one who shares. - Their **friend** (the referee): the one who clicks and buys. ## The journey, start to finish Say your campaign pays **€10 per sale**, split **€6 to the ambassador, €2 to the friend** (Frak keeps €2). 1. **Sarah buys from your store.** Right after checkout she sees a friendly card: "Share with a friend and you both earn." She taps it. 2. **Sarah shares her link.** Frak creates a personal link for her and she sends it to Tom on WhatsApp. 3. **Tom clicks and buys.** He lands on your store, sees he'll get a little reward too, and places a €50 order. 4. **You confirm the sale, both get paid.** Once the order is confirmed, **Sarah earns €6** and **Tom earns €2**, straight into their Frak wallet. 5. **Sarah gets a notification and comes back.** "You earned €6." So she shares again with the next friend. 6. **Tom collects his €2, and joins in.** He installs the Frak app, watches his reward land, and sees how simple it was. Now he shares your store with his own friends, and the loop starts over with him. Every friend who buys can become the next person sharing. That flywheel, share, buy, reward, repeat, is the whole point, and you only ever pay when a real sale happens. ## The free wallet, in plain terms Rewards land in a **Frak wallet**, which lives in the **Frak app**. Your customers don't need to know anything about crypto, and there's nothing scary here: - **Created in about 10 seconds.** No forms, no paperwork. - **Secured by Face ID or fingerprint.** No password to remember. - **Email is only used to recover the account.** Never for spam. - **Available on the App Store and Google Play.** A quick install means customers can reach and withdraw their money fast. ## How they get their money Customers always see exactly where a reward stands: - **Awaiting validation**: the reward is reserved while the order is being confirmed. - **To collect**: the sale is confirmed and the money is theirs. - **Cancelled**: if the order is refunded or cancelled, the reward is voided too, so you never pay for a sale that didn't stick. Once a reward is theirs, it lands **right in their Frak app**. From there they can **withdraw it straight to their bank account**, with no extra steps and nothing for you to handle. ## Where customers discover you Most sharing happens right on your store, through the buttons and cards you place. Customers can also find you in the **Frak Explorer**, a directory inside the Frak app where people browse brands worth sharing. Listing there is optional and free. ## Make it happen on your store # The business dashboard > Your home for everything Frak outside Shopify. Register your site, fund rewards, launch campaigns, and track results. import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components'; # The business dashboard The [business dashboard](https://business.frak.id/) is where you set up and run Frak. You register your site, fund your rewards, launch campaigns, and watch how they perform, all in one place. ## What you can do ## Finding your way around Once you open a merchant, the dashboard is organized into a few simple areas: - **My Merchants**: all your stores. Pick one to manage it, or add a new one. - **Campaigns**: create campaigns and follow their results, including a **Data overview** of everything at a glance. - **Members**: the customers who joined by sharing your store. Filter them and reach out. - **Push**: send a push notification to your members. - **Wallet**: your reward budget and payouts. - **Settings**: your account preferences, like language and currency. ## A typical first run # Merchant settings > Update your store's name and currency, allow extra domains, grab your newsletter sharing link, and check purchase tracking. import { Aside, LinkCard } from '@astrojs/starlight/components'; # Merchant settings Everything about your store lives under **Edit** for your merchant: its name and currency, the domains allowed to use it, a ready-made link for your newsletter, and the status of purchase tracking. ## Store details Update your **merchant name** and **default reward currency** any time. Your domain is shown here too. Click **Edit**, make your change, then **Save**. ## Allowed domains If your store runs on more than one address, add the extras under **Allowed domains** so Frak recognizes them all. A common case is a Shopify store that also uses its `myshopify.com` address. Type the domain (like `mystore.myshopify.com`), click **Add domain**, and save. Remove one any time with **Remove**. ## Newsletter sharing link Want to invite your existing customers to share? Copy your **newsletter sharing link** and drop it into any marketing email. When a customer clicks it, your storefront opens with the Frak sharing window ready, pre-filled with your current rewards, so they can share and earn in one tap. ## Purchase tracking The **Purchase tracker** shows whether Frak is receiving orders from your store, which is what lets campaigns reward real sales. You'll see the connection status, the platform in use, and when the last purchase came in. For most stores this is set up automatically by your platform app: # Customize appearance > Match Frak to your brand. Set your name, logo, and wording, and choose how your store appears in the Frak Explorer. import { Aside, LinkCard } from '@astrojs/starlight/components'; # Customize appearance Everything customers see from Frak can match your brand: the name and logo on the share button, the wording on each component, and how your store shows up in the Frak Explorer. You'll find it all under **Customize** for your merchant. ## Your brand identity These defaults apply everywhere Frak appears on your store: - **Name**: your brand name, shown to visitors. - **Logo**: displayed next to your name. - **Homepage link**: where visitors go when they click your name. - **Currency**: how reward amounts are shown. Leave on **Auto** to match the visitor. - **Language**: the language of Frak's text. **Auto** detects it from the visitor's browser. There's also a **Frak SDK displayed** switch. Turn it off to hide Frak from your storefront completely, without uninstalling anything. ## Wording for each component You can tailor the text on each Frak component to your voice: - **Share button**: the button label, with a version for when no reward applies. - **Banner**: the welcome message for referred visitors. - **Post-purchase card**: the prompt shown right after checkout. Pick the wording that fits your brand, preview it, and save. ## Appear in the Frak Explorer The **Frak Explorer** is where app users discover stores worth sharing. Listing your brand there is optional and free. - **Listed in Explorer**: turn your listing on or off. - **Hero image**: the main banner on your Explorer page (you can add a few more as a slider). - **Logo** and **Description**: a short, compelling pitch for why people should share you. # Add funds > Top up your reward budget so your campaigns can pay out. Add funds by card through Stripe, and turn payouts on or off any time. import { Aside, Steps } from '@astrojs/starlight/components'; # Add funds Your **reward budget** is the pot your campaigns pay rewards from. You top it up by card, and Frak only spends it when a real, confirmed sale happens. Nothing goes out until you fund it and switch payouts on. ## Set up your budget The first time, click **Set Up Budget**. This creates the budget your campaigns draw from. You only do it once per merchant. ## Add funds 1. Click **Add funds**. 2. Enter the amount and pay by card. **Stripe** handles the payment securely, so Frak never sees your card details. 3. Your new balance appears under **Reward Budget** once the payment clears. ## Turn payouts on or off A **Distributing Rewards** toggle controls whether active campaigns can pay out: - **On**: rewards are sent automatically as customers refer and buy. - **Off**: payouts pause. Your campaigns and balance stay exactly as they are, nothing is lost. ## Get money back Need to pull unused funds back? Turn **Distributing Rewards** off, then use **Withdraw funds**. Your available balance returns to your wallet. Rewards already promised to customers stay reserved, so you only ever withdraw what's truly free. # Team & roles > Invite teammates to help manage your store on Frak, and remove them when needed. All by Frak wallet address. import { Aside, Steps } from '@astrojs/starlight/components'; # Team & roles You can invite teammates to help run your store on Frak. Everyone is added by their Frak wallet address, and changes are confirmed with your fingerprint or face unlock, so only you can edit the team. ## The two roles - **Owner**: the account that registered the store. Full control, including the team and budget. - **Admin**: a trusted teammate who can manage the day-to-day, such as campaigns, funds, and appearance. That's the whole model. There's nothing complicated to assign. ## Add a teammate 1. Click **Add Team Member**. 2. Paste their **Frak wallet address** (it starts with `0x`). They can find it on their [Frak wallet settings page](https://wallet.frak.id/settings). 3. Click **Add member**, then **Save all changes** and confirm with your fingerprint or face unlock. ## Remove a teammate Click **Remove member** next to their name, then **Save all changes** and confirm. Changed your mind before saving? Use **Undo remove**. # Register your site > Add your site to Frak in a short two-step form. Enter your details, verify your domain with one DNS record, and confirm. import { Tabs, TabItem, Aside, CardGrid, LinkCard } from '@astrojs/starlight/components'; # Register your site Adding your site to Frak is a short, two-step form. You enter a few details, prove the site is yours with one DNS record, and confirm. It takes a few minutes, and you only do it once. ## Add your details In the [business dashboard](https://business.frak.id/), start a new site. On the **Add merchant details** screen, fill in: - **Merchant Name**: your store or brand name. This is what customers see. - **Currency**: the currency your rewards are paid in. Most merchants keep the default (**EURe**). - **Domain Name**: your website address, like `example.com`. - **Setup Code**: optional. Leave it blank unless Frak gave you one. ## Verify your domain This proves the site is yours, so no one else can claim it. As soon as you enter your domain, Frak shows a **DNS TXT record**. Copy it, add it at your domain provider, and you're verified. Pick your provider for the exact clicks: 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your domain. 2. In the sidebar, open **DNS → Records**. 3. Click **Add record**. 4. Set **Type** to **TXT**, **Name** to `@`, and paste the record into **Content**. 5. Leave **TTL** on **Auto** and click **Save**. Cloudflare usually applies TXT records within minutes. 1. Log in to the [OVHcloud Control Panel](https://www.ovh.com/manager/) and open **Web Cloud → Domain names**. 2. Select your domain, then open the **DNS zone** tab. 3. Click **Add an entry** and choose **TXT**. 4. Leave **Sub-domain** empty (for your root domain) and paste the record into the **Value** field. 5. Click **Next**, then **Confirm**. OVHcloud publishes the record after a short delay. 1. Log in to the [Infomaniak Manager](https://manager.infomaniak.com) and open **Domain names**. 2. Select your domain and open the **DNS zone**. 3. Click **Add a record** and choose **TXT**. 4. Leave the **Source** empty or set it to `@`, then paste the record into the **Target** field. 5. Click **Save** to apply your changes. 1. Sign in to GoDaddy and open **My Products**. 2. Next to your domain, select **DNS** (or **Manage DNS**). 3. In the **Records** section, click **Add** and choose **TXT**. 4. Set **Name** to `@` and paste the record into **Value**; leave **TTL** on the default. 5. Click **Save**. 1. Sign in to Namecheap and open **Domain List**, then **Manage** next to your domain. 2. Open the **Advanced DNS** tab. 3. Click **Add New Record** and choose **TXT Record**. 4. Set **Host** to `@` and paste the record into **Value**; leave **TTL** on **Automatic**. 5. Click the green check to save the record. 1. Sign in to your domain provider, usually where you bought the domain or host your site. 2. Find the DNS area. It may be called **DNS management**, **DNS zone**, **Advanced DNS**, or **Name server management**. 3. Add a new record with **Type** set to **TXT**. 4. Put `@` (or the host shown by Frak) in the **Name / Host** field, and paste the record into the **Value** field. 5. Save your changes. If you can't find the DNS settings, contact your provider's support. When the record is in, click **Continue**. Frak checks it for you. ## Confirm and register On the **Merchant registration** screen, review the **Summary** (your name, domain, and currency). When it looks right, click **Complete Registration** and approve with your fingerprint or face unlock. No password to remember. That's it, usually in under a minute. Your site is registered and ready. ## You're registered, what's next ## If something looks off - **"A merchant already exists for this domain."** Your site is already registered, possibly under another account. Reach out from the [business dashboard](https://business.frak.id/) if that's unexpected. - **"The DNS TXT record is not set."** The record isn't visible yet. Double-check you pasted the exact value at your provider, then wait a few minutes and click **Continue** again. # Common questions > Quick answers to the questions merchants ask most about Frak. Crypto, costs, refunds, control, and privacy. import { Aside, LinkCard } from '@astrojs/starlight/components'; # Common questions Short, straight answers to what merchants ask most before going live. ## Your customers **Do my customers need crypto, or a wallet, to take part?** No. They create a free Frak wallet in about 10 seconds with Face ID or a fingerprint, no crypto knowledge, no jargon, no money up front. See [what your customers see](/guides/customer-journey/). **Is this really my customers, or strangers?** It's your real customers and the friends they personally invite. That's warm, trusted word-of-mouth, not cold ads. **Can customers actually cash out their rewards?** Yes. They can transfer their earnings to their bank account from the wallet whenever they like. ## Costs and payments **How much does Frak cost?** Frak takes a **20% commission** on your campaign budget. The other 80% goes to your customers as rewards. You only pay on real, confirmed sales. **When are rewards actually paid?** Only when a sale is confirmed. Until then the reward is held as "awaiting validation", so nothing leaves your budget for an order that isn't final. **What happens if an order is refunded?** The matching reward is cancelled automatically. You never pay for a sale that didn't stick. **Can I control my spending?** Yes. Set a budget cap (overall, or daily, weekly, monthly), pause a campaign any time, or switch reward payouts off entirely. [Add funds](/guides/dashboard/configure/funds/). **Which currencies can I use?** EUR, USD, or GBP via Monerium, or USDC via Circle. Most merchants keep the default (EURe). ## Setup and privacy **Do I need to write code?** Not for Shopify, WordPress, or PrestaShop, they all have ready-made apps. A fully custom site needs a little setup. [Pick your platform](/guides/). **How long does setup take?** About 5 minutes for most stores: install, connect, fund, and launch. **Is my customers' data safe?** Yes. A customer's email is only ever used to recover their wallet, never for unsolicited messages. # Glossary > The handful of words Frak uses, explained in plain language. # Glossary A quick guide to the words you'll see across Frak. Most of them describe everyday ideas: a store, a customer who shares, the friend who buys. ## Merchant Your store on Frak: a website or domain where you run campaigns. You can manage several merchants from one account. [Register your site](/guides/dashboard/register/). ## Ambassador A customer who shares your store with friends. When their share leads to a sale (or another action you chose), they earn a reward. Ambassadors are sometimes called referrers. ## Referee The friend who arrives through an ambassador's link and buys. Referees can earn a reward too, which is a great reason to click. ## Campaign A set of rules for what customers earn and what triggers it. You choose a goal (sales, traffic, or registrations), a budget, and the rewards. [Create a campaign](/guides/campaigns/create/). ## Reward budget The pot your campaigns pay rewards from. You top it up by card, and Frak only spends it on real, confirmed actions. [Add funds](/guides/dashboard/configure/funds/). ## Reward model How a reward is calculated: a **fixed amount**, a **percentage of the basket**, or **tiered** (bigger baskets earn more). You set this when you create a campaign. ## CPA (cost per action) What you pay for one confirmed result, like a sale. Frak shows your average CPA so you can see your real cost, and how it compares to paid ads. ## Members The customers who joined by sharing your store. You can filter them into groups and reach out. [Send push notifications](/guides/campaigns/push/). ## Push notification A short message you can send to your members' phones, for example to announce a new campaign or product. ## Explorer A directory in the Frak app where users discover stores worth sharing. Listing your brand there is optional. [Customize how you appear](/guides/dashboard/configure/explorer/). ## Wallet A free Frak account, secured by fingerprint or face unlock instead of a password. You use one to manage your store, and your customers use one to collect their rewards. ## Domain verification A one-time check that proves a domain is yours, done by adding a small DNS record. It's part of registering your site. [How it works](/guides/dashboard/register/). # Get started on WordPress, PrestaShop, a custom site or app > Three simple steps, register your site, install Frak, and set up your rewards from the business dashboard. import { Steps, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Get started on WordPress, PrestaShop, a custom site or app Not on Shopify? No problem. For WordPress, PrestaShop, custom-built sites, and native mobile apps, setup is **three short steps**: register your site, install Frak, and set up your rewards. Most of it happens in your [business dashboard](https://business.frak.id/), the home for everything outside Shopify. ## The three steps 1. **Register your site.** Sign in to the [business dashboard](https://business.frak.id/) and add your website. To prove the site is yours, you'll add a small verification record at your domain provider, a one-time check that takes a couple of minutes. See [Register your site](/guides/dashboard/register/). 2. **Install Frak on your site.** Pick your platform below and follow the matching guide. 3. **Set up your rewards.** Back in the business dashboard, [add a budget](/guides/dashboard/configure/funds/) and [create your first campaign](/guides/campaigns/create/). This is where you fund rewards and decide how much customers earn. ## Step 2: install Frak on your site ## What you'll manage in the dashboard # Add Frak to a custom site or app > Add Frak to any custom-built website or mobile app, then confirm real orders with a signed webhook from your backend. import { Aside, LinkCard, CardGrid, Steps } from '@astrojs/starlight/components'; # Add Frak to a custom site or app No plugin for your stack? Frak ships SDKs you can drop into anything you build yourself: a website, a native Android app, a native iOS app, or all three at once. Whatever you build on, the setup has the same two halves: 1. **Add Frak to your front end.** Load the SDK, set your merchant details once, and show the share and welcome surfaces to your customers. 2. **Validate purchases from your backend.** Confirm real orders with a signed webhook, so rewards only go out on genuine sales. ## 1. Add Frak to your front end Pick the guide that matches what you are building. You can combine several: one merchant account can serve a website and mobile apps at the same time, and rewards follow the customer across them. ## 2. Validate purchases from your backend Tracking on the page or in the app tells Frak an order might be coming. Rewards only fire once your backend confirms the order is real. ## How the pieces fit 1. **A customer shares your store.** The share surface (web component or native sheet) creates a personal link for them. 2. **A friend arrives and buys.** Frak recognizes the referral, and your front end registers the order with a customer ID, an order ID, and a token. 3. **Your backend confirms the sale.** A signed webhook tells Frak the order is paid, and the reward is paid out from your campaign budget. ## Next steps # Validate purchases from your backend > Confirm real orders with a signed webhook from your server, so Frak only pays rewards on genuine, paid sales. import { Tabs, TabItem, Steps, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Validate purchases from your backend Tracking on the page or in your app tells Frak an order might be coming. Rewards only fire once your backend confirms the order is real with a signed webhook. This keeps rewards tied to genuine, paid sales. This step is the same whether your front end is a [website](/guides/platforms/custom/web/) or a [mobile app](/guides/platforms/custom/mobile/). ## How it works 1. **The front end registers the order.** The post-purchase card, `trackPurchaseStatus`, or the mobile SDK's purchase call sends `customerId`, `orderId`, and `token` so Frak starts listening for that order. 2. **Your backend confirms it.** When the order is paid (or refunded, cancelled), your server sends a webhook to Frak with the same identifiers and an HMAC signature. 3. **Frak triggers the reward.** Once the signature checks out and the status is `confirmed`, Frak sends the `PurchaseCompleted` interaction, which can pay out rewards based on your active campaigns. ## Send the webhook Your webhook URL and signing secret are in the [business dashboard](https://business.frak.id/), under the **Purchase Tracker** section of your merchant. Sign the entire request body with HMAC SHA-256 and send it in the `x-hmac-sha256` header. ```ts import crypto from "node:crypto"; async function sendPurchaseWebhook(order: { id: string; customerId: string; status: "pending" | "confirmed" | "cancelled" | "refunded"; token: string; currency?: string; totalPrice?: string; }) { const body = JSON.stringify(order); const hmac = crypto .createHmac("sha256", process.env.FRAK_WEBHOOK_SECRET) .update(body) .digest("hex"); await fetch(process.env.FRAK_WEBHOOK_URL, { method: "POST", headers: { "Content-Type": "application/json", "x-hmac-sha256": hmac, // Use "true" while testing, "false" in production "x-test": "false", }, body, }); } await sendPurchaseWebhook({ id: "order_456", customerId: "cust_123", status: "confirmed", token: "a-unique-order-token", currency: "EUR", totalPrice: "99.99", }); ``` ```php function sendPurchaseWebhook(array $order): void { $url = getenv('FRAK_WEBHOOK_URL'); $secret = getenv('FRAK_WEBHOOK_SECRET'); $body = json_encode($order); $hmac = hash_hmac('sha256', $body, $secret); $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $body, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-hmac-sha256: ' . $hmac, 'x-test: false', // "true" while testing ], ]); curl_exec($ch); curl_close($ch); } sendPurchaseWebhook([ 'id' => 'order_456', 'customerId' => 'cust_123', 'status' => 'confirmed', 'token' => 'a-unique-order-token', 'currency' => 'EUR', 'totalPrice' => '99.99', ]); ``` See the [Purchase webhook reference](/developers/api/webhook/) for the full payload (including line items) and the [track purchase endpoint](/developers/api/track-purchase/) for the page-side call. ## Next steps # Add Frak to your mobile app > Add referral sharing and reward tracking to a native Android or iOS app with the Frak mobile SDKs. import { Tabs, TabItem, Steps, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Add Frak to your mobile app Frak ships native SDKs for Android and iOS, so the referral loop that works on your website also works inside your app: a customer shares, a friend installs or buys, and the reward is paid on a confirmed order. ## What you get | Capability | Android | iOS | | --- | --- | --- | | Share sheet with a personal referral link | Yes | Yes | | Reward amounts to display in your UI | Yes | Yes | | Interaction and purchase tracking | Yes | Yes | | Referral deep links into your app | Yes | Yes | | Handoff to install the Frak wallet | Yes | Yes | Both SDKs split into two pieces: a core with no user interface (nothing pulls in a web view) and an optional UI piece that adds the ready-made sharing sheet. ## The three steps 1. **Register your merchant account.** Sign in to the [business dashboard](https://business.frak.id/) and note your merchant ID. Your mobile app passes it explicitly at startup. See [Register your site](/guides/dashboard/register/). 2. **Add the SDK to your app.** Initialize it once, show a share button, and track your orders. The full walkthrough is in the developer guides below. 3. **Confirm orders from your backend.** Same as on the web: a signed webhook from your server is what actually releases the reward. See [Validate purchases from your backend](/guides/platforms/custom/backend/). ## Install and initialize Requires Android 7.0 (API 24) and Java 17. Add the artifacts: ```kotlin title="app/build.gradle.kts" dependencies { implementation("id.frak.sdk:core:1.0.0") // Only if you show the sharing sheet implementation("id.frak.sdk:ui:1.0.0") } ``` Initialize once, in `Application.onCreate` or your launcher Activity: ```kotlin Frak.initialize( context = applicationContext, config = FrakConfig(merchantId = "your-merchant-id") { metadata = FrakMetadata { name = "Your Store" currency = FrakCurrency.EUR homepageLink = "https://your-store.com" } }, ) ``` Show the sharing sheet: ```kotlin val sharing = FrakSharing.Builder(::onShareResult).build(this) sharing.present(SharingRequest { targetInteraction = "purchase" }) ``` And track a confirmed order: ```kotlin Frak.client.tracking.purchase( customerId = "cust_123", orderId = "order_456", token = "a-unique-order-token", ) ``` Everything is callable from Java too: every suspending call has a `CompletableFuture` twin. Requires iOS 15 and Xcode 16. In Xcode, use **File → Add Package Dependencies** with `https://github.com/frak-id/frak-ios-sdk`, or declare it in a `Package.swift`: ```swift title="Package.swift" dependencies: [ .package(url: "https://github.com/frak-id/frak-ios-sdk.git", exact: "1.0.0") ], targets: [ .target(name: "YourApp", dependencies: [ .product(name: "FrakSDK", package: "frak-ios-sdk"), // Only if you show the sharing sheet .product(name: "FrakSDKUI", package: "frak-ios-sdk"), ]) ] ``` Add the wallet schemes to your `Info.plist`. Your app cannot detect or open the Frak wallet without them: ```xml title="Info.plist" LSApplicationQueriesSchemes frakwallet frakwallet-dev ``` Then initialize once, at app startup: ```swift Frak.initialize( FrakConfig( merchantId: "your-merchant-id", metadata: FrakMetadata( name: "Your Store", currency: .eur, homepageLink: "https://your-store.com" ) ) ) ``` Show the sharing sheet: ```swift Button("Share and earn") { isSharing = true } .frakSharingSheet(isPresented: $isSharing, request: request) { result in // handle the outcome } ``` And track a confirmed order: ```swift await client.tracking.purchase( customerId: "cust_123", orderId: "order_456", token: "a-unique-order-token" ) ``` ## Deep links matter more on mobile A referral link opens in a browser unless your app claims it. Set up App Links on Android (with a published `assetlinks.json`) and Universal Links or a custom URL scheme on iOS, so a referred friend lands in your app with the referral intact. Both developer guides show the exact manifest and `Info.plist` entries. ## Rewards still need a confirmed sale Tracking a purchase from the app tells Frak an order might be coming. The reward is paid once your backend confirms the order with a signed webhook, exactly like the web integration. The order token you send from the app must match the one your server signs. ## Next steps # Add Frak to a custom website > Add Frak to any custom-built site with a few lines of code, whether you write plain HTML, use a bundler, or build with React. import { Tabs, TabItem, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Add Frak to a custom website For a custom-built site, adding Frak is a matter of loading one script, setting one config object, and dropping in the components you want. Pick the setup that matches your stack below. ## The components All three components are framework-agnostic [web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), so they work the same whether you write plain HTML, use a bundler, or build with React. | Component | Where it goes | What it does | | --- | --- | --- | | `` | Product page, homepage | Lets customers share your store and earn rewards | | `` | Top of the page | Welcomes referred visitors | | `` | Order confirmation page | Prompts a share right after checkout, and tracks the order | ## Add Frak to your site ### Load and configure Frak Add this to the `` of your pages. The config object is read by Frak when it loads, so set it **before** the script tag. ```html title="index.html" ``` `sdk.frak.id` is Frak's first-party CDN pointer: a release reaches you in minutes, and `onerror` falls back to jsDelivr if it is ever unreachable. See the [CDN / Browser integration guide](/developers/integration/cdn/) for how the fallback and preconnects work. ### Add the components Place the banner near the top of your ``, and the share button wherever you want customers to share: ```html ``` ### Track the purchase On your order confirmation page, add the post-purchase card with your order details. When `customer-id`, `order-id`, and `token` are all present, the card also registers the order with Frak automatically: ```html ``` If you do not want to show the card, register the order directly instead. The action becomes available once Frak is ready: ```html ``` ### Install ```bash npm install @frak-labs/components @frak-labs/core-sdk ``` ### Configure Frak Set the config in its own module so it runs first: ```ts title="frak-setup.ts" import type { FrakWalletSdkConfig } from "@frak-labs/core-sdk"; declare global { interface Window { FrakSetup: { config?: FrakWalletSdkConfig }; } } window.FrakSetup = { config: { metadata: { name: "Your Store", currency: "eur", }, }, }; ``` ### Register the components Import your config module first, then import each component you use. Importing a component registers its custom element and boots the SDK from `window.FrakSetup.config`: ```ts title="main.ts" import "./frak-setup"; import "@frak-labs/components/banner"; import "@frak-labs/components/buttonShare"; import "@frak-labs/components/postPurchase"; ``` Then drop the elements into your markup, exactly like the HTML tab: ```html ``` ### Track the purchase The post-purchase card tracks the order automatically when given all three attributes. To track without rendering the card, call the action directly: ```ts import { trackPurchaseStatus } from "@frak-labs/core-sdk/actions"; await trackPurchaseStatus({ customerId: "cust_123", orderId: "order_456", token: "a-unique-order-token", }); ``` The visual components are the same web components, used inside JSX. Install them and (optionally) `@frak-labs/core-sdk` for direct action calls: ```bash npm install @frak-labs/components @frak-labs/core-sdk ``` ### Configure and register Set the config in its own module, then import it (and the components) before you render your app: ```ts title="frak-setup.ts" import type { FrakWalletSdkConfig } from "@frak-labs/core-sdk"; declare global { interface Window { FrakSetup: { config?: FrakWalletSdkConfig }; } } window.FrakSetup = { config: { metadata: { name: "Your Store", currency: "eur", }, }, }; ``` ```tsx title="main.tsx" import "./frak-setup"; import "@frak-labs/components/banner"; import "@frak-labs/components/buttonShare"; import "@frak-labs/components/postPurchase"; import { createRoot } from "react-dom/client"; import { App } from "./App"; createRoot(document.getElementById("root")!).render(); ``` ### Use the components in JSX ```tsx title="App.tsx" export function App() { return ( <> {/* On your order confirmation route */} ); } ``` The post-purchase card tracks the order automatically. To track without the card, call `trackPurchaseStatus` from `@frak-labs/core-sdk/actions` after the order is placed. ## Next steps # Install Frak on PrestaShop > Add Frak to your PrestaShop store in three simple steps. Install the module, paste one key, and start rewarding customers for sharing. import { Steps, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Install Frak on PrestaShop Adding Frak to PrestaShop takes about five minutes. You install a module, paste one key from your dashboard, and Frak starts tracking referrals and rewards. The buttons even appear on the right pages on their own. ## Install the module 1. Download the latest **Frak module** from the [releases page](https://github.com/frak-id/wallet/releases?q=PrestaShop+Module&expanded=true). It's the `frakintegration-.zip` file. 2. In your back office, go to **Modules → Module Manager → Upload a module** and drop the zip in. 3. Click **Configure** on the **Frak** module to open its settings. ## Connect your store This is the only key you'll ever copy. It links your store to your Frak account. 1. In the [business dashboard](https://business.frak.id/), open your store and go to **Purchase Tracker**. Select **PrestaShop**, click **Register**, and copy the key it shows you. 2. On the Frak settings page, scroll to **Purchase Tracking → Webhook Secret** and paste the key. 3. Check that the **Merchant** line shows a green **Connected** badge, then click **Save Settings**. That's it. Your store is connected, and Frak starts tracking orders right away. ## You're live, now make it shine The share button, banner, and post-purchase card appear automatically on the right pages. From here you can fine-tune where they show, fund your rewards, and launch a campaign. # Choose where Frak buttons appear on PrestaShop > Turn each Frak component on or off and adjust where it shows on your PrestaShop storefront. import { Aside, LinkCard } from '@astrojs/starlight/components'; # Choose where Frak buttons appear on PrestaShop Once Frak is [installed and connected](/guides/platforms/prestashop/), the three components already show on the right pages. You can turn any of them off or fine-tune them from the **Component Placements** panel on the Frak settings page. | Component | Where it shows | On by default | Options | | --- | --- | --- | --- | | **Share button** | Product pages | Yes | Button style: Primary, Secondary, or None | | **Banner** | Top of the storefront | Yes | Custom CSS class | | **Post-purchase card** | Order confirmation page | Yes | None | | **Post-purchase card** | Customer order details | Yes | None | Each placement is a simple checkbox. Uncheck the ones you don't want, then **Save** to apply. ## Put a component somewhere else Need Frak on a page the checkboxes don't cover, like a CMS page or a custom block in your theme? Use the bundled Smarty tags in any `.tpl` file: ```txt {frak_banner placement="hero" referral_title="Welcome back!"} {frak_share_button text="Share & earn up to {REWARD}" no_reward_text="Share & earn" placement="sidebar"} {frak_post_purchase variant="referrer" cta_text="Earn rewards"} ``` ## Buttons not showing? Confirm the placement is checked in **Component Placements**, then clear your cache (**Advanced Parameters → Performance → Clear cache**). Some themes remove the product or header hooks Frak uses, so if a checked placement still shows nothing, check that theme template. Full steps are in [Settings & tracking](/guides/platforms/prestashop/details/). ## Next # PrestaShop settings & tracking > Requirements, brand fields, order tracking, the retry queue, and troubleshooting for the Frak PrestaShop module. import { Aside, Tabs, TabItem, LinkCard } from '@astrojs/starlight/components'; # PrestaShop settings & tracking The reference for everything beyond the [basic setup](/guides/platforms/prestashop/): requirements, brand fields, how order tracking keeps itself reliable, and what to do when something looks off. ## Requirements - **PrestaShop 8.1+** with **PHP 8.1+**. - The module ships everything it needs inside the zip. There's nothing to install on a command line. ## Brand fields The **Website Information** panel sets what customers see in the Frak window: - **Shop Name**: defaults to your PrestaShop shop name. Used as the title. - **Logo**: paste a public **Logo URL**, or use **Or upload a file** (JPG, PNG, GIF, or SVG up to 2 MB). The preview on the right updates as you type. The rest of the wording and translations are managed from the [business dashboard](https://business.frak.id/). Click **Save Settings** when done. ## How order tracking stays reliable When an order's status changes, the module tells Frak so rewards go out on real sales. If a message can't get through, it's saved and retried automatically (up to 5 times, spaced further apart each time). To make sure those retries actually run, set up one of the two options below. Install the official **ps_cronjobs** module from the Module Manager. Frak registers itself automatically, and the **Retry Cron** line on the settings page turns green. Nothing else to do. The **Retry Cron** line shows a ready-made URL. Add it to a cron that runs every 5 minutes, for example with `crontab -e`: ```bash */5 * * * * curl -fs 'https://your-shop.example/index.php?fc=module&module=frakintegration&controller=cron&token=' ``` The URL includes a private token from your settings page, so keep it to yourself. You can also run a retry on demand: open **Maintenance → Webhook queue** and click **Drain queue now**. ## Keep an eye on the queue The **Maintenance → Webhook queue** panel shows the health of order tracking at a glance: - **Pending**: waiting for the next attempt. - **Delivered**: sent successfully. - **Parked (failed)**: gave up after retrying. A red badge appears if this isn't zero. - **Last error**: the most recent problem, with a timestamp. ### Which order statuses count Orders that reach **Awaiting payment validation**, **Payment accepted**, **Delivered**, or **Awaiting payment (out of stock)** are tracked as confirmed sales. **Cancelled** and **Payment error** mark the sale as cancelled, and any refund (including partial refunds and returns) marks it as refunded. **Preparation in progress** and **Shipping** are ignored on purpose, so they don't clutter your results. ## Troubleshooting - **Merchant says "Not resolved for this domain".** Confirm your store's domain is registered on the [dashboard](https://business.frak.id/), then open **Maintenance** and click **Refresh Merchant**. (Your main domain works automatically; only subdomains need adding.) - **Deliveries failing right after setup.** Re-copy the key from **Purchase Tracker → PrestaShop** in the dashboard, paste it back into **Webhook Secret**, and click **Save Settings**. - **Parked count keeps growing.** Open **Advanced Parameters → Logs** and filter on `FrakIntegration`. The **Last error** line on the queue panel usually points straight at the cause. - **Buttons missing on the storefront.** Confirm the placement is enabled in [Component Placements](/guides/platforms/prestashop/components/) and clear your cache (**Advanced Parameters → Performance → Clear cache**). ## For developers The Frak PrestaShop module is open source, inside the [Frak wallet monorepo](https://github.com/frak-id/wallet) under `plugins/prestashop`. Open an issue or a pull request any time. # Install Frak on WordPress > Add Frak to your WordPress store in three simple steps. Install the plugin, paste one key, and start rewarding customers for sharing. import { Steps, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Install Frak on WordPress Adding Frak to WordPress takes about five minutes. You install a plugin, paste one key from your dashboard, and you're ready to reward customers for sharing your store. It works with any theme, with or without WooCommerce. ## Install the plugin 1. Download the latest **Frak plugin** from the [releases page](https://github.com/frak-id/wallet/releases?q=wordpress+plugin&expanded=true). It's the `frak-integration.zip` file. 2. In your WordPress admin, go to **Plugins → Add New Plugin → Upload Plugin**. 3. Pick the zip file, click **Install Now**, then **Activate**. ## Connect your store This is the only key you'll ever copy. It links your store to your Frak account. 1. In the [business dashboard](https://business.frak.id/), open your store and go to **Purchase Tracker**. Select **WooCommerce**, click **Register**, and copy the key it shows you. 2. In WordPress, go to **Settings → Frak** and paste the key into **Webhook Secret**. 3. Check that the **Merchant** line shows a green **Connected** badge, then click **Save Settings**. That's it. Your store is connected. ## You're live, now make it shine # Add Frak buttons on WordPress > Place the Frak share button, banner, and post-purchase card on your WordPress pages with a block, shortcode, widget, or Elementor widget. import { Tabs, TabItem, Aside, LinkCard } from '@astrojs/starlight/components'; # Add Frak buttons on WordPress Once Frak is [installed and connected](/guides/platforms/wordpress/), you choose where your customers see it. There are three Frak components, and you can add each one the way that fits your theme: a block, a shortcode, a widget, or an Elementor widget. | Component | What it does | | --- | --- | | **Share button** | Lets customers share your store and earn rewards. | | **Banner** | Welcomes referred visitors at the top of the page. | | **Post-purchase card** | Invites customers to share right after they buy. | ## Add a component Pick the method that matches how you edit your site. 1. Open the post, page, or template part in the editor (for block themes: **Appearance → Editor**). 2. Click the **+** where you want the component and search for **Frak**. 3. Choose **Frak Share Button**, **Frak Banner**, or **Frak Post-Purchase**. 4. Adjust the options in the sidebar, then save. Paste the matching shortcode into any page, post, or builder that accepts shortcodes: ```text [frak_share_button text="Share and earn!"] [frak_banner] [frak_post_purchase variant="referrer"] ``` From a theme template you can also call it in PHP: ```php echo do_shortcode( '[frak_share_button text="Share & earn"]' ); ``` Go to **Appearance → Widgets**, pick the sidebar or footer area, and add **Frak Share Button**, **Frak Banner**, or **Frak Post-Purchase**. Each one has a simple form with the same options as the block. If your site uses **Elementor**, the plugin adds a **Frak** category in the editor. Drag **Frak Share Button**, **Frak Banner**, or **Frak Post-Purchase** onto the canvas and tune the controls on the right. ## Block, shortcode, and widget names If you need the exact identifiers (for a page builder search or a template), here they are: | Component | Block | Shortcode | Widget | | --- | --- | --- | --- | | Share button | `frak/share-button` | `[frak_share_button]` | Frak Share Button | | Banner | `frak/banner` | `[frak_banner]` | Frak Banner | | Post-purchase card | `frak/post-purchase` | `[frak_post_purchase]` | Frak Post-Purchase | ## Next # WordPress settings & webhooks > Requirements, brand fields, WooCommerce order tracking, delivery logs, and troubleshooting for the Frak WordPress plugin. import { Aside, LinkCard } from '@astrojs/starlight/components'; # WordPress settings & webhooks The reference for everything beyond the [basic setup](/guides/platforms/wordpress/): requirements, brand fields, order tracking, and what to do when something looks off. ## Requirements - **WordPress 6.4+** and **PHP 8.0+**. - **WooCommerce** is optional. You only need it for purchase tracking, and the plugin is HPOS-compatible. ## Brand fields In **Settings → Frak**, under **Website Information**, you can set what customers see in the Frak window: - **App Name**: defaults to your site name. Click **Use Site Name** to fill it. - **Logo URL**: defaults to your site icon. Click **Use Site Icon**, or upload your own. The rest of the wording and translations are managed from the [business dashboard](https://business.frak.id/), so the WordPress page only covers these two fields. Click **Save Settings** when done. ## Order tracking with WooCommerce After you paste your key and save, the **WooCommerce Webhook** section lets Frak know when an order is placed, so rewards go out on real sales. 1. Click **Set up webhook**. (It stays disabled until your merchant is connected and the key is saved.) 2. Look for the green banner: **WooCommerce webhook active**. The **Secret in WooCommerce** line should read **matches the secret saved above**. That's the whole setup. WooCommerce handles retries and delivery on its own, so you don't have to maintain anything. If the banner is yellow instead of green, the message tells you exactly what's off and which button to click (**Re-enable webhook**, **Sync webhook**, and so on). ## Troubleshooting - **Merchant says "Not resolved for this domain".** Add your site's domain under **Allowed Domains** on the [dashboard](https://business.frak.id/), then click **Refresh Merchant** on the plugin settings page. (Your main domain works automatically; only subdomains need adding.) - **Tracking stopped after a domain change.** Same fix: add the new domain, then click **Refresh Merchant**. The webhook re-points itself automatically. - **"Secret does not match".** Re-copy the key from **Purchase Tracker → WooCommerce** in the dashboard, paste it back in **Settings → Frak**, save, then click **Sync webhook**. - **"Vendor folder missing" notice.** You unzipped a developer copy instead of the packaged release. Download `frak-integration.zip` from the [releases page](https://github.com/frak-id/wallet/releases?q=wordpress+plugin&expanded=true). ## For developers # Get started with Shopify > Install the Frak app, connect your store, and go live with referral rewards, all from one place, in about 5 minutes. import { Steps, Aside, LinkCard, CardGrid } from '@astrojs/starlight/components'; # Get started with Shopify Everything you need for Shopify lives inside **one app**. You install it, follow a short guided setup, and you're ready to reward customers for spreading the word. No separate dashboards, no code to copy. ## Before you start - An active Shopify store you can sign in to as an admin. - A few minutes to follow the in-app setup. You don't need a crypto wallet beforehand. You'll create your free Frak account during setup. ## Set it up 1. **Install the Frak app.** Open the [Frak app on the Shopify App Store](https://apps.shopify.com/frak) and click **Add app**. Shopify adds it to your store and opens the Frak setup screen. {/* screenshot: /img/guides/shopify/getting-started/01-install-app.png */} 2. **Connect your Frak account.** The first screen asks you to connect with a Frak wallet. This is your free Frak account. - **New to Frak?** Choose **Create an account** and follow the secure sign-up. It uses your device's fingerprint or face unlock, with no password to remember. - **Already have an account?** Choose **I already have an account** and sign in. Both options take you through the Frak sign-in screen, then back into the app. {/* screenshot: /img/guides/shopify/getting-started/02-connect-wallet.png */} 3. **Run the guided setup.** The app walks through five quick checks and confirms each one for you. The first four happen automatically; the last opens your theme editor, where you toggle Frak **on** and click **Save**. {/* screenshot: /img/guides/shopify/getting-started/03-guided-setup.png */} That's it. Your store is connected and ready. ### What the guided setup does You don't need to understand the details, but here's what's happening behind each check: | Setup check | What it does for you | | --- | --- | | **Connect your store** | Creates your store on Frak so rewards can be tracked. | | **Turn on tracking** | Recognizes customers who arrive from a friend's link. | | **Send purchases to Frak** | Lets Frak know when an order is placed. | | **Secure your purchases** | Confirms orders are genuine, so rewards only go out on real sales. | | **Activate Frak in your theme** | Switches Frak on across your storefront. | ## You're live, now make it shine Your store is connected. Next, add the buttons your customers will use and fund your rewards: ## Need a hand? - Each setup step shows its own status and hints inside the app. - For deeper analytics and settings, open the [business dashboard](https://business.frak.id/) with the same account. - The Frak Shopify app is [open source](https://github.com/frak-id/wallet). Report an issue or contribute any time. # Customize appearance (Shopify) > Adjust your brand name, logo, and the wording shown to customers. import { Aside } from '@astrojs/starlight/components'; # Customize appearance Make Frak feel like part of your brand. Open the **Appearance** tab in the Frak app, where everything is organized into a few sub-tabs: - **Text Customizations**: your **logo** and the **wording** shown in share prompts and reward messages. - **Share Button** and **Banner**: turn each placement on and configure where it appears on your storefront. - **Checkout Extension**: the post-purchase card shown on the checkout thank-you and order status pages. - **Explorer**: how your store appears in the **Frak Explorer**, where customers discover brands. {/* screenshot: /img/guides/shopify/appearance/01-appearance-tab.png */} Coming soon: detailed steps and screenshots. # Add sharing buttons (Shopify) > Add the share button and post-purchase card to your Shopify storefront. import { Aside } from '@astrojs/starlight/components'; # Add sharing buttons Once your store is connected, add the buttons customers use to share and earn. From your Shopify theme editor you can add: - **Share button** on your product pages, so customers can share and earn referral rewards. - **Post-purchase card** on the order status / thank-you page, shown right after checkout. **We recommend this one** because it converts best. - **Banner** to promote active rewards across your storefront. Each is a Shopify theme block, and the Frak app deep-links you to the right spot, so there's no code to copy. {/* screenshot: /img/guides/shopify/buttons/01-theme-blocks.png */} Coming soon: detailed steps and screenshots for each placement. # Create a campaign (Shopify) > Decide how much customers earn for referrals and purchases. import { Aside } from '@astrojs/starlight/components'; # Create a campaign A campaign sets the rules for rewards: how much a customer earns when a friend clicks, signs up, or buys. You can create one from the **Campaigns** tab in the Frak app, or in the [business dashboard](https://business.frak.id/) for more options. {/* screenshot: /img/guides/shopify/campaigns/01-campaign-tab.png */} The full walkthrough lives in [Create a campaign](/guides/campaigns/create/). Coming soon: a Shopify-specific walkthrough with screenshots. # Add funds (Shopify) > Top up your Frak reward balance, billed directly through Shopify. import { Aside } from '@astrojs/starlight/components'; # Add funds Rewards are paid from your Frak balance. On Shopify you top it up straight from the app. The charge goes through your usual **Shopify billing**, so there's no separate checkout or invoice to manage. Open the **Funding** tab in the Frak app, choose an amount, and confirm. Your balance updates once the payment clears. {/* screenshot: /img/guides/shopify/funds/01-financing-tab.png */} Coming soon: detailed steps and screenshots.