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

@snag-tech/react

v0.3.3

Published

Snag — in-app change requests that launch AI coding agents. React web SDK.

Readme

@snag-tech/react

Add an in-app “fix this” button to your staging or internal build. Testers describe a change on the screen they’re looking at; Snag sends it (with a screenshot) to your team’s coding agent.

You need two values from your Snag admin before you start:

  • endpoint — relay URL
  • projectKey — your app’s snag_pk_... key

1. Install

npm install @snag-tech/react

Or from a tarball your admin provides:

npm install ./snag-react-0.1.0.tgz

Requires React 18+.


2. Add environment variables

Only set these in dev/staging. Leave them unset in production — the button won’t appear.

Vite (.env.local):

VITE_SNAG_ENDPOINT=https://<project-ref>.supabase.co/functions/v1/relay
VITE_SNAG_PROJECT_KEY=snag_pk_...

Next.js (.env.local):

NEXT_PUBLIC_SNAG_ENDPOINT=https://<project-ref>.supabase.co/functions/v1/relay
NEXT_PUBLIC_SNAG_PROJECT_KEY=snag_pk_...

Restart the dev server after changing env files.


3. Add two lines to your app

Call initSnag once at startup, then mount <SnagOverlay /> at the root.

Vite / CRA:

import { initSnag, SnagOverlay } from "@snag-tech/react";

initSnag({
  endpoint: import.meta.env.VITE_SNAG_ENDPOINT,
  projectKey: import.meta.env.VITE_SNAG_PROJECT_KEY,
  getContext: () => ({
    route: window.location.pathname,
    environment: "staging",
  }),
  getRequester: () => "demo-user",
});

export function App() {
  return (
    <>
      {/* your app */}
      <SnagOverlay />
    </>
  );
}

Next.js — use a client component ("use client") and NEXT_PUBLIC_* env vars. Mount once in layout.tsx.


That’s it

  • If env vars are set and your project is enabled, a floating button appears.
  • If not, nothing renders — safe to ship the code in all builds.
  • To turn Snag off remotely, your admin disables the project — no deploy needed on your side.

Optional

| Option | What it does | |--------|----------------| | getContext | Attach route, version, environment to every request (merged on top of auto-captured snag_auto) | | getRequester | Display id for who filed the request — shown in the list; Mine defaults on when set. When follow-ups are on, Needs reply also defaults on (only needs_input) | | getAuthToken | Send Authorization: Bearer when the user is logged in | | theme | Override button/panel colors | | debug: true | Log probe/request details to the console |


Troubleshooting

| Problem | Fix | |---------|-----| | No button | Check env vars, restart dev server, ask admin to confirm project is enabled | | Button was working, now gone | Admin may have disabled the project — contact them | | Request fails | Usually repo/agent config on the admin side — send them the error |


Security note

projectKey is visible in your JS bundle (like an analytics write key). Only use Snag on non-production builds with non-sensitive data — screenshots capture the real screen. Do not put secrets or PII in getContext or getRequester.