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

@oidc-exchange/node

v0.2.0

Published

Node.js bindings for oidc-exchange - OIDC token exchange service

Readme

@oidc-exchange/node

npm License: MIT

Native Node.js binding for oidc-exchange — a Rust service that validates ID tokens from third-party OIDC providers (Google, Apple, …) and exchanges them for self-issued access and refresh tokens.

The whole service is embedded in-process as a native addon (built with napi-rs): you route HTTP requests through it and get HTTP responses back — no subprocess, no extra network hop.

Install

npm install @oidc-exchange/node

The prebuilt native binary for your platform is installed automatically via optionalDependencies. Supported platforms:

| Platform | Package | | ------------------- | -------------------------------- | | Linux x64 (glibc) | @oidc-exchange/linux-x64-gnu | | Linux arm64 (glibc) | @oidc-exchange/linux-arm64-gnu | | Windows x64 | @oidc-exchange/win32-x64-msvc | | macOS arm64 | @oidc-exchange/darwin-arm64 |

Requires Node.js ≥ 22.

Usage

Construct the service with a TOML config (a file path or an inline string), then hand it HTTP requests:

import { OidcExchange } from "@oidc-exchange/node";

const oidc = new OidcExchange({ config: "./config.toml" });
// or: new OidcExchange({ configString: "[server]\nissuer = \"https://auth.example.com\"\n…" })

const res = oidc.handleRequest({
  method: "POST",
  path: "/token",
  headers: [{ name: "content-type", value: "application/json" }],
  body: Buffer.from(JSON.stringify({ grant_type: "authorization_code", code, provider: "google" })),
});

console.log(res.status); // e.g. 200
console.log(res.body.toString("utf8")); // { "access_token": …, "refresh_token": … }

API

class OidcExchange {
  constructor(options: { config?: string; configString?: string });
  handleRequest(request: HttpRequest): HttpResponse;
  shutdown(): void; // graceful shutdown (currently a no-op)
}

interface HttpRequest {
  method: string;
  path: string;
  headers: { name: string; value: string }[];
  body?: Buffer;
}
interface HttpResponse {
  status: number;
  headers: { name: string; value: string }[];
  body: Buffer;
}

handleRequest exposes the full service — /token, /revoke, /keys, /.well-known/openid-configuration, /health, and the internal admin API. See the HTTP API reference for request/response shapes.

Framework adapters

Wiring for popular Node servers lives in the main repo's examples — Express, Fastify, Hono, Next.js, SvelteKit, serverless. For AWS Lambda, use @oidc-exchange/lambda.

Configuration

Configuration is TOML — providers, token TTLs, registration policy, key management, and storage. See the configuration guide.

Links

Published from CI with npm provenance. MIT licensed.