Referral links

getReferralLink — create and share the current user's referral link for a campaign

Returns the current user's referral link for a campaign, creating it on first call. Works for anonymous users too — the link re-binds automatically on identify.

ParameterTypeDescription
campaignIdstringThe campaign to generate a link for (a campaign UUID, from the dashboard or API).

Returns a ReferralLink{ id, url, code, campaignId }; id is a UUID, and the shareable pieces are e.g. https://mycompany.refr.link/a1b2c3 with code a1b2c3.

invitebase.getReferralLink(campaignId: string): Promise<ReferralLink>
const link = await invitebase.getReferralLink('7e1f8a3b-4c26-49d0-b591-0d8e2f6a3c15');

await navigator.share({
  title: 'Get a free month of Mycompany',
  url: link.url,
});

What's next

On this page