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

@mythos-work/sdk

v0.0.5

Published

Official Mythos SDK for Node.js — launch token verification, usage reporting, and handshake

Readme

@mythos-work/sdk

Official Mythos SDK for Node.js — launch token verification, usage reporting, and handshake.

Install

npm install @mythos-work/sdk

Quick start

import { requireLaunchToken, reportUsage, handshakeRoute, listingCallbackRoute } from '@mythos-work/sdk';
import express from 'express';

const app = express();
const listingIds = new Set<string>(); // populated by listingCallbackRoute

// Handshake endpoint — Mythos pings this before publishing your listing
app.use(handshakeRoute());

// Listing registration callback — Mythos calls this after your listing is registered
app.post('/.well-known/mythos-listing-registered', listingCallbackRoute(async (listingId) => {
  listingIds.add(listingId); // persist so resolveListingIds can read it
}));

// Protected route — verifies and consumes the launch token automatically
app.get(
  '/dashboard',
  requireLaunchToken({ resolveListingIds: async () => Array.from(listingIds) }),
  async (req, res) => {
    // req.mythos = { userId, email, displayName, listingId, sessionJti }
    await reportUsage(req.mythos.sessionJti, { credits: 1, reason: 'page-view' });
    res.json({ ok: true });
  },
);

Environment variables

| Variable | Required | Default | Description | | ----------------------| ----------| ---------------------------| -----------------------------------------------| | MYTHOS_LISTING_ID | No* | — | Your listing ID | | MYTHOS_LISTING_IDS | No* | — | Comma-separated listing IDs (overrides above) | | MYTHOS_API_URL | No | https://api.mythos.work | API base URL override |

*Optional when you provide resolveListingIds; otherwise one of MYTHOS_LISTING_ID or MYTHOS_LISTING_IDS is required.

API

requireLaunchToken({ resolveListingIds? })

Express middleware. Verifies the RS256 launch token from ?lt=, enforces single-use semantics, and attaches req.mythos to the request. Listing IDs are read from MYTHOS_LISTING_ID(S) by default; pass resolveListingIds to supply them dynamically (e.g. from storage populated by listingCallbackRoute). Returns 401 if the token is missing, invalid, or already consumed.

reportUsage(sessionJti, { credits, reason? })

Reports credit consumption against a session. Call after delivering value to the user.

handshakeRoute()

Returns an Express Router that mounts GET /.well-known/mythos-handshake. Use app.use(handshakeRoute()) so the backend can reach the designated address during listing publish.

listingCallbackRoute(onRegistered)

Returns an Express RequestHandler. Mount it at the listing callback URL you configure. It validates the ?lt= token, calls onRegistered(listingId) on success, and responds with { ok: true }. Use the callback to persist the listing ID so resolveListingIds can read it. Returns 401 for missing/invalid tokens and 503 for unexpected errors.

verifyLaunchToken(token, { resolveListingIds? })

Low-level token verifier. Validates the launch token and returns the decoded MythosSession. Listing IDs are read from MYTHOS_LISTING_ID(S) by default; pass resolveListingIds to supply them dynamically. Use requireLaunchToken() middleware instead for most cases.

Security

  • Tokens verified via RS256 against the Mythos JWKS endpoint
  • alg: none rejected as a hard block
  • Single-use enforcement is non-skippable (ADR-0003)
  • JWKS keys cached 10 minutes with automatic re-fetch on key rotation

License

Apache-2.0 — see LICENSE.