@bytewise-solutions/mailverick
v1.0.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;
};Proxy Support
const client = new Mailverick('your-api-key', {
proxy: {
host: '127.0.0.1',
port: 8080,
protocol: 'http',
auth: {
username: 'proxyuser',
password: 'proxypass',
},
},
});Build
npm run buildCompiles the TypeScript sources into the dist/ directory.
Test
npm testRuns the test suite using jest.
Lint
npm run lint
npm run lint:fixChecks and fixes formatting and linting issues using ESLint.
