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

@meui-creative/meter

v0.1.0

Published

Transactional email counter for the MEUI hosting meter — wraps a Payload email adapter and pings the internal collector after each successful send (fire-and-forget, idempotent retries)

Readme

@meui-creative/meter

Transactional email counter for the MEUI hosting meter. Wraps a Payload CMS email adapter and pings the internal collector after each successful send — fire-and-forget, with retries and idempotency ids so a retry can never double-count and a failing ping can never break sending.

Pageview counting needs no package — sites include the snippet served by the admin app:

<script defer src="https://studio.meui.cz/m.js" data-key="YOUR_METER_KEY"></script>

Installation

bun add @meui-creative/meter

payload (v3+) is a peer dependency — the package is meant to be used inside payload.config.ts.

Usage

import { withMeter } from '@meui-creative/meter'
import { resendAdapter } from '@payloadcms/email-resend'

export default buildConfig({
  email: withMeter(
    resendAdapter({
      defaultFromAddress: '[email protected]',
      defaultFromName: 'Example',
      apiKey: process.env.RESEND_API_KEY || '',
    }),
  ),
})

Works with any Payload email adapter (Resend, Nodemailer/SES/SMTP, Mailjet, …) and also covers Payload-internal emails (password reset, verification).

For sends that bypass the adapter (direct provider SDK calls, batch APIs):

import { countEmails } from '@meui-creative/meter'

countEmails(recipients.length) // one logical send, N emails

Environment variables

One variable is enough:

METER_KEY=ab12cd34xy                 # site without transactional emails
METER_KEY=ab12cd34xy.NmQ3ZTk0...    # site with emails: <key>.<secret>

The key is base62 and the secret base64url — neither can contain a dot, so splitting on the first dot is unambiguous. Only the part before the dot may ever reach the browser (the snippet's data-key); use publicMeterKey() or process.env.METER_KEY?.split('.')[0] in your layout:

{process.env.METER_KEY && (
  <script defer src="https://studio.meui.cz/m.js" data-key={process.env.METER_KEY.split('.')[0]} />
)}

| Variable | Required | Purpose | | -------------- | -------- | ------------------------------------------------------------------------------ | | METER_KEY | yes | Site key, optionally combined <key>.<secret>. | | METER_SECRET | no | Secret separately (wins over the combined form). Never ship it client-side. | | METER_URL | no | Collector override. Defaults to https://studio.meui.cz/api/meter. |

Without a key + secret the wrapper is a transparent no-op — safe to keep in code on staging/preview environments.

Semantics

  • Counts accepted-by-provider sends (industry ESP billing semantics), not delivery.
  • A failed sendEmail (throw) is not counted.
  • Pings retry 3× with backoff; each logical send carries one idempotency id (i), the collector deduplicates.
  • The meter can never break sending — every failure path is swallowed.

Wire contract (v1) and collector design: meui-studio/docs/Project Management/hosting-meter.md.