# Implementation

## Step 1 - Authorize your project

#### For testing

Use a tool such as ngrok (<https://ngrok.com/docs/http/>) to get a unique URL for your web app running locally on your device and add it to your allowlist. \
\
See: [allowlisting via the admin dashboard](https://docs.chainvine.xyz/developers/sdk/classes-and-functions/authentication/allow-listing-a-domain).

#### For production

Add your production domain by [allowlisting it via the admin dashboard](https://docs.chainvine.xyz/developers/sdk/classes-and-functions/authentication/allow-listing-a-domain)

## Step 2 - Packaging

The ChainVine SDK can be added to your project via the following package managers or methods

```bash
npm install @chainvine/sdk
```

Or

```bash
yarn add @chainvine/sdk
```

{% tabs %}
{% tab title="Script tag (coming soon)" %}
*Coming soon*
{% endtab %}

{% tab title="Feedback" %}
Not seeing your framework or language here? \
Let us know which one you'd like us to look into here:

{% embed url="<https://92dgagzx54m.typeform.com/to/nmMJ1EVj>" %}
{% endtab %}
{% endtabs %}

## Step 3 - Initializing the Client

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

const client = new ChainvineClient();
```

You may provide optional configuration parameters in order to override the [default settings of the Client](https://docs.chainvine.xyz/developers/sdk/broken-reference).

### Examples

**For your Testing environment**

{% tabs %}
{% tab title="Node.js/JavaScript" %}

```javascript
import { ChainvineClient } from '@chainvine/sdk';

const client = new ChainvineClient({
   apiKey: 'S3CR37C0D3Z',
   testMode: true,
   logToConsole: true,
});
```

{% endtab %}
{% endtabs %}

#### For your Production environment

{% tabs %}
{% tab title="Node.js/JavaScript" %}

```javascript
import { ChainvineClient } from '@chainvine/sdk';

const client = new ChainvineClient({
   apiKey: 'S3CR37C0D3Z',
   logToConsole: true, //can also be false or ommited depending on your needs
});
```

{% endtab %}
{% endtabs %}

## Examples

The extent to which a referral program is hosted on your d(App) is up to you.  Here are some of the functions you might like to use :&#x20;

1. [Generate unique referral links](https://docs.chainvine.xyz/developers/use-cases/generate-a-referrer-link)
2. [Log the referrer from a URL link](https://docs.chainvine.xyz/developers/use-cases/link-claimer-referrer)
3. [Send a custom amount-based referral conversion](https://docs.chainvine.xyz/developers/use-cases/record-a-transfer-event)
4. [Send a custom once-off referral conversion](https://docs.chainvine.xyz/developers/use-cases/complete-a-requirement)
5. [Record a link click](https://docs.chainvine.xyz/developers/use-cases/record-link-click)
6. [Cookie management](https://docs.chainvine.xyz/developers/use-cases/leverage-cookies)
