SDK Reference
    npm package

    Node.js SDK

    Official Node.js SDK for SimplySend to easily send emails and manage your domains, templates, and subscribers.

    Choose the account region

    All three clients accept region: us, au, ca, or eu. Use the account ID and API key created in that region. Omitting region preserves the existing U.S. endpoints; an explicit baseUrl takes precedence. Changing region does not migrate accounts or resources.

    The region option requires SDK 6.1.0 or later. With an earlier version, use baseUrl with the endpoint shown in the API reference after choosing a region. See the regional guide for setup. For the Web Setup client, include /web-setup/ in baseUrl.

    Installation

    Install the SimplySend SDK using your package manager of choice. The SDK requires **Node.js 22 or higher** and comes with zero runtime dependencies.

    Initialization

    Import the specific client class for your required API (Transactional, Marketing, or Web Setup) and initialize it with your Account ID and API key.

    Sending Transactional Emails

    Use `SimplySendTransactionalClient` to dispatch transactional emails via the `email.send()` method. You can pass raw file buffers in `attachments`; the SDK sends small emails directly and stages larger attachments automatically.

    The standard limit is 2 MiB per email. For a final email up to 40 MB, including Base64-encoded attachments and the message body, request Transactional Email Size Increase in Account → Approvals and wait for your workspace limit to be updated. You can attach up to 10 files; the body and other non-attachment data must remain within 2 MiB.

    Sending Marketing Emails

    Use `SimplySendMarketingClient` to send newsletters or marketing campaigns via the `email.send()` method. It accepts an optional `subscriptionGroupId` to target specific lists and check subscription status. If omitted, global contact opt-in status will be verified directly.

    Resource Management

    Use `SimplySendWebSetupClient` to manage your setup programmatically. The client exposes dedicated namespaces like `domains`, `domainGroups`, `contacts` (which manages contacts directory, subscription groups, and subscriber lists), `templates`, `complianceTemplates`, `webhooks`, and `deliverability`.

    Sample Web Application

    We provide a pre-built, premium glassmorphic sample web application to help you quickly test the SimplySend Node.js SDK and preview transactional and marketing email templates. The repository is hosted on GitHub: simply-send-sample-app

    Quickstart Guide

    1. Clone the repository:
    2. Configure Environment Settings:

      Copy the example environment file and open it to configure your SimplySend credentials:

    3. Install and Start:
    4. Test locally: Open [http://localhost:3005](http://localhost:3005) in your web browser to dispatch test emails using the interactive dashboard UI.

    Error Handling

    Handle SDK error responses by checking if they are instance of `SimplySendValidationError` (local checks) or `SimplySendHttpError` (remote API response).