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

@mailchainio/sdk

v0.5.16

Published

Embeddable MailChain automation-chains SDK: headless logic (island/react) + carved UI (editor canvas, node types, forms) for building and running trigger chains.

Readme

@mailchain/sdk

Embeddable SDK for MailChain automation chains — build and run trigger-based email automation flows (start trigger → wait → send email → activity condition → contact-list actions) inside your own product.

The SDK is split so you take only what you need:

| Entry | What it is | Depends on | | --- | --- | --- | | @mailchain/sdk | Core domain types & entities (chains, graphs, nodes) | — | | @mailchain/sdk/island | Headless runtime + React hooks (data, commands, editor state). No UI. | React | | @mailchain/sdk/react | The editor store (Zustand) shared across the UI | React | | @mailchain/sdk/ui | Carved editor UI — canvas, node cards, forms, primitives | React |

Partner SDK. The SDK talks to a MailChain backend and needs a partner session context token + API access to do anything. It is inert without one.

Install

npm install @mailchain/sdk

Peer dependency: React 18. The /react and /ui entries also use @xyflow/react, lucide-react, zustand and swr — your bundler provides and dedupes a single copy of each (they are declared as regular dependencies).

Quick start — chains list (headless + your own UI)

import {
  createMailchainRuntime,
  MailchainProvider,
  useChainsList,
} from '@mailchain/sdk/island';

const runtime = createMailchainRuntime({
  apiBaseUrl: 'https://your-mailchain-host/api',
  // Mint/refresh the partner context token however your host does.
  getAccessToken: async () => currentContextToken,
  permissions: {
    hasPermission: ({ resource, action }) =>
      resource === 'chains' ? myPermissions[action] : false,
  },
  navigation: { openChain: ({ chainId }) => router.push(`/chains/${chainId}`) },
});

function ChainsPage() {
  return (
    <MailchainProvider runtime={runtime}>
      <MyChainsList />
    </MailchainProvider>
  );
}

function MyChainsList() {
  const chains = useChainsList(); // { status, items, commands: { create, refresh } }
  // render items with your own components…
}

Editor UI

The /ui entry ships the carved chain editor (React Flow canvas, node cards, inspector forms). It is theme-driven: components reference design tokens as CSS variables, so you repaint by overriding those variables — no fork, no hex.

import { MailchainSkinProvider } from '@mailchain/sdk/ui';
import '@mailchain/sdk/ui/canvas-overrides.css';

<MailchainSkinProvider skin={{ '--color-indigo-600': '#4b4afb' /* your brand */ }}>
  {/* editor surface */}
</MailchainSkinProvider>;

Defaults to the canonical MailChain palette (canonSkin); pass a partial skin map to override only what differs.

Styling

The /ui components use utility classes that expand to the token CSS variables. If your app uses Tailwind, generate them by scanning the installed bundle:

/* your tailwind entry */
@source '../node_modules/@mailchain/sdk/dist/**/*.{js,mjs}';

Then define the token values (--color-*, --radius-*, --shadow-*, --font-*) in your @theme. See MailchainSkinProvider for the full token list.

Localization

Editor copy resolves through a translator you provide, so all strings live in your own i18n catalogue:

import { MailchainEditorI18nProvider, defaultEditorT } from '@mailchain/sdk/ui';

<MailchainEditorI18nProvider t={myTranslate /* (key, params) => string */}>
  {/* editor */}
</MailchainEditorI18nProvider>;

Unresolved keys fall back to defaultEditorT (bundled English). Interpolation uses {{var}}; plurals use i18next _one / _other suffixes.

Versioning

Pre-1.0 (0.x): minor versions may include breaking changes. Pin an exact version if you need stability.

License

Apache-2.0 — see the NOTICE file for attribution.