Lite

Installation

NPM

npm install @d24/sdk-minimal

HTML Script Tag

<script type="module" src="https://d24sdk.s3.amazonaws.com/releases/d24-minimal-1.0.19.es.js"></script>

Constructor

Initializes the SDK. This must be called before any other methods.

new SDK(publicKey, options)

Parameters

publicKey

string

Your public API key provided by D24.

Yes

options

object

Configuration options for the SDK.

Yes

options.environment

string

The environment to use.

Yes

'stg', 'production'

Usage

// NPM/ESM
import SDK from '@d24/sdk-minimal';
new SDK('as1i2nxal12bvd', { environment: 'stg' });

// UMD/Script Tag
new window.D24.SDK('as1i2nxal12bvd', { environment: 'stg' });

Errors

SDK was already instantiate.

The SDK constructor was called more than once.

The environment [environment] is not supported.

An invalid value was passed for options.environment.

Last updated

Was this helpful?