@quolle/sdk
v0.2.1
Published
Official Node.js SDK for Quolle — transactional email API for African SaaS
Maintainers
Readme
Quolle
Official Node.js SDK for Quolle — transactional email API for African SaaS.
Installation
npm install @quolle/sdkQuick Start
import { Quolle } from "@quolle/sdk"
const quolle = new Quolle({
apiKey: process.env.QUOLLE_API_KEY!
})
// Send an email
const { id } = await quolle.emails.send({
from: "[email protected]",
to: "[email protected]",
subject: "Welcome!",
html: "<h1>Welcome to our platform</h1>"
})Features
- ✅ TypeScript-first with full type safety
- ✅ Send via REST API
- ✅ Template-based sending with variables
- ✅ USSD-triggered emails
- ✅ Idempotency key support
- ✅ Naira pricing at quolle.com
Idempotency
const { id } = await quolle.emails
.setIdempotencyKey("order_123_receipt")
.send({
from: "[email protected]",
to: "[email protected]",
subject: "Your receipt",
html: "<p>Thanks for your order</p>"
})Scheduled Sending
await quolle.emails.send({
from: "[email protected]",
to: "[email protected]",
subject: "Your weekly digest",
html: "<p>Here's what happened this week</p>",
scheduledAt: "2026-12-25T09:00:00.000Z"
})Batch Sending
const { ids, queued } = await quolle.emails.sendBatch([
{ from: "[email protected]", to: "[email protected]", subject: "Hi Alice", html: "<p>Hello</p>" },
{ from: "[email protected]", to: "[email protected]", subject: "Hi Bob", html: "<p>Hello</p>" }
])Template Sending
const { id } = await quolle.emails.send({
from: "[email protected]",
to: "[email protected]",
subject: "Welcome!",
template: "welcome-email",
variables: {
firstName: "Amaka",
activationLink: "https://yourapp.com/activate/abc123"
}
})USSD Emails
await quolle.emails.sendUSSD({
from: "[email protected]",
to: "[email protected]",
subject: "Transaction Receipt",
html: "<p>₦5,000 sent successfully</p>",
metadata: {
ussd: {
sessionId: "sess_123",
shortCode: "*737#",
phoneNumber: "+2348012345678"
}
}
})Fetching and Cancelling Emails
const email = await quolle.emails.get("a1b2c3d4-...")
await quolle.emails.cancel("a1b2c3d4-...")Error Handling
import { Quolle, QuolleError } from "@quolle/sdk"
try {
await quolle.emails.send({
from: "[email protected]",
to: "[email protected]",
subject: "Welcome!",
html: "<h1>Welcome</h1>"
})
} catch (err) {
if (err instanceof QuolleError) {
console.error(err.status, err.message)
}
}API Reference
Full documentation at https://quolle.com/docs
License
MIT © Quolle
