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

@sprigr/apps-redact

v0.1.1

Published

Strip credential values out of strings before an app writes them to a durable store (audit rows, last_error columns).

Readme

@sprigr/apps-redact

One function, redactSecrets(text), that strips credential-shaped values out of a string before it is written somewhere durable.

import { redactSecrets } from '@sprigr/apps-redact';

await env.DB.prepare('INSERT INTO my_audit (kind, detail) VALUES (?, ?)')
  .bind(kind, redactSecrets(detail).slice(0, 1000))
  .run();

Why

Apps persist failure detail into per-install audit tables (*_audit.detail, *_audit.error, *.last_error), and several of them read those rows back to an agent tool caller or render them on the app's public settings page. The strings that land there are usually built by interpolating a provider's raw HTTP response body into an Error message. A token endpoint's error body is provider-controlled and echoes back the request that failed, so an authorization code, a client_secret or a refresh_token can reach a durable column with a length cap as the only transform. See issue sprigr/sprigr-apps#560.

Policy

Removed (replaced with the visible marker [redacted]):

  • JSON and form-encoded values whose KEY names a credential: anything containing secret, token, password, credential, api_key, authorization, private_key, signature, hmac, cookie, plus code_verifier, assertion, pwd.
  • Values under an AMBIGUOUS key (code, state, nonce, auth, signature, hmac, session_id) only when the value itself looks like a credential rather than a symbolic error code. "code":"PERMISSION_DENIED" survives; code=4/0AVMBsJi... does not.
  • Bare credentials recognisable by their own prefix, with no key at all: Bearer/Basic header values, JWTs, ya29., 1//, GOCSPX-, AIza, shpat_/shpca_/shppa_/shpss_, xoxb-/xapp-, EAA…, ATATT, sk-, ghp_/gho_/ghu_/ghs_/ghr_.
  • Any of the above inside JSON that was serialised into a string value (an upstream error body stringified into an error or detail field), up to three layers deep. A nested value with nothing to remove comes back byte-for-byte (0.1.1).

Kept, because the audit row exists to be debugged from:

  • HTTP status codes, provider error codes (invalid_grant, PERMISSION_DENIED), error_description text, client_id, trace and correlation ids, URLs, resource identifiers.
  • Keys that contain a trigger fragment but are not secrets: token_type, expires_in, token_endpoint, error*.

Never truncates. Callers keep their own caps; this function only replaces matched values.

Limits

It is a textual filter, not a proof of absence. A novel credential format with no recognisable key name and no recognisable prefix passes through. Treat it as defence in depth behind "do not interpolate raw bodies into messages in the first place" (which is what @sprigr/apps-oauth-utils now does), not as a licence to.

Consuming it

Depend on the published package at an exact version and import it by name:

{ "dependencies": { "@sprigr/apps-redact": "0.1.0" } }