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

@sendbyte/node

v0.2.1

Published

SendByte Node.js SDK: the email API for Africa.

Readme

@sendbyte/node

The official Node.js SDK for SendByte, the email API for Africa. Zero runtime dependencies, full TypeScript types, and a surface that maps one to one onto the REST API.

Install

npm install @sendbyte/node

Requires Node 18 or newer (the SDK uses the built in fetch). ESM and CommonJS are both published.

Quickstart

import { SendByte } from '@sendbyte/node';

const sendbyte = new SendByte('sk_test_...');

const email = await sendbyte.emails.send({
  from: 'PayLink <[email protected]>',
  to: '[email protected]',
  subject: 'Receipt for your payment',
  html: '<p>Thank you. Your payment was received.</p>',
});

console.log(email.id);

Keys that start with sk_test_ run in the sandbox: every endpoint behaves the same, but nothing is actually delivered. Switch to an sk_live_ key when you are ready to send for real.

Configuration

const sendbyte = new SendByte('sk_live_...', {
  baseUrl: 'https://api.sendbyte.africa', // override for self hosted or staging
});

API

Emails

await sendbyte.emails.send({ from, to, subject, html });
await sendbyte.emails.get('em_123');
await sendbyte.emails.list({ limit: 20, status: 'delivered' });

to, cc, bcc, and reply_to accept a single address or an array. Pass idempotency_key to make retries safe, scheduled_at for future sends, and template_id with variables to render a server side template.

Domains

const domain = await sendbyte.domains.create('paylink.ng');
// domain.dns_records lists the SPF, DKIM, and DMARC records to publish
await sendbyte.domains.list();
await sendbyte.domains.get(domain.id);
await sendbyte.domains.verify(domain.id);

Webhooks

const endpoint = await sendbyte.webhooks.create({
  url: 'https://example.com/hooks/sendbyte',
  events: ['email.delivered', 'email.bounced'],
});
// endpoint.secret is shown once, store it now
await sendbyte.webhooks.list();
await sendbyte.webhooks.disable(endpoint.id);
await sendbyte.webhooks.replay('evt_123');

Verifying webhook signatures

Every webhook request carries a sendbyte-signature header. Verify it against the raw request body before trusting the payload.

import { verifyWebhookSignature } from '@sendbyte/node';

app.post('/hooks/sendbyte', (req, res) => {
  const valid = verifyWebhookSignature(
    process.env.SENDBYTE_WEBHOOK_SECRET,
    req.headers['sendbyte-signature'],
    req.rawBody, // the raw, unparsed body
  );
  if (!valid) return res.status(401).end();
  // handle req.body
  res.status(200).end();
});

The check rejects missing, malformed, tampered, and stale signatures (default tolerance is 300 seconds).

Errors

Failed requests throw a SendByteError carrying the API error shape.

import { SendByteError } from '@sendbyte/node';

try {
  await sendbyte.emails.send({ from, to, subject, html });
} catch (err) {
  if (err instanceof SendByteError) {
    console.error(err.code, err.status, err.message, err.docsUrl);
  }
}

Links

  • Documentation: https://docs.sendbyte.africa
  • API reference: https://docs.sendbyte.africa

License

MIT