supersendtx
v0.16.0
Published
SuperSend TX transactional email API client
Maintainers
Readme
supersendtx
Official Node.js / TypeScript client for the SuperSend TX transactional email API.
npm install supersendtxexport SUPERSENDTX_API_KEY=stx_your_key_hereimport { SuperSendTX } from 'supersendtx'
const tx = new SuperSendTX(process.env.SUPERSENDTX_API_KEY!)
const email = await tx.emails.send({
from: '[email protected]',
to: '[email protected]',
subject: 'Your receipt',
html: '<p>Thanks for your purchase.</p>',
})
console.log(email.id, email.status)Affiliate program
Create partners from your own app, record referrals server-side, and sign partners in to their portal:
// Turn a customer into a referrer
const { affiliate } = await tx.affiliates.create({
email: '[email protected]',
first_name: 'Jane',
token: 'jane', // their link becomes https://yourapp.com/?via=jane
send_invite: false,
})
// Attribute a signup without the browser snippet
await tx.affiliateReferrals.create({ token: 'jane', email: '[email protected]' })
// "Referral dashboard" button: one-minute sign-in link, redirect right away
const { url } = await tx.affiliates.loginLink(affiliate.id)Also: tx.affiliates.links, tx.affiliateCampaigns, tx.affiliateCommissions (list, get, reverse) and tx.affiliatePayouts (list, get, markPaid). Payout runs are approved in the dashboard. Reference: https://docs.supersendtx.com/affiliates
Adapters
Optional entry points (install peer deps as needed):
| Import | Package / peer |
|--------|----------------|
| supersendtx/nodemailer | supersendtx-nodemailer + nodemailer |
| supersendtx/better-auth | supersendtx-better-auth |
| supersendtx/authjs | supersendtx-authjs |
| supersendtx/clerk | supersendtx-clerk |
| supersendtx/payload | supersendtx-payload |
Docs
- Quickstart: https://docs.ranla.ai/quickstart
- Node / Nodemailer: https://docs.ranla.ai/frameworks/node
- API reference: https://docs.ranla.ai/emails
- Product: https://ranla.ai
License
MIT
