Installing the SDK
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
Use npm
to install @contiguity/javascript
npm i @contiguity/javascript
Use pip
to install contiguity
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)
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)
import contiguity
client = contiguity.login("your_token_here")
You can also initialize it with the optional ‘debug’ flag:
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
.
// 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
.
# HTML email
email_object = {
"to": "example@example.com",
"from": "Contiguity",
"subject": "My first email!",
"html": "<b>I sent an email using Contiguity</b>"
}
client.send.email(email_object)
Or, to send a plain text email:
# Plain text email
email_object = {
"to": "example@example.com",
"from": "Contiguity",
"subject": "My first email!",
"text": "I sent an email using Contiguity"
}
client.send.email(email_object)
Optionally, use replyTo
and cc
. At the moment, cc
only allows one email address.