<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. Add external_id, your own user id, and Tolt matches on it before email and keeps it on the partner, so a user who changes their email keeps the same 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, and 409 when the partner with that email already has a different external_id. The response includes the partner_id the token is for.
2. Render the component
referrals.tsx
Props
The embed token from your server. Omit it to render a sample dashboard (useful while designing).
Force a color scheme, or follow the partner’s system setting.
Match the dashboard to your brand. Every key is optional; anything you leave out keeps the default for the active theme.
Show this link (
lnk_...) instead of the partner’s first one. If it isn’t one of the partner’s links, the dashboard shows the first link.Hide the referral link and copy button, for when your app already shows the link.
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.Iframe without React
Point an iframe at/referrals with the token and any theme options as query params. linkId and hideLink=true work the same way:

