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

@inbin/cloudflare

v0.1.0

Published

Forward Cloudflare email (Email Workers / Agents SDK onEmail) to Inbin: raw RFC-822 in, schema-validated JSON with per-field trust labels out.

Readme

@inbin/cloudflare

Forward Cloudflare email to Inbin. Raw RFC-822 in, schema-validated JSON out, with a hallucination guard and per-field trust labels, before your agent acts on any of it.

Cloudflare's Email Service gives your Worker or agent an inbox. It also hands you raw email, the one input format written by strangers that agents read as instructions. This package is the missing layer: one call sends the message through Inbin's live pipeline (extraction against your schema, guard-verified values, field_trust labels, webhook delivery, MCP availability).

Install

npm install @inbin/cloudflare

From an Email Worker

Route an address (or a catch-all) to a Worker under Email Routing, then:

import { forwardToInbin } from "@inbin/cloudflare";

export default {
  async email(message, env) {
    await forwardToInbin(message, {
      apiKey: env.INBIN_API_KEY, // wrangler secret put INBIN_API_KEY
      inbox: env.INBIN_INBOX,    // your inbox slug, e.g. "a3f2c8"
    });
  },
};

From the Agents SDK (onEmail)

import { forwardToInbin } from "@inbin/cloudflare";

async onEmail(email) {
  const { event_id } = await forwardToInbin(email, {
    apiKey: this.env.INBIN_API_KEY,
    inbox: this.env.INBIN_INBOX,
  });

  // Read back typed, guarded fields instead of parsing raw email:
  const event = await fetch(
    "https://api.inbin.dev/v1/events/" + event_id,
    { headers: { authorization: "Bearer " + this.env.INBIN_API_KEY } },
  ).then((r) => r.json());

  // event.extracted   -> your schema's fields, verbatim-verified
  // event.field_trust -> "typed" vs "untrusted_text", per field
  // event.sender_auth -> SPF/DKIM/DMARC from the transport's own header
}

Behavior

  • Idempotent. Re-forwarding the same message (same Message-Id) returns the original event with deduped: true, so retries from the email runtime are safe.
  • Live. Events are dated by receipt and fire your webhook. For importing archives use POST /v1/backfill instead (dated by the original Date: header, never fires the live webhook).
  • Auth verdicts. SPF/DKIM/DMARC are parsed server-side from the message's own Authentication-Results header (Cloudflare stamps one); they surface on the event as sender_auth.
  • Failures throw. Non-2xx responses raise InbinIngestError (status + body). In an Email Worker, an uncaught throw makes Cloudflare report a delivery failure to the sender; catch it if you prefer to swallow failures.
  • Limits. Raw messages up to 10MB.

Full walkthrough: inbin.dev/guides/cloudflare-email-agents API docs: inbin.dev/docs

MIT © Inbin