<ToltEmbed /> renders a partner’s referral dashboard (link, earnings, customers) inside your app. For a step-by-step walkthrough, see Refer-a-friend page.
Your app
Your servertoken route
Toltplatform.tolt.com
1/api/tolt/embed-token
2POST /v2/embed-tokens
3
4token
5iframe /referrals?token=…
6tolt-embed:ready
Install
1. Mint a token on your server
Your API key never reaches the browser. Your backend exchanges it for a token scoped to one partner, valid for about an hour; readexpires_at.
partner_id or partner: { email, program_id }. With partner, Tolt finds the partner by email in the program, or creates them (active, with a referral link) when there is none; add first_name and last_name to name a new partner. partner_id only finds an existing partner. Either way you get 404 for a partner who is invited, suspended or rejected, or a program that isn’t active. The response includes the partner_id the token is for.
2. Render the component
referrals.tsx
Props
string
The embed token from your server. Omit it to render a sample dashboard (useful while designing).
"light" | "dark" | "system"
default:"system"
Force a color scheme, or follow the partner’s system setting.
ToltEmbedThemeOptions
Match the dashboard to your brand. Every key is optional; anything you leave out keeps the default for the active theme.
"referrals"
default:"referrals"
Which embed to render. The referral dashboard is the only one today.
() => void
Fires once the dashboard has loaded and reported its size.
(message: string) => void
Fires if the dashboard fails to load, for example because the token had already expired. Fetch a new token here. A dashboard that has loaded doesn’t re-check its token, so for long sessions fetch a new one before
expires_at.string
Class name for the iframe.
CSSProperties
Inline styles for the iframe, merged over the defaults (
width: 100%, no border).string
default:"https://platform.tolt.com"
Override the embed host. Mostly for local development.
Iframe without React
Point an iframe at/referrals with the token and any theme options as query params:

