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 requires a `subscriptionGroupId` to check recipient consent compliance.
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`, 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
- Clone the repository:
- Configure Environment Settings:
Copy the example environment file and open it to configure your SimplySend credentials:
- Install and Start:
- 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).
Related Resources
Transactional Email API Reference
Review all fields and JSON payload specifications for sending transactional emails.
Compliance Guide
Learn how to configure compliance mailing address and unsubscribe templates.
Domains Management API
See how to programmatically register and check DNS settings for sending domains.
Subscriber Management API
Create lists, subscription groups, and import subscribers programmatically.
