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
  • Params
  • Response
  1. Developers
  2. SDK
  3. Classes and Functions
  4. ChainvineUser

referral([campaignParams,])

Access the user's referral methods for a given referral program.

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

Param
Required
Description

campaign.id

yes

the id of the program/campaign the user should be added to. Note: this campaign/program must belong to your account.

Response

PrevioustransferEvent([payload,])NextlinkToReferrer(referrer)

Last updated 1 year ago

⚙️
🧰

url()

linkToReferrer(referrerId)