boundry.
RegionSydney, Australia
Documentation/javascript

JavaScript / TypeScript SDK

@boundry/sdk is a typed, zero-runtime-dependency fetch client for Boundry’s regional API.

Install

terminalShell
Shell
npm i @boundry/sdk

Quickstart

Set BOUNDRY_API_KEY, then send from a domain verified in this project. The display-name form is valid; an unverified sending domain returns 422.

send.tsNode
TypeScript
import { Boundry } from "@boundry/sdk";

const boundry = new Boundry({
  apiKey: process.env.BOUNDRY_API_KEY,
  region: "au",
});

const { id } = await boundry.emails.send({
  from: "Acme <hello@acme.com>",
  to: ["ava@northwind.com.au"],
  subject: "Welcome to Acme",
  html: "<p>It works.</p>",
});

Client options

OptionTypePurpose
apiKeystringProject API key. Defaults to BOUNDRY_API_KEY when available.
region"au" | stringRegional endpoint selector, matching the region slug shown in the picker above.
baseUrlstringFull API base URL. Takes precedence over region when explicitly supplied.
timeoutnumberPer-request deadline in milliseconds. Defaults to 30,000.
maxRetriesnumberRetries after the first attempt. Defaults to 2.
fetchFetchFunctionFetch implementation for tests or non-standard runtimes.

Resources and methods

These rows are derived from the public OpenAPI operations and link to the generated endpoint reference. options? accepts request controls such as signal and idempotencyKey.

SDK methodWhat it doesAPI reference
boundry.apiKeys.list(options?)List API keysView endpoint
boundry.apiKeys.create(params, options?)Create an API keyView endpoint
boundry.apiKeys.delete(keyId, options?)Delete an API keyView endpoint
boundry.domains.list(options?)List domainsView endpoint
boundry.domains.create(params, options?)Create a domainView endpoint
boundry.domains.delete(domainId, options?)Delete a domainView endpoint
boundry.domains.get(domainId, options?)Get a domainView endpoint
boundry.domains.update(domainId, params, options?)Update domain trackingView endpoint
boundry.domains.verifyAction(domainId, options?)Verify a domain (compatibility action)View endpoint
boundry.domains.verify(domainId, options?)Verify a domainView endpoint
boundry.emails.list(options?)List sent emailsView endpoint
boundry.emails.send(params, options?)Send an emailView endpoint
boundry.emails.get(emailId, options?)Get a sent emailView endpoint
boundry.emails.listAttachments(emailId, options?)List email attachmentsView endpoint
boundry.emails.getAttachment(emailId, attachmentId, options?)Download an email attachmentView endpoint
boundry.emails.batchSend(params, options?)Send a batch of emailsView endpoint
boundry.events.list(options?)List project eventsView endpoint
boundry.events.get(eventId, options?)Get a project eventView endpoint
boundry.inbound.listReceived(params?, options?)List received emailsView endpoint
boundry.inbound.getReceived(emailId, options?)Get a received emailView endpoint
boundry.inbound.ingest(params, options?)Ingest an inbound emailView endpoint
boundry.logs.list(options?)List event logsView endpoint
boundry.openapi.get(options?)Get the OpenAPI documentView endpoint
boundry.webhooks.list(options?)List webhooksView endpoint
boundry.webhooks.create(params, options?)Create a webhookView endpoint
boundry.webhooks.delete(webhookId, options?)Delete a webhookView endpoint
boundry.webhooks.get(webhookId, options?)Get a webhookView endpoint
boundry.webhooks.update(webhookId, params, options?)Update a webhookView endpoint
boundry.webhooks.listDeliveries(webhookId, params?, options?)List webhook deliveriesView endpoint
boundry.webhooks.getDelivery(webhookId, deliveryId, options?)Get webhook delivery detailView endpoint
boundry.webhooks.retryDelivery(webhookId, deliveryId, options?)Retry a webhook deliveryView endpoint
boundry.webhooks.rotateSecret(webhookId, params, options?)Rotate a webhook signing secretView endpoint
boundry.webhooks.test(webhookId, params, options?)Send a synthetic webhook eventView endpoint
boundry.webhooks.verify(webhookId, options?)Send a webhook ownership challengeView endpoint

Errors

Non-success responses throw BoundryError, with status, code, and requestId. Connection failures throw BoundryConnectionError; request deadlines throw BoundryTimeoutError.

send.tsJavaScript
TypeScript
import { Boundry, BoundryError } from "@boundry/sdk";

const boundry = new Boundry({ apiKey: process.env.BOUNDRY_API_KEY });

try {
  await boundry.emails.send({
    from: "Acme <hello@acme.com>",
    to: ["ava@northwind.com.au"],
    subject: "Welcome to Acme",
    html: "<p>It works.</p>",
  });
} catch (error) {
  if (error instanceof BoundryError) {
    console.error(error.status, error.code, error.requestId);
  }
}

Retries and idempotency

The SDK retries connection failures and 408, 429, and 5xx responses with exponential full jitter, up to maxRetries (2 by default), and honours Retry-After. It automatically creates an idempotency key for emails.send; pass { idempotencyKey: "..." } as the second argument when you need a stable key, including for another non-idempotent request.

Regions and runtimes

region: "au" resolves to https://api.au.boundry.dev. Set baseUrl explicitly only when you need to override region.

local.tsJavaScript
TypeScript
import { Boundry } from "@boundry/sdk";

const boundry = new Boundry({
  apiKey: process.env.BOUNDRY_API_KEY,
  baseUrl: "https://api.au.boundry.dev",
});

It supports Node 18+, Cloudflare Workers, Deno, Bun, and modern browsers with a Fetch implementation. Keep project API keys on a trusted server rather than exposing them in browser-delivered code.