2.0.0 • Published 7 months ago
@ding-live/sdk v2.0.0
Ding Javascript SDK
The Ding Javascript SDK allows Javascript backends to access the Ding API programmatically.
Requirements
Node 12 or higher.
Installation
Install the package with:
npm install @ding-live/sdk --save
# or
yarn add @ding-live/sdk
Usage
The package needs to be configured with your account's UUID and your secret key. Ping hello@ding.live to get them.
import ding, { DeviceType } from "@ding-live/sdk";
const client = new Ding("<CUSTOMER_UUID>", "<SECRET_TOKEN>");
// Authenticate
const auth = await client.authenticate("+12065550100");
// Check the code the user entered
const check = await client.check(auth.uuid, "1234");
// Retry the auth
const retry = await client.retry(auth.uuid);
More options
// Authenticate with metadata to increase spam detection
client
.authenticate("+12065550100", {
ip: "192.168.0.1",
deviceId: "asd8789asf76a98sdf6sdf7s7d8",
deviceType: DeviceType.Ios,
appVersion: "1.0",
callbackUrl: "<YOUR_CALLBACK_URL>",
})
.then(console.debug);
1.3.0
9 months ago
2.0.0
7 months ago
1.2.8
11 months ago
1.2.7
11 months ago
1.2.6
11 months ago
1.2.5
11 months ago
1.2.4
11 months ago
1.2.3
11 months ago
1.2.2
11 months ago
1.2.1
11 months ago
1.2.0
12 months ago
1.1.1
1 year ago
1.0.0
1 year ago
1.1.9
1 year ago
1.1.8
1 year ago
1.1.7
1 year ago
1.1.6
1 year ago
1.1.5
1 year ago
1.1.4
1 year ago
1.1.3
1 year ago
1.1.2
1 year ago
1.1.0
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago