> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailchannels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Official libraries

> Find the official MailChannels SDKs for JavaScript, Python, and PHP, and the framework integrations they ship.

MailChannels builds and maintains official, first-party SDKs for JavaScript, Python, and PHP. Each SDK covers the full
Email API, is built and tested against the current API release, and is updated as new API features ship. All three are
open source under the MIT license.

| Language | Package | Requires | Source |
| - | - | - | - |
| JavaScript / TypeScript | [`mailchannels-sdk`](https://www.npmjs.com/package/mailchannels-sdk) on npm | Node.js 20 or later | [Repository](https://github.com/mailchannels/mailchannels-email-api-sdk-js) |
| Python | [`mailchannels`](https://pypi.org/project/mailchannels/) on PyPI | Python 3.9 or later | [Repository](https://github.com/mailchannels/mailchannels-email-api-sdk-py) |
| PHP | [`mailchannels/mailchannels-php`](https://packagist.org/packages/mailchannels/mailchannels-php) on Packagist | PHP 8.2 or later | [Repository](https://github.com/mailchannels/mailchannels-email-api-sdk-php) |

## Installation

```javascript Node.js theme={null} theme={null} theme={null}
# npm
npm i mailchannels-sdk

# yarn
yarn add mailchannels-sdk

# pnpm
pnpm add mailchannels-sdk
```

```python Python theme={null} theme={null} theme={null}
# pip
pip install mailchannels

# uv
uv add mailchannels
```

```php PHP theme={null} theme={null} theme={null}
composer require mailchannels/mailchannels-php

# You also need a PSR-18 client and PSR-17 factories. Guzzle is a popular choice.
composer require guzzlehttp/guzzle
```

Then follow the quickstart for your language to create an account, generate an API key, add the required DNS records,
and send your first message.

> **[JavaScript quickstart](https://docs.mailchannels.com/email-api/javascript/quickstart.md)**
>
> Send your first message from a Node.js application.

> **[Python quickstart](https://docs.mailchannels.com/email-api/python/quickstart.md)**
>
> Send your first message with the sync or async client.

> **[PHP quickstart](https://docs.mailchannels.com/email-api/php/quickstart.md)**
>
> Send your first message with the PSR-based client.

## What the SDKs cover

Every SDK exposes the same operations as the [API reference](https://docs.mailchannels.com/email-api/api-reference-introduction.md), with typed
requests and responses in the conventions of its language:

* Sending, both the regular send path and queued sending. See [Send vs send async](https://docs.mailchannels.com/email-api/send-vs-send-async.md).
* Attachments, custom headers, templates, and unsubscribe handling.
* Managed [DKIM signing and key management](https://docs.mailchannels.com/email-api/configuring-dkim.md), and SPF, DKIM, and Domain Lockdown
  checks.
* [Sub-accounts](https://docs.mailchannels.com/email-api/sub-accounts-create.md): provisioning, API keys, SMTP passwords, limits, and usage.
* [Suppressions](https://docs.mailchannels.com/email-api/suppression-api-actions.md) and [metrics](https://docs.mailchannels.com/email-api/metrics.md).
* [Webhooks](https://docs.mailchannels.com/email-api/webhooks.md): enrollment, validation, batch inspection, and signature verification.

The JavaScript SDK also includes a local simulator for development and testing without sending real mail. See
[Local development](https://docs.mailchannels.com/email-api/local-development.md).

## Framework integrations

The SDKs ship transports for common mail frameworks, so an application that already composes mail through its
framework can switch to MailChannels with a few lines of configuration and no change to how messages are built.

> **[Laravel](https://docs.mailchannels.com/email-api/laravel.md)**
>
> A Laravel Mail driver, included in the PHP SDK.

> **[Nodemailer](https://docs.mailchannels.com/email-api/nodemailer.md)**
>
> A Nodemailer transport, included in the JavaScript SDK.

> **[Symfony](https://docs.mailchannels.com/email-api/symfony.md)**
>
> A Symfony Mailer transport and webhook parser, included in the PHP SDK.

For Python, the SDK repository includes
[Django and FastAPI recipes](https://github.com/mailchannels/mailchannels-email-api-sdk-py/blob/main/docs/FRAMEWORKS.md)
that show how to configure the client and send from an application service.

> [!NOTE]
>
> The framework integrations only send mail. For sub-accounts, DKIM keys, webhooks, and the rest of the API surface,
> use the SDK client directly.

## Using the SDKs with an AI coding agent

Each SDK ships an agent skill inside its published package: a `SKILL.md` entry point with a decision tree, plus
focused per-topic recipes for sending, attachments, DKIM, webhooks, sub-accounts, and the rest. The skill teaches an
agent to use the SDK correctly and loads only the parts a task needs. The files are plain Markdown, so any agent that
can read a directory of context files, such as Claude Code, Cursor, Codex CLI, Aider, or Continue, can use them
without modification.

| SDK | Skill directory | How to get it |
| - | - | - |
| JavaScript | `.agents/skills/mailchannels-js/` | Download the package tarball with `npm pack` and copy the directory out. See the [JavaScript SDK README](https://github.com/mailchannels/mailchannels-email-api-sdk-js#readme). |
| Python | `.agents/skills/mailchannels-python/` | Download the source distribution with `pip download --no-binary :all:` and copy the directory out. The wheel does not include it. See the [Python SDK README](https://github.com/mailchannels/mailchannels-email-api-sdk-py#readme). |
| PHP | `.agents/skills/mailchannels-php/` | Copy it from `vendor/mailchannels/mailchannels-php/` after `composer require`. See the [PHP SDK README](https://github.com/mailchannels/mailchannels-email-api-sdk-php#readme). |

Copy the skill wherever your agent looks for skills, rules, or context files, and re-copy it when you upgrade the SDK
so it stays in step with the installed version.

> [!TIP]
>
> Not using one of these languages? The Email API is plain HTTPS and JSON, so any HTTP client works. Start with the
> [cURL quickstart](https://docs.mailchannels.com/email-api/curl/quickstart.md), or relay through [SMTP](https://docs.mailchannels.com/email-api/smtp-sending.md) from
> software that already speaks it.

## Next steps

* Read the [webhooks guide](https://docs.mailchannels.com/email-api/webhooks.md) to learn how to get real-time notifications about email delivery,
  bounces, and complaints.
* Explore the [API reference](https://docs.mailchannels.com/email-api/api-reference-introduction.md) to see what else you can do with the API.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.