Installing the SDK

1

Install the SDK

Contiguity is working on adding several SDKs over the coming months, including ones for Swift, Java, Dart, and more.

Use npm to install @contiguity/javascript

npm i @contiguity/javascript
2

Initialize the Client

After installation, import Contiguity into your project and give it your token.

const contiguity = require('@contiguity/javascript')
const client = contiguity.login("your token here")

You can also initialize it with the optional ‘debug’ flag, which logs additional information to the console.

const client = contiguity.login("your token here", true)

Sending a message

As long as you provide Contiguity a valid token, and provide valid inputs, sending texts will be a breeze.

Contiguity expects the recipient phone number to be formatted in E.164. You can attempt to pass numbers in formats like NANP, and the SDKs will try their best to convert it.

const object = {
    to: "+15555555555",
    message: "I sent this text using Contiguity"
}

await client.send.text(object)