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

reactjs-mail

v4.0.0

Published

A tiny JS SDK to send emails via your API

Readme

Email Sender API Integration

npm version

Integrate seamless email sending functionality into your applications using the Email Sender API. This README provides essential information for getting started, authentication, API endpoints, and code examples.

Documentation and Support

For more detailed information about the API, including advanced usage, error handling, and best practices, please refer to the full API documentation:

Link to your API Documentation Website

If you have any questions, encounter issues, or need support, please visit our support page or contact us:

Link to your Support Website or Contact Information

Website

Visit our website to learn more about our services and offerings:

Link to your Main Website

Keywords

Email API, Email Sending, REST API, Integration, SaaS, Authentication, Rate Limiting, Send Email, Check Quota, Webhooks

Overview

This API allows developers to programmatically send emails and check their sending quota. It's designed for easy integration into various applications, from simple scripts to complex web platforms.

Base URL

All API requests should be made to the following base URL:

https://saas-email-production.up.railway.app/api

Authentication

All API requests require authentication via an API key. You must include your API key in the x-api-key header of each request.

x-api-key: YOUR_API_KEY

Remember to replace YOUR_API_KEY with your actual API key.

Rate Limiting

To ensure fair usage and prevent abuse, the API implements rate limiting. The limits vary based on your subscription tier:

  • Free tier: 10 emails per minute, 100 per hour, 1,000 per day
  • Standard tier: 50 emails per minute, 500 per hour, 5,000 per day
  • Premium tier: 100 emails per minute, 1,000 per hour, 10,000 per day

Be mindful of these limits when integrating the API into your application.

API Endpoints

1. Send Email

This endpoint allows you to send emails to one or more recipients.

Method: POST Endpoint: /api/email/send

Request Headers:

  • Content-Type: application/json
  • x-api-key: YOUR_API_KEY

Request Body Parameters (JSON):

| Parameter | Type | Required | Description | | :---------- | :----- | :------- | :-------------------------------------------------------------------------- | | to | string | Yes | Email address of the recipient(s). Can be a single address or an array. | | subject | string | Yes | Subject line of the email. | | text | string | Yes | Plain text content of the email. Either text or html is required. | | html | string | Yes | HTML content of the email. Either text or html is required. | | from | string | Yes | Email address of the sender. Defaults to the system's address. | | replyTo | string | No | Email address where replies should be sent. | | attachments | string | No | (Note: Not mentioned in the provided documentation, but a common feature) | | contentType | string | No | (Note: While you mentioned it in your function, it's usually inferred from the presence of text or html) |

Example cURL Request:

curl -X POST https://saas-email-production.up.railway.app/api/email/send \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "to": "[email protected]",
    "subject": "Hello from the API",
    "text": "This is a test email sent from the API"
  }'

2. Check Quota

This endpoint allows you to check your current email sending quota and usage.

Method: GET
Endpoint: /api/email/quota

Request Headers:

x-api-key: YOUR_API_KEY

Response (JSON):

{
  "quota": 1000,
  "used": 25,
  "remaining": 975
}

Code Examples

The documentation provides code examples in various programming languages:

  • cURL
  • Node.js
  • React.js
  • PHP

Refer to the original documentation for these examples.

Webhooks (Upcoming)

The API plans to support webhooks in a future version. Webhooks will allow your application to receive real-time updates about email events such as delivery, opening, clicks, bounces, and complaints.


Integrating Your sendEmail Function as an npm Package

Here's how to structure it as a package:

1. Create package.json

{
  "name": "your-package-name",
  "version": "1.0.0",
  "description": "A simple email sending utility for the Email Sender API",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Your Name",
  "license": "ISC",
  "dependencies": {
    "node-fetch": "^3.0.0"
  }
}

2. Publish to npm (Optional)

cd email-sender
npm publish

3. Usage Example

const sendEmail = require('your-package-name');

async function main() {
  try {
    const result = await sendEmail({
      apiKey: "ems_Hr7gMyXSB",
      to: "kushalhail.com",
      from: "[email protected]",
      subject: "Hello from my npm package!",
      text: "This is a test email sent using my custom npm package.",
    });
    console.log('Email sent successfully:', result);
  } catch (error) {
    console.error('Failed to send email:', error.message);
  }
}

main();

Author

Kushal Khandelwal