ChainVine API Docs
  • Chainvine
    • Product and Features
    • Technical Overview
  • ⚙️Developers
    • 🔨Use Cases
      • Leverage cookies
      • Link Claimer/Referrer
      • Record Link Click
      • Generate a Referrer Link
      • Record a Transfer Event
      • Complete a Requirement
    • 🖼️Embedded Widget
      • Implementation
      • FAQ
    • 🧰SDK
      • Implementation
      • Configuring the Client
      • Classes and Functions
        • Utility Methods
        • ChainvineClient
          • getReferralUrl(walletAddress)
          • recordClick(referrer)
          • linkReferrer([payload,])
          • referralConversion([payload,])
          • syncUser(walletAddress)
          • getCampaignReferralStats([payload,])
        • ChainvineUser
          • Initializing the client
          • joinCampaign([campaignParams,])
          • getRequirement([payload,])
          • getUserStats([payload,])
          • verifyRequirement([payload,])
          • completeRequirement([payload,])
          • claimEligibleEarnings([payload,])
          • transferEvent([payload,])
          • referral([campaignParams,])
            • linkToReferrer(referrer)
            • url()
          • setRewardTiersOverride([payload,])
        • Errors
        • Authentication
          • Getting your API Key
          • Allow-listing a domain
      • FAQ
    • 🪝Webhooks
    • 📔Open API Specification
  • Rewards
    • Claiming For Users
      • On ChainVine
Powered by GitBook
On this page
  • Step 1 - Authorize your project
  • Step 2 - Packaging
  • Step 3 - Initializing the Client
  • Examples
  • Examples
  1. Developers
  2. SDK

Implementation

PreviousSDKNextConfiguring the Client

Last updated 1 year ago

Step 1 - Authorize your project

For testing

Use a tool such as ngrok () to get a unique URL for your web app running locally on your device and add it to your allowlist. See: .

For production

Add your production domain by

Step 2 - Packaging

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

npm install @chainvine/sdk

Or

yarn add @chainvine/sdk

Coming soon

Not seeing your framework or language here? Let us know which one you'd like us to look into here:

Step 3 - Initializing the Client

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.

Examples

For your Testing environment

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

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

For your Production environment

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

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

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 :

⚙️
🧰
Generate unique referral links
Log the referrer from a URL link
Send a custom amount-based referral conversion
Send a custom once-off referral conversion
Record a link click
Cookie management
https://ngrok.com/docs/http/
allowlisting via the admin dashboard
allowlisting it via the admin dashboard