@bytewise-solutions/mailverick
v1.2.1
Published
> Official TypeScript client for the [Mailverick](https://mailverick.com) email delivery API — focused on simplicity, robustness, and high delivery performance.
Readme
@bytewise-solutions/mailverick
Official TypeScript client for the Mailverick email delivery API — focused on simplicity, robustness, and high delivery performance.
Overview
Mailverick is a high-performance email dispatching service designed for modern applications that demand:
- Fast and reliable delivery
- Simple, clean API
- Robust token handling
- Proxy support for secure environments
This library provides a lightweight, type-safe client for sending emails through Mailverick with minimal setup.
Installation
npm install @bytewise-solutions/mailverickor
yarn add @bytewise-solutions/mailverickUsage
import { Mailverick, Email } from '@bytewise-solutions/mailverick';
const client = new Mailverick('your-api-key');
const email: Email = {
from: { email: '[email protected]', name: 'Your App' },
to: [{ email: '[email protected]', name: 'Recipient' }],
replyTo: { email: '[email protected]' },
subject: 'Welcome to our platform!',
body: {
text: 'Thanks for signing up!',
html: '<strong>Thanks for signing up!</strong>',
},
};
await client.sendEmail(email);You can also batch-send multiple emails:
await client.sendEmails([email1, email2, email3]);Email Format
type Email = {
from: { email: string; name?: string };
to: { email: string; name?: string }[];
replyTo?: { email: string; name?: string };
subject: string;
body: {
text?: string;
html?: string;
};
attachments?: {
fileName: string;
contentType: string;
base64Content: string;
}[];
inlineAttachments?: {
fileName: string;
contentType: string;
base64Content: string;
contentId: string;
}[];
customId?: string;
tracking?: {
opens?: 'none' | 'last_only' | 'full';
disabled?: boolean;
};
};Tracking
Each email can carry an optional tracking object:
await client.sendEmail({
...email,
tracking: {
opens: 'last_only', // 'none' | 'last_only' | 'full'
disabled: false,
},
});opens— open-tracking mode for the recipient.nonenever tracks opens,last_onlytracks only the most recent email,fulltracks every email. This is stored against the recipient's contact, so it applies to all of their opens (including past emails). Omit to keep the account/tenant default (last_only).disabled— whentrue, disables tracking for this message only (skips the open pixel and link rewriting). Defaults tofalse.
Proxy Support
const client = new Mailverick('your-api-key', {
proxy: {
host: '127.0.0.1',
port: 8080,
protocol: 'http',
auth: {
username: 'proxyuser',
password: 'proxypass',
},
},
});Contributing
Building, testing and the release process are documented in CONTRIBUTING.md.
