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.
For production
Add your production domain by allowlisting it via the admin dashboard
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
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 :
Last updated