White-labeling
Learn how to create a white-labeled referral dashboard with Dub Partners.
Dub Partners require a Business plan subscription or higher.
With Dub Partners, you can build a white-labeled referral dashboard that lives directly inside your app in just a few lines of code.
This way, your users can automatically enroll in your partner program without needing to leave your app and sign up on a third-party platform.
In this guide, we’ll walk you through the steps to get started with the Dub Referrals Embed.
Step 1: Generate embed token
First, you need to create a server API route that generates a public token, which will be used by the Dub Referrals Embed to fetch real-time conversions and earnings data from the client-side.
If you’re using our server-side SDKs, you can generate an embed token using the embedToken.referrals
method.
If you’re not using our server-side SDKs, you can generate an embed token using our REST API instead (via the POST /tokens/embed/referrals
endpoint).
Refer to the full API reference to learn more about the properties you can pass to the POST /tokens/embed/referrals
endpoint.
Step 2: Install the embed
Then, with the publicToken
from Step 1, you can install and initialize the Dub Referrals Embed. There are two ways to do this:
React component
First, install the NPM package:
Then use the component in your React application:
Iframe embed
Alternatively, if you’re not using React (or you’re not on React v18.2.0
or higher), you can add the iframe directly to your HTML:
Embed options
The Dub Referrals Embed supports the following options for styling and behavior:
The type of embed to use. In this case, we’re using the referrals
type.
The theme of the embed.
Available options:
backgroundColor
: The background color of the embed.
Depending on the embed type, you can use the following examples to initialize the embed options: