SDKs
Official SDKs
mailkube provides first-party SDKs for the most popular server-side languages. All SDKs are generated from the same OpenAPI spec — they’re always in sync with the API.
Node.js / TypeScript
Installation
npm install @mailkube/node
# or
pnpm add @mailkube/node
Usage
import { Mailkube } from '@mailkube/node';
const client = new Mailkube({
apiKey: process.env.MAILKUBE_API_KEY,
});
// Send a message
const result = await client.messages.send({
to: 'user@example.com',
from: 'noreply@yourdomain.com',
subject: 'Welcome to our app',
html: '<h1>Welcome!</h1>',
text: 'Welcome!',
});
console.log(result.id); // message event ID
// Send with a template
await client.messages.send({
to: 'user@example.com',
from: 'noreply@yourdomain.com',
templateId: 'welcome-email',
variables: { firstName: 'Alice' },
});
Python
Installation
pip install mailkube
Usage
from mailkube import Mailkube
client = Mailkube(api_key=os.environ["MAILKUBE_API_KEY"])
result = client.messages.send(
to="user@example.com",
from_address="noreply@yourdomain.com",
subject="Welcome!",
html="<h1>Welcome!</h1>",
)
print(result.id)
Other languages
Don’t see your language? The REST API works from any HTTP client. All request and response schemas are published in our OpenAPI spec.
Community SDKs:
- Ruby —
gem install mailkube - PHP —
composer require mailkube/mailkube-php - Go —
go get github.com/mailkube/mailkube-go
SDK versioning
SDKs follow semantic versioning. Breaking changes are never introduced in minor or patch releases. Subscribe to our changelog to be notified of new releases.
What’s next
- REST API — send without an SDK
- API Reference — full endpoint documentation
- Getting started — your first email in 5 minutes