Skip to content

Build a referral program with the Frak SDK

Section titled “Build a referral program with the Frak SDK”

The Frak SDK adds a rewarded referral program to your website or app: customers share personal links, and when a friend buys, both the ambassador and the friend get a reward. This page is the developer entry point: what you can build, how the pieces fit together, and which package to install first.

If you run Shopify, WordPress, or PrestaShop, you probably don’t need any of this: see the Guides for the one-click app or plugin. Come back here if you’re building on a custom website, a React app, or a native iOS or Android app.

  • Share links. Customers get a personal, tracked link for a product or your store. The Share Button component and the sharing actions in the SDK handle link generation and the native share sheet.
  • Purchase tracking. Confirm a sale so a reward can be paid, from the browser or your backend. See Interactions and the platform-specific tracking calls in each integration guide.
  • Rewards for both sides. When a friend buys through a shared link, the ambassador and the friend both get a reward, defined by the campaigns you set up in the business dashboard.
  • Post-purchase share prompts. Ask a buyer to share right after checkout with the Post-Purchase component.
  • Referral and promo banners. Show a banner that promotes sharing, or nudges an in-app browser user to open your site in their default browser, with the Banner component.
  • Open in app. Redirect mobile visitors from an in-app browser to their system browser with the Open in App component, which is what WebAuthn needs to work.

A Frak integration has four parts:

  1. The SDK or components, running in your website or app, so customers can share and you can track interactions.
  2. The business dashboard (business.frak.id), where you register your domain, fund your reward balance, and manage settings.
  3. Campaigns, the budget and reward rules you define in the dashboard for each goal (a sale, a signup, and so on).
  4. Purchase tracking, sent from the browser or confirmed by your backend with a signed webhook, so rewards are only paid on a confirmed sale.

For the backend-driven configuration piece, most component text, styling, and per-page behavior lives in the dashboard too, so you can change it without shipping code.

You haveStart with
A website with a bundler (Vite, Webpack, etc.)JavaScript via package manager
Any website, no build stepCDN / Browser integration
A React appReact integration
A native Android appAndroid SDK
A native iOS appiOS SDK

Most website integrations start with @frak-labs/components, the ready-made <frak-*> elements (share button, banner, post-purchase, open-in-app). Reach for @frak-labs/core-sdk directly when you need to drive an action yourself, for example opening a modal or sending a custom interaction. See the Components overview for the full list of elements.

A typical integration takes under an hour: the snippets are small, and most settings live in the dashboard.

  1. Create a merchant account on the business dashboard and register your domain.
  2. Install the package that matches your platform from the table above.
  3. Add a share button or banner component to a page.
  4. Send purchase tracking on your order confirmation page, then confirm real orders from your backend with a signed webhook. See Validate purchases from your backend.
  5. Create a campaign and fund your reward balance in the dashboard.

Running Shopify, WordPress, or PrestaShop? Skip the SDK: the Guides walk through the app or plugin install, and setup takes about 5 minutes with any of them.

Every SDK ships a full symbol reference generated from its source: see the SDK Reference for the core SDK, React SDK, web components, Android, and iOS.