Package Exports
- varboxmail
- varboxmail/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (varboxmail) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
VarboxMail SDK (by SmartMailer)
The official Node.js SDK for SmartMailer — providing a high-performance, headless engine for transactional and marketing email infrastructure.
[!IMPORTANT] This SDK is designed for developers who want to maintain control over their data while leveraging our powerful delivery and analytics Control Plane.
Installation
npm install varboxmailArchitecture: Mode A vs Mode B
SmartMailer is built for flexibility, supporting two primary operational modes:
🏛️ Mode A (Cloud Data)
SmartMailer handles everything including your subscriber data. Best for simple apps and rapid prototyping.
🏗️ Mode B (BYO Data / SDK)
The recommended approach for scale. Your subscriber data stays in your database. You use the SDK to trigger sends, and our Control Plane handles delivery and unified analytics.
Quick Start
1. Get Your API Key
- Sign up at smartmailer.com
- Create a workspace
- Navigate to Developers → API Keys
- Generate a new API key
2. Send Your First Email
const { SmartMailer } = require('varboxmail');
const mailer = new SmartMailer({
apiKey: 'sm_your_api_key_here'
});
// Send transactional email
await mailer.sendEmail({
to: 'customer@example.com',
subject: 'Welcome to Our App!',
html: '<h1>Hello {{name}}!</h1><p>Thanks for signing up.</p>',
data: {
name: 'John Doe'
},
tags: ['welcome', 'transactional']
});Key Features
- 🛡️ Secure by Design — Data stays in your infrastructure.
- ⚡ High-Performance — Engineered for sub-second latency and high-volume throughput.
- 📊 Real-Time Analytics — Track opens, clicks, and engagement directly in your dashboard.
- 🛠️ Mode B Optimized — Built specifically for headless integration into microservices.
- 🧩 Template Engine — Personalized emails with dynamic data binding.
Technical Documentation
Transactional Emails
await mailer.sendEmail({
to: 'customer@example.com',
subject: 'Order Confirmation',
template: 'order-confirmed',
data: { orderId: '123' }
});Advanced Analytics
View detailed telemetry in your SmartMailer Dashboard:
- Device & Browser: Identify trends in how your users consume content.
- Global Reach: Track engagement by country and timezone.
- Deliverability: Real-time bouncing and complaint monitoring.
Configuration
[!TIP] Use environment variables to manage your API keys securely.
const mailer = new SmartMailer({
apiKey: process.env.SMARTMAILER_API_KEY,
timeout: 30000,
retries: 3
});Error Handling
try {
await mailer.sendEmail({ ... });
} catch (error) {
if (error.statusCode === 401) {
console.error('Invalid API Key');
}
}Support
- Docs: docs.smartmailer.com
- Status: status.smartmailer.com
- Issues: GitHub Issues
License
MIT © SmartMailer
License
MIT