# 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="referral-campaignparams/url">url</a></td></tr><tr><td><p></p><p><strong>linkToReferrer(referrerId)</strong></p></td><td></td><td></td><td><a href="referral-campaignparams/linktoreferrer-referrer">linktoreferrer-referrer</a></td></tr></tbody></table>
