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

reloop-email

v1.0.2

Published

Official Reloop Node.js SDK for integrating with Reloop services

Readme

reloop-email

Official Reloop Node.js SDK for integrating with Reloop services.

Installation

npm install reloop-email

Quick Start

import Reloop from 'reloop-email';

const reloop = new Reloop({
  url: 'https://reloop.sh',
  key: 'your-api-key'
});

// Send an email
const result = await reloop.mail.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Hello',
  text: 'Hello World!'
});

Configuration

The Reloop SDK requires two configuration parameters:

  • url - Your Reloop API base URL (e.g., https://reloop.sh)
  • key - Your API key
const reloop = new Reloop({
  url: 'https://reloop.sh',
  key: 'your-api-key'
});

Services

Mail Service

Send emails through the Reloop mail service.

Send Email

const result = await reloop.mail.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Hello',
  text: 'Plain text content',
  html: '<h1>HTML content</h1>',
  replyTo: '[email protected]',
  cc: '[email protected]',
  bcc: ['[email protected]', '[email protected]']
});

console.log(result.messageId);

Domain Service

Manage domains and DNS records.

Create Domain

const domain = await reloop.domain.create({
  domain: 'send.example.com'
});

Get Domain

const domain = await reloop.domain.get('send.example.com');

List Domains

const domains = await reloop.domain.list({
  page: 1,
  limit: 10,
  status: 'active'
});

Delete Domain

await reloop.domain.delete('send.example.com');

DNS Operations

// Get DNS records
const records = await reloop.domain.getDNSRecords('send.example.com');

// Get DKIM keys
const dkimKeys = await reloop.domain.getDKIMKeys('send.example.com');

// Verify DNS record
const verification = await reloop.domain.verifyDNSRecord('send.example.com', {
  recordType: 'TXT',
  name: '_reloop',
  value: 'verification-value'
});

// Generate DNS records
const generatedRecords = await reloop.domain.generateDNSRecords('send.example.com');

// Delete DNS records
await reloop.domain.deleteDNSRecords('send.example.com');

Webhook Service

Manage webhooks for event notifications.

Create Webhook

const webhook = await reloop.webhook.create({
  name: 'My Webhook',
  url: 'https://example.com/webhook',
  secret: 'webhook-secret',
  rateLimitEnabled: true,
  maxRequestsPerMinute: 60
});

Get Webhook

const webhook = await reloop.webhook.get('webhook-id');

List Webhooks

const webhooks = await reloop.webhook.list({
  page: 1,
  limit: 10,
  status: 'active'
});

Update Webhook

const updated = await reloop.webhook.update('webhook-id', {
  name: 'Updated Webhook Name',
  status: 'paused'
});

Delete Webhook

await reloop.webhook.delete('webhook-id');

Audience Service

Manage audiences and audience groups.

Create Audience

const audience = await reloop.audience.create({
  email: '[email protected]',
  firstName: 'John',
  lastName: 'Doe',
  audienceGroupId: 'group-id',
  status: 'subscribed'
});

Get Audience

const audience = await reloop.audience.get('audience-id');

List Audiences

const audiences = await reloop.audience.list({
  page: 1,
  limit: 10,
  status: 'subscribed',
  audienceGroupId: 'group-id'
});

Update Audience

const updated = await reloop.audience.update('audience-id', {
  firstName: 'Jane',
  lastName: 'Smith'
});

Delete Audience

await reloop.audience.delete('audience-id');

Bulk Import Audiences

const result = await reloop.audience.bulkImport({
  audienceGroupId: 'group-id',
  audiences: [
    {
      email: '[email protected]',
      firstName: 'User',
      lastName: 'One'
    },
    {
      email: '[email protected]',
      firstName: 'User',
      lastName: 'Two'
    }
  ]
});

console.log(`Imported ${result.successful} audiences`);
console.log(`Failed: ${result.failed}`);

Subscribe/Unsubscribe Audience

// Subscribe
await reloop.audience.subscribe('audience-id', {
  reason: 'User opted in'
});

// Unsubscribe
await reloop.audience.unsubscribe('audience-id', {
  reason: 'User opted out'
});

Search Audiences

const results = await reloop.audience.search({
  query: '[email protected]',
  page: 1,
  limit: 10
});

Audience Groups

// Create audience group
const group = await reloop.audience.createGroup({
  name: 'My Audience Group',
  description: 'Group description'
});

// Get audience group
const group = await reloop.audience.getGroup('group-id');

// List audience groups
const groups = await reloop.audience.listGroups({
  page: 1,
  limit: 10
});

// Update audience group
const updated = await reloop.audience.updateGroup('group-id', {
  name: 'Updated Group Name'
});

// Delete audience group
await reloop.audience.deleteGroup('group-id');

Error Handling

The SDK provides custom error classes for better error handling:

import {
  ReloopError,
  APIError,
  AuthenticationError,
  NotFoundError,
  RateLimitError,
  ServerError,
  ValidationError
} from 'reloop-email';

try {
  await reloop.mail.send({...});
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Authentication failed');
  } else if (error instanceof NotFoundError) {
    console.error('Resource not found');
  } else if (error instanceof RateLimitError) {
    console.error('Rate limit exceeded');
  } else if (error instanceof APIError) {
    console.error(`API error: ${error.message} (${error.statusCode})`);
  } else {
    console.error('Unknown error:', error);
  }
}

TypeScript Support

The SDK is written in TypeScript and provides full type definitions. All request and response types are exported:

import type {
  SendEmailRequest,
  SendEmailResponse,
  DomainResponse,
  WebhookResponse,
  AudienceResponse
} from 'reloop-email';

Requirements

  • Node.js >= 18.0.0

License

Apache-2.0

Support

  • Documentation: https://reloop.sh/docs
  • Issues: https://github.com/reloop-labs/reloop/issues