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:

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

Sending an email

As long as you provide Contiguity a valid token, and provide valid inputs, sending emails will be a breeze. Various email parameters can be configured in the Dashboard such as tracking, custom domains, and more.

Contiguity supports, but not yet in the SDK, custom emails from your own domain. This is coming in December 2024.

// HTML email
const object = {
    to: "example@example.com",
    from: "Contiguity", 
    subject: "My first email!",
    html: "<b>I sent an email using Contiguity</b>"
}

await client.send.email(object)

Or, to send a plain text email:

// Plain text email
const object = {
    to: "example@example.com",
    from: "Contiguity",
    subject: "My first email!",
    text: "I sent an email using Contiguity"
}

await client.send.email(object)

Optionally, use replyTo and cc.