> For the complete documentation index, see [llms.txt](https://docs.chainvine.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainvine.xyz/developers/sdk/classes-and-functions/chainvineuser/referral-campaignparams.md).

# referral(\[campaignParams,])

Access the user's referral methods for a given referral program.

```typescript
import { ChainvineUser } from '@chainvine/sdk';

const userClient = new ChainvineUser(
   '0x393849393430', 
   {
      apiKey: 'S3CR37C0D3Z',
   }
);

const campaignId = 'siojdp2no';

const campaignParams = {
  campaign: {
     id: campaignId
  }
};

const userReferral = userClient.referral(campaignParams);
```

## Params

<table><thead><tr><th width="180">Param</th><th width="141">Required</th><th>Description</th></tr></thead><tbody><tr><td>campaign.id</td><td>yes</td><td>the id of the program/campaign the user should be added to.<br>Note: this campaign/program must belong to your account.</td></tr></tbody></table>

## **Response**

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>url()</strong></td><td></td><td><a href="/pages/VIFtrM4X6McAtAKyw0RH">/pages/VIFtrM4X6McAtAKyw0RH</a></td></tr><tr><td><p></p><p><strong>linkToReferrer(referrerId)</strong></p></td><td></td><td></td><td><a href="/pages/j5I6bMKDd18p8GLqqbBd">/pages/j5I6bMKDd18p8GLqqbBd</a></td></tr></tbody></table>
