# Utility Methods

## storeReferrer

<pre class="language-typescript"><code class="lang-typescript">import { storeReferrer } from '@chainvine/sdk';

storeReferrer(); //This will fetch the "r" query parameter from the current URL (if available) and store it in a CV_REF cookie

<strong>//You may customise the cookie settings as follows:
</strong>
storeReferrer({
  durationDays: 30, //Override the default cookie duration (120 days)
  referrer: 'ABC123', //Should you already have access to the referrer, and if you do not want it fetched from the URL, you can provide it directly
}); 
</code></pre>

## getReferrer

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

//Fetches a previously stored referrer from the CV_REF cookie if available, returns undefined if not
getReferrer(); 
```

## clearReferrer

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

//Clear the CV_REF cookie:
clearReferrer();
```


---

# 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/utility-methods.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.
