Skip to content

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 Frak Ads Manager 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, 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

<!-- Homepage: opens a full sharing page -->
<frak-button-share placement="homepage"></frak-button-share>
 
<!-- Product page: opens the embedded wallet -->
<frak-button-share placement="product-page"></frak-button-share>

Post-Purchase

<!-- Checkout confirmation page -->
<frak-post-purchase
    placement="checkout"
    customerId="cust_123"
    orderId="order_456"
    token="tok_abc"
></frak-post-purchase>

Banner

<!-- Show referral banner on homepage -->
<frak-banner placement="homepage"></frak-banner>

Wallet Button

<!-- Wallet button positioned on the left for this section -->
<frak-button-wallet placement="sidebar"></frak-button-wallet>

Open in App

<!-- Mobile-only button to redirect to the native app -->
<frak-open-in-app placement="mobile-landing"></frak-open-in-app>

Using Placements with the Core SDK

When calling SDK actions directly (without web components), pass the placement ID as the third argument:

import { displayModal, displayEmbeddedWallet } 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: "sharing" } },
    },
}, "checkout");
 
// Display the embedded wallet for the "homepage" placement
await displayEmbeddedWallet(client, {
    loggedIn: { action: { key: "sharing" } },
}, "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)

OptionTypeDescription
textstringButton text. Use {REWARD} placeholder for reward amount.
noRewardTextstringFallback text when no reward is available.
clickAction"embedded-wallet" | "share-modal" | "sharing-page"Which UI opens on click.
useRewardbooleanWhether to display the reward amount.
cssstringComponent-specific CSS override.

Wallet Button (buttonWallet)

OptionTypeDescription
position"right" | "left"Screen position of the floating wallet button.
cssstringComponent-specific CSS override.

Post-Purchase (postPurchase)

OptionTypeDescription
badgeTextstringText for the badge pill above the message.
refereeTextstringMessage shown to referred users. Use {REWARD} placeholder.
refereeNoRewardTextstringFallback message for referees when no reward is found.
referrerTextstringMessage shown to referrers. Use {REWARD} placeholder.
referrerNoRewardTextstringFallback message for referrers when no reward is found.
ctaTextstringCTA button text. Use {REWARD} placeholder.
ctaNoRewardTextstringFallback CTA text when no reward is found.
cssstringComponent-specific CSS override.

Banner (banner)

OptionTypeDescription
referralTitlestringTitle for the referral banner variant.
referralDescriptionstringDescription for the referral banner.
referralCtastringCTA button text for the referral banner.
inappTitlestringTitle for the in-app browser banner variant.
inappDescriptionstringDescription for the in-app browser banner.
inappCtastringCTA button text for the in-app browser banner.
cssstringComponent-specific CSS override.

Open in App (openInApp)

OptionTypeDescription
textstringButton text override.
cssstringComponent-specific CSS override.

Placement-Level Settings

In addition to component-specific settings, each placement also supports:

OptionTypeDescription
targetInteractionstringThe interaction type to use for reward calculations in this placement.
translationsRecord<string, string>Placement-specific translation overrides.
cssstringGlobal 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.

<!-- Placement "homepage" sets text to "Share this!" via the dashboard -->
<!-- But this instance overrides it with custom text -->
<frak-button-share placement="homepage" text="Share and earn up to {REWARD}!"></frak-button-share>

Example: Multi-Page Setup

Here's an example of using different placements across a website:

<!-- Homepage: referral banner + share button opening a full sharing page -->
<frak-banner placement="homepage"></frak-banner>
<frak-button-share placement="homepage"></frak-button-share>
 
<!-- Product page: share button opening the embedded wallet -->
<frak-button-share placement="product-page"></frak-button-share>
 
<!-- Checkout confirmation: post-purchase component -->
<frak-post-purchase
    placement="checkout"
    customerId="cust_123"
    orderId="order_456"
    token="tok_abc"
></frak-post-purchase>
 
<!-- All pages: floating wallet button -->
<frak-button-wallet placement="global"></frak-button-wallet>

Each placement is configured independently in the Frak Ads Manager dashboard, giving you full control over text, styling, and behavior per section — without changing your code.

Next Steps