Client libraries for every language
SDKs
Official Mailpipe SDKs make it easy to integrate email into your application without dealing with raw HTTP. Every SDK is generated from the same OpenAPI spec so they stay in sync with the API.
Available SDKs
Heads up: the SDK packages are not published to npm/PyPI/RubyGems yet. Every method shown maps 1:1 to the REST API, so hit those endpoints directly today — the snippets below show the shape of what's coming.
Full TypeScript support with auto-generated types from the OpenAPI spec.
- TypeScript types
- Promise-based API
- Automatic pagination
- Webhook helpers
npm install @mailpipe/sdk
import { MailpipeClient } from '@mailpipe/sdk';
const client = new MailpipeClient({
apiKey: process.env.MAILPIPE_API_KEY,
});
// List unread messages
const messages = await client.messages.list({ unread: true });
console.log(messages.data);Sync and async clients. Compatible with Python 3.9+ and all major frameworks.
- Sync & async clients
- Type hints (PEP 561)
- Django / FastAPI friendly
- Retry handling
pip install mailpipe
from mailpipe import MailpipeClient
client = MailpipeClient(api_key=os.environ["MAILPIPE_API_KEY"])
# List unread messages
messages = client.messages.list(unread=True)
for msg in messages.data:
print(msg.subject)Idiomatic Go SDK with context support, zero external dependencies, and complete test coverage.
- Context-aware
- Zero dependencies
- 100% test coverage
- Structured errors
go get github.com/mailpipe/mailpipe-go
import "github.com/mailpipe/mailpipe-go"
client := mailpipe.NewClient(os.Getenv("MAILPIPE_API_KEY"))
// List unread messages
messages, err := client.Messages.List(ctx, &mailpipe.ListMessagesParams{
Unread: mailpipe.Bool(true),
})
if err != nil {
log.Fatal(err)
}Elegant Ruby SDK with Rails integration helpers and support for Ruby 3.0+.
- Rails helpers
- Webhook verification
- Configurable retries
- RSpec matchers
gem install mailpipe
require 'mailpipe'
client = Mailpipe::Client.new(api_key: ENV['MAILPIPE_API_KEY'])
# List unread messages
messages = client.messages.list(unread: true)
messages.data.each { |msg| puts msg.subject }Common Concepts
Authentication
All SDKs accept your API key at construction time. Store the key in an environment variable — never hard-code it or commit it to source control.
MAILPIPE_API_KEY=mp_live_your-api-key-here
Pagination
List endpoints return a paginated response with data, meta.total, meta.limit, meta.offset, and meta.has_more. SDKs expose auto-pagination helpers so you can iterate all results without managing offsets.
// Fetch every message automatically across all pages
for await (const message of client.messages.listAutoPaging()) {
console.log(message.subject);
}Error Handling
Every SDK raises a typed error class (e.g. MailpipeError) that includes the HTTP status code and machine-readable error code.
import { MailpipeClient, MailpipeError } from '@mailpipe/sdk';
try {
const message = await client.messages.get('msg_does_not_exist');
} catch (err) {
if (err instanceof MailpipeError) {
console.error(err.status); // 404
console.error(err.code); // "message_not_found"
console.error(err.message); // "No message found with id msg_does_not_exist"
}
}Webhook Verification Helper
Every SDK ships a utility to verify webhook signatures so you do not have to implement HMAC verification yourself.
import { verifyWebhookSignature } from '@mailpipe/sdk';
app.post('/webhooks/mailpipe', (req, res) => {
const event = verifyWebhookSignature(
req.rawBody,
req.headers['x-mailpipe-signature'],
process.env.MAILPIPE_WEBHOOK_SECRET,
);
// event is fully typed — TypeScript knows the shape of event.data
// based on event.type
console.log(event.type); // "email.received"
res.sendStatus(200);
});Language Guides
Node.js
Full TypeScript support with auto-generated types from the OpenAPI spec.
Python
Sync and async clients. Compatible with Python 3.9+ and all major frameworks.
Go
Idiomatic Go SDK with context support, zero external dependencies, and complete test coverage.
Ruby
Elegant Ruby SDK with Rails integration helpers and support for Ruby 3.0+.
OpenAPI Specification
All SDKs are generated from the Mailpipe OpenAPI 3.1 specification. If your language is not listed above you can generate a client from the spec using any OpenAPI code generator.
curl -o mailpipe-openapi.json \ "https://api.mailpipe.dev/openapi.json"
Or browse the interactive spec at api.mailpipe.dev/docs.
Still have questions?
We can help with anything from setup to scaling.