SDKs for every language

Official SDKs for Node.js, Python, PHP, Go, and Ruby. Or just use fetch - no SDK required. All SDKs are thin wrappers around the same REST API, so behavior is identical everywhere.

Quick install

One command per language. Pick yours.

Node.js

npm install @sparked/mail

Python

pip install sparked-mail

PHP

composer require sparked/mail

Go

go get github.com/sparked-mail/go-sdk

Ruby

gem install sparked-mail

Usage examples

Send a transactional email in five lines of code. Each tab below shows the same send in a different language.

import { SparkedMail } from '@sparked/mail';

const mail = new SparkedMail(process.env.SPARKED_API_KEY);

const res = await mail.emails.send({
  from: 'noreply@acme.com',
  to: 'user@example.com',
  subject: 'Welcome',
  html: '<b>Hi!</b>'
});

console.log(res.id);
from sparked_mail import SparkedMail
import os

mail = SparkedMail(os.environ['SPARKED_API_KEY'])

res = mail.emails.send(
  from_='noreply@acme.com',
  to='user@example.com',
  subject='Welcome',
  html='<b>Hi!</b>'
)

print(res.id)
use SparkedMail\Client;

$mail = new Client(getenv('SPARKED_API_KEY'));

$res = $mail->emails->send([
  'from' => 'noreply@acme.com',
  'to' => 'user@example.com',
  'subject' => 'Welcome',
  'html' => '<b>Hi!</b>'
]);

echo $res->id;
import "github.com/sparked-mail/go-sdk"

mail := sparked.New(os.Getenv("SPARKED_API_KEY"))

res, err := mail.Emails.Send(&sparked.SendRequest{
  From:    "noreply@acme.com",
  To:      []string{"user@example.com"},
  Subject: "Welcome",
  HTML:    "<b>Hi!</b>",
})

fmt.Println(res.ID)
require 'sparked-mail'

mail = SparkedMail::Client.new(ENV['SPARKED_API_KEY'])

res = mail.emails.send(
  from: 'noreply@acme.com',
  to: 'user@example.com',
  subject: 'Welcome',
  html: '<b>Hi!</b>'
)

puts res.id

No SDK? No problem.

Every SDK above is a thin wrapper around a single REST endpoint. If your language isn't listed, or you don't want a dependency, use fetch (or its equivalent) directly.

The API is a single POST /emails with a JSON body and a Bearer token. That's it. No SDK required means no version lock-in, no transitive deps, no security advisories to chase.

cURL example

# Send email in 1 line
curl -X POST https://mail.sparked.network/emails \
  -H "Authorization: Bearer re_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "noreply@acme.com",
    "to": "user@example.com",
    "subject": "Welcome",
    "html": "<b>Hi!</b>"
  }'

See the API reference for every endpoint. The full request/response shape is the same regardless of which language you call it from.

Start free. No credit card required.

1,000 emails per month, DKIM signed, webhooks, MCP support. Upgrade when you need more.