Overview
The embedded dashboard displays:- Referral link with copy functionality
- Performance metrics (clicks, leads, sales)
- Commission earnings and payout status
- Coupon codes (with optional self-service creation)
- Marketing resources and creatives
Integration Flow
1
Your Server calls Affonso API
POST /v1/embed/token with user data (email, name, image)2
Affonso returns token
Response includes
publicToken, expiresAt, and affiliate link3
Frontend renders iframe
Embed the dashboard using the token in the iframe URL
Step 1: Generate Token
Create an API route on your server that generates a token. This keeps your API key secure.Body Parameters
Your affiliate program ID.
Information about the user you want to display the dashboard for.
Affiliate group ID to assign the user to. If not specified, the user is assigned to your program’s default group. Use this to place users in specific commission tiers. Find your group IDs in Dashboard → Affiliate Program → Groups.
Example Request
Response
New users are automatically registered as affiliates and approved for your program.
Step 2: Render the Dashboard
Use thepublicToken in an iframe to display the dashboard.
Next.js Example
1. Create API Route
First, create a server-side API route that generates the token:2. Create the Page Component
Then, fetch the token from your API route and render the iframe:Token Lifecycle
| Property | Details |
|---|---|
| Validity | 30 minutes |
| Refresh | Generate new token on each page load |
| Cleanup | Old tokens are automatically invalidated |
Customization
URL Parameters
Add these parameters to the iframe URL for customization:| Parameter | Values | Description |
|---|---|---|
theme | light, dark, system | Color scheme. Default: light |
bg | HEX color (without #) | Background color. Use this to match your app’s background. Example: 0f0f0f for dark, ffffff for white |
lang | Language code | UI language. Default: en. See supported languages below |
Supported Languages
The dashboard supports 14 languages:| Code | Language |
|---|---|
en | English (default) |
de | Deutsch |
fr | Français |
es | Español |
it | Italiano |
pt | Português |
nl | Nederlands |
pl | Polski |
tr | Türkçe |
ja | 日本語 |
zh | 中文 |
ko | 한국어 |
ru | Русский |
ar | العربية |
Brand Colors
The dashboard inherits your brand colors from Portal Settings:- Primary Color - Buttons, links, accents
- Secondary Color - Highlights, backgrounds
#881337) in your Affonso dashboard under Portal Settings.
Visual Preview Editor
Don’t want to write code to test settings? Use the visual editor:- Go to Affiliate Program → Appearance
- Click the Embed tab
- Customize in real-time:
- Theme: Light, dark, or system (follows user’s device preference)
- Language: Select from 14 languages – preview updates instantly
- Background: Pick a color that matches your app
- Click Integration Code to copy the configured code snippets

