Developer guide

Send an email in Node.js without an SMTP server

Send a DKIM-signed transactional email from Node.js with a single HTTP call — no SMTP server to configure, no keys to manage. Here are the steps, with the typed SDK or native fetch.

  1. 1

    Add and verify your domain

    Add your sending domain in Spore and publish the DNS records it gives you (DKIM, SPF, DMARC). Once propagated, Spore validates them automatically — your email is then signed.

  2. 2

    Create an API key

    Generate an API key (sk_live_…) for your project and expose it through a SPORE_API_KEY environment variable. Never commit it to your code.

  3. 3

    Send with the typed SDK

    Install @lalternative/spore-sdk for autocompletion on every field. Spore handles DKIM signing, delivery and retries.

    typescript
    import { configureSporeClient, getSporeAPI } from "@lalternative/spore-sdk"
    
    configureSporeClient({ apiKey: process.env.SPORE_API_KEY! })
    
    await getSporeAPI().sendEmail({
      from: "hello@yourdomain.com",
      to: ["alex@example.com"],
      subject: "Welcome aboard",
      html: "<p>Hi Alex, your account is ready.</p>",
    })
  4. 4

    Or dependency-free, with fetch

    Prefer zero dependencies? The same send is a single native fetch call to POST /emails with a Bearer header.

    typescript
    const res = await fetch("https://api.sporee.fr/emails", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.SPORE_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        from: "hello@yourdomain.com",
        to: ["alex@example.com"],
        subject: "Welcome aboard",
        html: "<p>Hi Alex, your account is ready.</p>",
      }),
    })
    
    if (!res.ok) throw new Error(`Spore returned ${res.status}`)
  5. 5

    Verify delivery

    Query GET /emails/:id for the per-attempt history, or wire up a webhook to receive email.sent, email.bounced and email.failed events in real time.

Frequently asked questions

Do I need an SMTP server to send with Spore?
No. Spore exposes an HTTP API: you send a POST /emails and the platform handles DKIM signing and delivery. No SMTP server to operate.
Is the SDK required?
No. The typed SDK adds autocompletion, but a plain fetch or curl call to POST /emails is enough.
How are DKIM and deliverability handled?
DKIM keys are generated and stored server-side, signing is automatic, and bounces update the suppression list with no action from you.

Ready to send your first email?