Skip to main content

Prerequisites


Installation


Quick Start

Store your API key in an environment variable, not in version control:
.env

Self-Hosted Instances

If you’re running a self-hosted ByteSend, pass your instance URL as the second argument:

Sending Emails

Basic send

Multiple recipients

With CC, BCC, and Reply-To

Scheduling an email

Custom headers and metadata


Batch Sending

Send up to 100 emails in a single API call. Much more efficient than looping individual requests:

Error Handling

The SDK throws errors for failed API calls. Always wrap sends in try/catch in production:
See the Error Codes guide for the full list of API error codes and how to handle each one.

Working with Contacts

Add a contact to a contact book

Upsert (create or update)

Unsubscribe a contact


Webhook Verification

Verify incoming webhook signatures to ensure requests are from ByteSend:
See the full Webhooks guide for all event types and best practices.

Next Steps