SDK Reference
    npm package

    Node.js SDK

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

    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` and they will be automatically encoded to base64 for delivery.

    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`, and `webhooks`.

    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).