# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chainvine.xyz/developers/sdk/classes-and-functions/chainvineuser/referral-campaignparams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
