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

yoursend

v0.3.0

Published

YourSend SDK — send and verify OTPs via email, SMS, voice, WhatsApp, and flashcall.

Readme

yoursend

Official Node.js SDK for the YourSend multi-channel messaging API.

Send and verify OTPs via email, SMS, voice, WhatsApp, and flashcall — all from a single unified API.

Install

npm install yoursend

Quick Start

import YourSend from 'yoursend';

const ys = new YourSend({ apiKey: 'ys_live_...' });

// Send an email
const { message_id } = await ys.send({
  channel: 'email',
  to: '[email protected]',
  subject: 'Welcome!',
  body: '<h1>Hello from YourSend</h1>',
});

// Send an SMS OTP
const otp = await ys.send({
  channel: 'sms',
  to: '+15551234567',
});

// Verify the OTP
const result = await ys.check({
  message_id: otp.message_id,
  code: '123456',
});

console.log(result.verified); // true

API Reference

Core Methods

ys.send(options) — Send a message

const res = await ys.send({
  channel: 'email',        // 'email' | 'sms' | 'voice' | 'whatsapp' | 'flashcall' | 'auto'
  to: '[email protected]',
  subject: 'Hello',        // email only
  body: '<h1>Hi</h1>',     // html for email, text for sms
  template_id: '...',      // use a saved template
  data: { name: 'Alice' }, // merge tag values
  fallback: 'sms',         // fallback channel on failure
  expires_in: 10,          // OTP expiry in minutes (default: 10)
  tags: ['onboarding'],
});
// => { message_id, status, channel, to, expires_at? }

ys.check(options) — Verify an OTP

const res = await ys.check({
  message_id: '...',
  code: '590075',
});
// => { message_id, status, verified, remaining_attempts? }

ys.status(messageId) — Get delivery status

const msg = await ys.status('msg_...');
// => { id, to_address, channel, status, otp_verified, sent_at, delivered_at, ... }

ys.lookup(phoneNumber) — Phone number lookup

const info = await ys.lookup('+15551234567');
// => { phone_number, country_code, carrier, type }

ys.usage(options?) — Usage statistics

const stats = await ys.usage({ period: 'month' });
// => { period, from, to, total, by_channel: { email: 42, sms: 18 } }

Resource Namespaces

Messages

const { data, pagination } = await ys.messages.list({ page: 1, limit: 20 });
const message = await ys.messages.get('msg_...');

Templates

const { templates } = await ys.templates.list();

const tpl = await ys.templates.create({
  name: 'Welcome',
  channel: 'email',
  subject: 'Welcome {{name}}!',
  html_body: '<h1>Hello {{name}}</h1>',
  merge_tags: ['name'],
});

await ys.templates.update(tpl.id, { description: 'Updated' });
await ys.templates.delete(tpl.id);

Contacts

const { contacts } = await ys.contacts.list({ limit: 50 });

const contact = await ys.contacts.create({
  email: '[email protected]',
  name: 'Alice',
  tags: ['vip'],
});

await ys.contacts.update(contact.id, { name: 'Alice Smith' });

Webhooks

const { webhooks } = await ys.webhooks.list();

const hook = await ys.webhooks.create({
  url: 'https://example.com/webhook',
  events: ['sent', 'delivered', 'verified'],
});
// => { id, url, events, secret }   ← save the secret for HMAC verification

await ys.webhooks.delete(hook.id);

Blasts

const { blasts } = await ys.blasts.list();

const blast = await ys.blasts.create({
  name: 'Product Launch',
  channel: 'email',
  template_id: 'tpl_...',
});

Domains

const { domains, primary_domain } = await ys.domains.list();

const { records } = await ys.domains.create({ domain: 'example.com' });
// => returns DNS records to add

const verification = await ys.domains.verify({ domain: 'example.com' });
// => { domain, status, spf_verified, dkim_verified }

await ys.domains.delete({ domain: 'example.com' });

Error Handling

try {
  await ys.send({ channel: 'email', to: 'bad' });
} catch (err) {
  console.log(err.message);  // "Invalid email format"
  console.log(err.code);     // "invalid_request"
  console.log(err.status);   // 400
}

Configuration

const ys = new YourSend({
  apiKey: 'ys_live_...',
  baseUrl: 'https://api.yoursend.dev', // default
});

License

MIT