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

better-auth-dbsc

v0.2.0

Published

Device Bound Session Credentials (DBSC) plugin for Better Auth: bind sessions to a device key so stolen cookies stop working.

Readme

better-auth-dbsc

Device Bound Session Credentials (DBSC) for Better Auth.

Infostealer malware copies session cookies and replays them from another machine, which skips passwords, 2FA and passkeys entirely. With DBSC, a supporting browser binds each session to a private key kept in hardware (TPM, Secure Enclave). This plugin then refuses the Better Auth session cookie of a bound session unless the request also carries a short-lived cookie that only the key holder can renew. A stolen session cookie stops working on any other device.

  • Implements the current W3C editor's draft (Secure-Session-* headers, dbsc+jwt proofs) as Chrome ships it.
  • Enforces the binding on every session read through Better Auth's endpoints and auth.api.
  • Works with every sign-in method, including SSO and OAuth callbacks and server-side sign-ins.
  • Progressive: browsers without DBSC keep working exactly as before.
  • Runs anywhere Better Auth runs (Node, Bun, Cloudflare Workers, edge runtimes, Convex). Crypto by @noble and @scure/base.

Read the documentation

Install

npm install better-auth-dbsc

Usage

// auth.ts
import { betterAuth } from "better-auth";
import { dbsc } from "better-auth-dbsc";
import { anonymous, bearer, twoFactor } from "better-auth/plugins";

export const auth = betterAuth({
  plugins: [
    bearer(),
    twoFactor(),
    dbsc(), // after bearer(), twoFactor() and crossDomain()
    anonymous(), // plugins whose hooks read the session go after dbsc()
  ],
});

dbsc() checks the plugin order at startup. Then create the dbscSession table:

npx auth generate   # Drizzle, Prisma, Convex…
npx auth migrate    # built-in Kysely adapter

That is all: the browser runs the protocol from response headers. The optional client plugin adds a typed status call:

import { dbscClient } from "better-auth-dbsc/client";
import { createAuthClient } from "better-auth/react";

export const authClient = createAuthClient({ plugins: [dbscClient()] });

const { data } = await authClient.dbsc.status(); // { bound, algorithm, boundAt }

Browser support

DBSC works in Chrome on Windows (TPM) and macOS (Secure Enclave), and in Edge on Windows. Firefox and Safari do not support it yet: their sessions are not bound and work as before, without this protection. Details.

Documentation

Security

Report vulnerabilities privately: see SECURITY.md.

Credits

Built and maintained by Helix Nebula.

License

MIT