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

@forwardimpact/svcghuser

v0.1.3

Published

GitHub user authentication — per-user OAuth token lifecycle for the Kata Agent User App.

Readme

GitHub User Authentication

GitHub user authentication — per-user OAuth token lifecycle for the Kata Agent User App.

For configuring this GitHub user App (self-hosted vs hosted), see github-app.md. The separate server/installation app is documented in services/ghserver.

Prerequisites

  • A Kata Agent User GitHub App (user-to-server auth model) with "Expire user authorization tokens" enabled and the permissions the dispatch workflow requires (e.g. actions:write).
  • The App's Client ID and a generated Client Secret.

Configuration (loaded via createServiceConfig("ghuser")):

| Env var | Purpose | | --- | --- | | SERVICE_GHUSER_URL | Listen URL (default grpc://localhost:3009) | | SERVICE_GHUSER_CLIENT_ID | Kata Agent User App client ID | | SERVICE_GHUSER_CLIENT_SECRET | Kata Agent User App client secret | | SERVICE_GHUSER_LINK_BASE_URL | Public URL of the oauth service (used in LinkRequired.authorize_url) |

Running

Add ghuser and oauth to config/config.json under init.services — see config/CLAUDE.md for the entry format. List oauthtunnel with the other tunnels (before services) so that restarting ghuser does not cycle the tunnel (declaration order determines restart scope). List ghuser before oauth (dependency first).

Start both services:

bunx fit-rc start

The tunnel uses a quick trycloudflare.com hostname that changes on every restart. After starting, check the tunnel log for the assigned URL:

cat data/logs/oauthtunnel/current | grep trycloudflare.com

GitHub App callback configuration

In the App settings (github.com/settings/apps/<app>):

  1. Set Callback URL to https://<tunnel-domain>/callback.
  2. Save changes.

Set SERVICE_GHUSER_LINK_BASE_URL in .env to the tunnel domain (without any path), then restart only the auth services:

bunx fit-rc restart ghuser

The tunnel keeps its hostname across service restarts.

Token bindings are persisted as JSONL under data/ghuser/ via libstorage (the standard createStorage path — no extra env var needed).

Corporate network considerations

The service must be able to reach github.com to exchange authorization codes and refresh tokens. If you are on a corporate VPN with tenant restrictions, disconnect before starting.

Smoke test

Visit the authorize URL in a browser:

https://<tunnel-domain>/authorize?surface=test&surface_user_id=you

The flow:

  1. Redirects to GitHub to authorize the Kata Agent User App.
  2. GitHub calls back to /callback on the oauth service.
  3. ghuser exchanges the authorization code for a user-to-server token.
  4. The binding is stored in data/ghuser/bindings.jsonl.
  5. The browser shows "Linked — Your account has been linked."

Verify the binding via gRPC:

const result = await client.GetToken({ surface: "test", surface_user_id: "you" });
// result.token → "ghu_..."

For an unlinked user, GetToken returns link_required with the authorize URL. For a revoked or expired token that cannot be refreshed, it returns re_auth_required.