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
  1. Developers
  2. SDK

Configuring the Client

PreviousImplementationNextClasses and Functions

Last updated 1 year ago

ClientConfig

Description: these are the options that can be specified in a ChainvineClient and ChainvineUser instance.

import { ChainvineClient, ClientConfig } from '@chainvine/sdk/lib';

const config: ClientConfig = {
   apiKey: 'S3CR37C0D3Z',
   testMode: true,
   logToConsole: true,
}

const client = new ChainvineClient(config);

Parameter
Type
Description
Default

apiKey

string

Your . DO NOT expose this in the browser, only supply this if you are consuming the SDK on the server.

N/A Note: If omitted, you must you are sending requests from.

testMode

boolean

Setting this to true will send all traffic to ChainVine's staging environment - this should only be used for POCing and testing

false

logToConsole

boolean

When set to true, this will log responses and errors to console - this is useful for testing and debugging but should be set to false in production

false

⚙️
🧰
ChainVine API Key
allowlist the domain