0.0.3 • Published 11 months ago

llg-sdk-contact v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

LianLian Global Platform Contact SDK

Installation

Option 1: Use llg-sdk-contact

Install with NPM

npm install llg-sdk-contact

Or, with Yarn

yarn add llg-sdk-contact

Option 2: Import as a static resource

Staging:

<script src="https://eu-ewallet-share-bucket.lianlianglobal.com/sdk/contact/v1/prod/index.min.js" />

Prod:

<script src="https://eu-ewallet-share-bucket.lianlianglobal.com/sdk/contact/v1/prod/index.min.js" />

Initialization

<div id="llg-contact"></div>

import { init } from 'llg-sdk-contact';

const options = {
    el: '#llg-contact',
    env: 'prod',
    langKey: 'en',
    token: 'Bearer US_3AT4IwessFmm8H1FYBmV04tHiKMCy',
    mountedCb: () => {},
    successCb: () => {},
    failedCb: () => {},
}

await init(options);

// Or
await window.LLGContact.init(options);
OptionTypeRequired?Default valueDescription
elstringYES-SDK mounts to the DOM, eg: #llg-contact,
envstringNOprodLianLian Global environment you want to integrate your application with. Options include: staging, prod
langKeystringNOenLanguage. Options include: en
tokenstringYES-Bearer US_xxx
mountedCbfunctionNO-Executed when the SDK loads successfully
successCbfunctionNO-Execute after the KYC information is successfully submitted
failedCbfunctionNO-Executed after KYC information submission fails

Destroy Contact SDK

import { destroy } from 'llg-sdk-contact';

destroy();

// Or
window.LLGContact.destroy();