Ranla with Node.js

Use the Node SDK in Express, Fastify, workers, cron jobs, queue consumers, or any other server runtime where your API key can stay private.

1. Install the SDK

npm install @supersend/ranla

2. Configure your API key

export RANLA_API_KEY=rnl_your_key_here

3. Send an email

import { Ranla } from '@supersend/ranla'

const tx = new Ranla(process.env.RANLA_API_KEY!)

const result = await tx.emails.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Your receipt',
  html: '<p>Thanks for your purchase.</p>',
})

console.log(result.id, result.status)

Nodemailer transport

Many Node apps and tools (Payload, Auth.js email, Strapi, Ghost, and custom apps) accept a Nodemailer transport. Use ours so existing transporter.sendMail(...) calls hit Ranla over HTTP (not SMTP).

Dedicated package: supersendtx-nodemailer (transport source of truth; also re-exported as supersendtx/nodemailer).

npm install supersendtx-nodemailer @supersend/ranla nodemailer
import nodemailer from 'nodemailer'
import { createSuperSendTXTransport } from 'supersendtx-nodemailer'

const transporter = nodemailer.createTransport(
  createSuperSendTXTransport({
    apiKey: process.env.RANLA_API_KEY!,
  }),
)

await transporter.sendMail({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Your receipt',
  html: '<p>Thanks for your purchase.</p>',
  headers: {
    'X-SuperSendTX-Tag': 'campaign=welcome',
    'X-SuperSendTX-Idempotency-Key': 'receipt-123',
    // 'X-SuperSendTX-Scheduled-At': '2030-01-01T00:00:00Z',
  },
})

X-SuperSendTX-Tag uses name=value. Pass an array of header values for multiple tags. Custom non-reserved headers are forwarded to the API headers field. Attachments must include inline content (Buffer or string); path / href are not supported yet.

Better Auth

Dedicated package (preferred for discoverability):

npm install supersendtx-better-auth @supersend/ranla better-auth
import { createBetterAuthEmail } from 'supersendtx-better-auth'

Same helper is also exported as supersendtx/better-auth. Full setup: Better Auth email.

Auth.js / NextAuth

npm install supersendtx-authjs @supersend/ranla next-auth
import SuperSendTX from 'supersendtx-authjs'

Same provider is also exported as supersendtx/authjs. Full setup: Auth.js / NextAuth email.

React Email

Author components with React Email, then pass them to the Node SDK’s react option:

npm install @supersend/ranla @react-email/render react
await tx.emails.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Welcome',
  react: WelcomeEmail({ name: 'Ada' }),
})

Full walkthrough (Next.js, CLI template push, troubleshooting): Send React Email.