npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

maileroo-sdk

v1.0.1

Published

Official Node.js SDK for Maileroo v2 API. Send transactional/marketing emails via Maileroo with a simple and intuitive API.

Readme

Maileroo Node.js SDK

Maileroo is a robust email delivery platform designed for effortless sending of transactional and marketing emails. This Node.js SDK offers a straightforward interface for working with the Maileroo API, supporting basic email formats, templates, bulk sending, and scheduling capabilities.

Features

  • Send basic HTML or plain text emails with ease
  • Use pre-defined templates with dynamic data
  • Send up to 500 personalized emails in bulk
  • Schedule emails for future delivery
  • Manage scheduled emails (list & delete)
  • Add tags, custom headers, and reference IDs
  • Attach files to your emails
  • Support for multiple recipients, CC, BCC, and Reply-To
  • Enable or disable open and click tracking
  • Built-in input validation and error handling

Install

npm i maileroo-sdk
# or
yarn add maileroo-sdk

Quick Start

import {MailerooClient, EmailAddress, Attachment} from "maileroo-sdk";

const client = new MailerooClient("your-api-key");

const referenceId = await client.sendBasicEmail({
    from: new EmailAddress("[email protected]", "Sender Name"),
    to: [new EmailAddress("[email protected]", "Recipient Name")],
    subject: "Hello from Maileroo!",
    html: "<h1>Hello World!</h1><p>This is a test email.</p>",
    plain: "Hello World! This is a test email."
});

console.log("Email sent with reference ID:", referenceId);

Usage Examples

1. Basic Email with Attachments

import {MailerooClient, EmailAddress, Attachment} from "maileroo-sdk";

const client = new MailerooClient("your-api-key");

const referenceId = await client.sendBasicEmail({
    from: new EmailAddress("[email protected]", "Your Company"),
    to: [
        new EmailAddress("[email protected]", "John Doe"),
        new EmailAddress("[email protected]")
    ],
    cc: [new EmailAddress("[email protected]", "Manager")],
    bcc: [new EmailAddress("[email protected]")],
    reply_to: new EmailAddress("[email protected]", "Support Team"),
    subject: "Monthly Report",
    html: "<h1>Monthly Report</h1><p>Please find the report attached.</p>",
    plain: "Monthly Report - Please find the report attached.",
    attachments: [
        await Attachment.fromFile("/path/to/report.pdf", "application/pdf", false),
        Attachment.fromContent("data.csv", "id,name\n1,John", "text/csv", false, false),
        await Attachment.fromStream("stream.txt", Readable.from(["Hello world from a stream!"]), "text/plain", false),
    ],
    tracking: true,
    tags: {campaign: "monthly-report", type: "business"},
    headers: {
        "X-Custom-Header": "Custom Value",
        "X-Another-Header": "Another Value"
    },
    reference_id: client.getReferenceId()
});

2. Sending Emails with Templates

const referenceId = await client.sendTemplatedEmail({
    from: new EmailAddress("[email protected]", "Your App"),
    to: new EmailAddress("[email protected]", "John Doe"),
    subject: "Welcome to Our Service!",
    template_id: 123,
    template_data: {
        user_name: "John Doe",
        activation_link: "https://example.com/activate/abc123",
        company_name: "Your Company"
    }
});

3. Bulk Email Sending

const result = await client.sendBulkEmails({
    subject: "Newsletter - March 2024",
    html: "<h1>Hello {{name}}!</h1><p>Here’s your newsletter.</p>",
    plain: "Hello {{name}}! Here’s your newsletter.",
    tracking: false,
    tags: {campaign: "newsletter", month: "march"},
    messages: [
        {
            from: new EmailAddress("[email protected]", "Newsletter Team"),
            to: new EmailAddress("[email protected]", "John Doe"),
            template_data: {name: "John"}
        },
        {
            from: new EmailAddress("[email protected]", "Newsletter Team"),
            to: new EmailAddress("[email protected]", "Jane Smith"),
            template_data: {name: "Jane"}
        }
    ]
});

console.log("Bulk email reference IDs:", result);

4. Scheduling Emails

const scheduledAt = new Date(Date.now() + 24 * 3600 * 1000);

const referenceId = await client.sendBasicEmail({
    from: new EmailAddress("[email protected]", "Scheduler"),
    to: new EmailAddress("[email protected]", "Recipient"),
    subject: "Scheduled Email - Daily Report",
    html: "<h1>Daily Report</h1><p>This was scheduled.</p>",
    plain: "Daily Report - Scheduled",
    scheduled_at: scheduledAt
});

console.log("Scheduled with reference ID:", referenceId);

5. Managing Scheduled Emails

const scheduled = await client.getScheduledEmails(1, 20);

for (const email of scheduled.results) {
    console.log("Email:", email.reference_id, email.subject);
    if (email.reference_id === "cancel-me") {
        await client.deleteScheduledEmail(email.reference_id);
        console.log("Cancelled email:", email.reference_id);
    }
}

6. Deleting Scheduled Emails

const referenceId = "your-scheduled-email-reference-id";
await client.deleteScheduledEmail(referenceId);
console.log("Deleted scheduled email with reference ID:", referenceId);

API Reference

MailerooClient

new MailerooClient(apiKey: string, timeoutSec?: number)

Methods

  • sendBasicEmail(data): Promise<string>
  • sendTemplatedEmail(data): Promise<string>
  • sendBulkEmails(data): Promise<string[]>
  • getScheduledEmails(page?: number, per_page?: number): Promise<object>
  • deleteScheduledEmail(referenceId: string): Promise<boolean>
  • getReferenceId(): string

EmailAddress

new EmailAddress(address: string, displayName?: string)
  • .getAddress()
  • .getDisplayName()
  • .toJSON()

Attachment

Factory Methods:

  • Attachment.fromFile(path: string, contentType?: string, inline?: boolean): Promise<Attachment>
  • Attachment.fromContent(fileName: string, content: string|Buffer, contentType?: string, inline?: boolean, isBase64?: boolean): Attachment
  • Attachment.fromStream(fileName: string, stream: AsyncIterable<Buffer>, contentType?: string, inline?: boolean): Promise<Attachment>

Documentation

For detailed API documentation, including all available endpoints, parameters, and response formats, please refer to the Maileroo API Documentation.

License

This SDK is released under the MIT License.

Support

Please visit our support page for any issues or questions regarding Maileroo. If you find any bugs or have feature requests, feel free to open an issue on our GitHub repository.