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

@polymerdao/ts-token

v0.1.0

Published

Token authentication helpers for Polymer's Prove API, ready for Cloudflare Workers and Next.js Edge runtimes.

Readme

ts-token

Utility helpers for creating and verifying Polymer auth tokens in Cloudflare Workers, Next.js (Edge/Pages), or any other runtime that exposes standard Web APIs.

Installation

npm install @polymerdao/ts-token

Usage

import { create, verify } from '@polymerdao/ts-token';

const body = JSON.stringify({ jsonrpc: '2.0', method: 'proof_request', params: [] });

// Generate a token for your fetch call
const token = create({
  body,
  urlPath: '/rpc',
  host: 'polymer.example',
  secret: env.POLYMER_AUTH_SECRET,
});

await fetch(env.POLYMER_API_URL, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${env.POLYMER_API_KEY}`,
    'X-Polymer-Auth-Token': token,
    'Content-Type': 'application/json',
  },
  body,
});

// Verify an incoming token if you proxy traffic through your own service
const verification = verify({
  token: request.headers.get('X-Polymer-Auth-Token') ?? '',
  body,
  urlPath: '/rpc',
  host: 'polymer.example',
  secret: env.POLYMER_AUTH_SECRET,
});

if (!verification.valid) throw new Error(`Invalid token: ${verification.reason}`);

Development

npm run dev     # Type-checks in watch mode
npm run lint    # ESLint against src/ + tests/
npm test        # Vitest suite
npm run build   # Emit ESM bundle and type declarations

Publishing

  1. Update package.json with the target version (or run npm version <major|minor|patch>).
  2. Create a matching git tag following the v1.2.3 convention and push it (git tag v1.2.3 && git push origin main --tags).
  3. Run npm run release to build and publish to npm (requires NPM_TOKEN with publish rights).