Installing the SDK

1

Install the SDK

bun add contiguity
2

Initialize the Client

import { Contiguity } from "contiguity";
const contiguity = new Contiguity("contiguity_sk_...your_token...");

Sending an email

Various email parameters can be configured in the Console such as tracking, custom domains, and more.
const res = await contiguity.email.send({
  to: ["user@example.com", "ops@example.com"],
  from: "Your App <no-reply@yourapp.com>",
  subject: "Welcome!",
  body: { html: "<h1>Hello</h1>" },
  reply_to: "support@yourapp.com",
  cc: "manager@example.com"
});

Response

email_id
string
Unique identifier for the sent email, used for tracking delivery status and analytics.
metadata
object
Request metadata including ID, timestamp, and API version.
You can also send a simple email with just the required fields:
const res = await contiguity.email.send({
  to: "user@example.com",
  from: "Your App <no-reply@yourapp.com>",
  subject: "Hello from Contiguity!",
  body: { text: "This is a plain text email." }
});

Parameters

email.send(params)

to
string | string[]
required
The recipient’s email address or an array of email addresses.
from
string
required
The sender’s email address. Can include a display name: "Your App <no-reply@yourapp.com>"
subject
string
required
The email subject line.
body
object
required
The email content. Must contain either text, html, or both.
reply_to
string
Email address for replies. If not specified, replies will go to the from address.
cc
string | string[]
Carbon copy recipients. Can be a single email address or an array of addresses.
bcc
string | string[]
Blind carbon copy recipients. Can be a single email address or an array of addresses.
headers
object[]
Custom email headers as an array of objects with name and value properties.