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

@sendmux/sending

v1.6.0

Published

[![npm version](https://img.shields.io/npm/v/@sendmux%2Fsending)](https://www.npmjs.com/package/@sendmux/sending) [![CI](https://github.com/Sendmux/sendmux-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/Sendmux/sendmux-sdk/actions/workflows/c

Readme

@sendmux/sending

npm version CI npm downloads Licence

Generated TypeScript client for the Sendmux Sending API.

Documentation

Requirements

  • A send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token; alternatively, a REST OAuth grant for this surface.
  • A JavaScript runtime with the standard Fetch API.

Installation

npm install @sendmux/sending

OAuth access tokens

Pass accessToken instead of apiKey for a REST OAuth token or synchronous/asynchronous provider.

import { createSendingClient } from "@sendmux/sending";

const client = createSendingClient({
  accessToken: () => process.env.SENDMUX_ACCESS_TOKEN!,
});

The provider runs before each request. Your application owns token storage and refresh; required scopes still apply. See OAuth setup.

Usage

import {
  createSendingClient,
  sendingSendEmail,
} from "@sendmux/sending";

const client = createSendingClient({
  apiKey: process.env.SENDMUX_SENDING_API_KEY!,
});

const response = await sendingSendEmail({
  client,
  body: {
    from: { email: "[email protected]" },
    to: { email: "[email protected]" },
    subject: "Hello from Sendmux",
    html_body: "<p>Hello.</p>",
    text_body: "Hello.",
  },
});

console.log(response.data?.data.message_id);

The package exports every generated Sending operation plus:

  • createSendingClient
  • configureSending
  • SendingClient
  • Node-only helpers from @sendmux/sending/node: uploadAttachmentFromFile, sendEmailWithFiles, and explicit legacy attachmentFromFile

Attachments

For real files, upload bytes first and send with returned attachment_id refs. sendEmailWithFiles does that automatically, so file bytes never enter model context or the JSON send body. Inline base64 remains available only when you intentionally call attachmentFromFile for tiny generated content.

import { createSendingClient } from "@sendmux/sending";
import { sendEmailWithFiles } from "@sendmux/sending/node";

const client = createSendingClient({ apiKey: process.env.SENDMUX_SENDING_API_KEY! });

await sendEmailWithFiles({
  client,
  files: ["./report.pdf"],
  headers: { "Idempotency-Key": "report-123" },
  body: {
    from: { email: "[email protected]" },
    to: { email: "[email protected]" },
    subject: "Report",
    html_body: "<p>Attached.</p>",
  },
});

To upload first and compose the send yourself:

import { createSendingClient, sendingSendEmail } from "@sendmux/sending";
import { uploadAttachmentFromFile } from "@sendmux/sending/node";

const client = createSendingClient({ apiKey: process.env.SENDMUX_SENDING_API_KEY! });
const attachment = await uploadAttachmentFromFile({ client, filePath: "./report.pdf" });

await sendingSendEmail({
  client,
  body: {
    from: { email: "[email protected]" },
    to: { email: "[email protected]" },
    subject: "Report",
    html_body: "<p>Attached.</p>",
    attachments: [{ attachment_id: attachment.data.attachment_id }],
  },
});

Request helpers

Use @sendmux/core when you need idempotency, conditional request, pagination, retry, or typed-error helpers.

import { idempotencyHeaders } from "@sendmux/core";
import { createSendingClient, sendingSendEmail } from "@sendmux/sending";

const client = createSendingClient({
  apiKey: process.env.SENDMUX_SENDING_API_KEY!,
});

await sendingSendEmail({
  client,
  body: {
    from: { email: "[email protected]" },
    to: { email: "[email protected]" },
    subject: "Receipt",
    html_body: "<p>Thanks.</p>",
    text_body: "Thanks.",
  },
  headers: idempotencyHeaders("email_123"),
});

Support

Open an issue in Sendmux/sendmux-sdk with the package name, version, and request ID from any API error.

Licence

MIT. See the licence file.