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

story-teller-chat-gpt-login

v0.1.0

Published

Standalone CLI that authenticates a Story Teller user with ChatGPT (OpenAI Codex) via OAuth and stores the tokens in the backend.

Readme

chatgpt-login

Standalone CLI that connects a Story Teller account to ChatGPT (OpenAI Codex) via OAuth.

Why this exists

OpenAI's Codex OAuth client only allows the redirect URI http://localhost:1455/auth/callback, so the login callback can only be received on the user's own machine — a deployed backend can never catch it.

This tool runs that local listener: it opens the browser, captures the OAuth callback on port 1455, then forwards the authorization code and PKCE codeVerifier to the Story Teller backend. The backend performs the token exchange and stores the credentials against your account (POST /api/v1/auth/chatgpt/exchange).

Usage

You need:

  • API base URL of your Story Teller backend (e.g. https://api.example.com, or http://localhost:1455 when running it locally).
  • Link token — a one-time token the app issues when you click "Connect ChatGPT". The frontend calls POST /api/v1/auth/chatgpt/link (Clerk-guarded) and shows you the ready-to-run command with the token baked in. The token is valid for ~15 minutes and is single-use.

Run it without installing (this is the command the app shows you):

npx story-teller-login --api https://api.example.com --token <link-token>

Or via environment variables (the CLI prompts for anything missing):

STORYTELLER_API_URL=https://api.example.com \
STORYTELLER_TOKEN=<link-token> \
npx story-teller-login

From a checkout of this repo (e.g. local development):

npx ./tools/chatgpt-login --api https://api.example.com --token <link-token>
node tools/chatgpt-login/index.mjs   # equivalent

Publishing

The package is pure Node built-ins (no build step). To release a new version:

cd tools/chatgpt-login
npm version patch        # bump version
npm publish              # public by default (unscoped name)

Flags

| Flag | Env | Description | | --------------- | --------------------- | --------------------------------- | | --api <url> | STORYTELLER_API_URL | Story Teller API base URL | | --token <tok> | STORYTELLER_TOKEN | One-time link token from the app | | -h, --help | | Show help |

Notes

  • Requires Node 18+ (uses the built-in fetch). No npm dependencies.
  • Port 1455 must be free. If your local backend is already bound to it, stop it first (or run this on a different machine than the backend).
  • Link tokens expire after ~15 minutes and are single-use. If the exchange fails with "Invalid or expired link token", click "Connect ChatGPT" again to get a fresh command.
  • Link tokens are stored in-memory on the backend, so they don't survive a restart and only work with a single backend instance.