Initializing the client

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

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

const client = new ChainvineClient(config)

// By default we assume you are dealing with an ethereum wallet address 
const userClient = await client.syncUser('0x393849393430')

// If your users are uniquely identified by an email address or you would like to
// use your own internal unique identifier you may instead use either of the following
const userClient = await client.syncUserWithEmail('[email protected]')
const userClient = await client.syncUserWithExternalId('myOwnInternalId123')

You may provide an optional configuration parameters in order to override the default settings of the Client.

You may then use the userClient to perform actions specific to the user it was synced with

Examples

For your Testing environment

For your Production environment

Last updated