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

@homeflare/auth

v0.2.0

Published

D1 storage for official Better Auth. Not an auth factory, not the community Cloudflare adapter.

Readme

@homeflare/auth

D1 storage for Better Auth, using the official adapter.

bun add @homeflare/auth better-auth drizzle-orm @better-auth/drizzle-adapter

Workers / D1 only. This package assumes a D1Database binding. It does not call betterAuth() — you do, in your own auth.ts.

import { createD1AuthStorage } from '@homeflare/auth';
import { betterAuth } from 'better-auth/minimal';

const { db, database } = createD1AuthStorage(env.DB, schema);

const auth = betterAuth({
  database,
  // plugins, hooks, baseURL, backgroundTasks: yours
});

db is the Drizzle client for your own queries. database is what Better Auth's database option wants.

Why this shape

★ The first consumer is AnyAuth, which already has a substantial issuer (workers/issuer/auth.ts). Plugins, hooks, schema, request-derived baseURL / rpID, and ExecutionContext.waitUntil stay there. A closed createAuth() factory here would steal that control.

Not better-auth-cloudflare. That community adapter is a different stack. This package wires drizzle-orm/d1 to @better-auth/drizzle-adapter and stops. Adopting the community wrapper was why AnyAuth refused to install @homeflare/[email protected].

Server-only. Import this from auth.ts, never from auth-client.ts or a React file. Better Auth's plugin docs require the same split: a client bundle that pulls the adapter also pulls the database.

⚠️ Let TypeScript infer plugin types at your betterAuth() call. Do not wrap that call and force-cast the result — that is how plugin types go missing (better-auth#5047). Keep "strict": true (the @homeflare/config baseline already does).

Which auth do you want?

| you need | use | | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | the edge already authenticated the caller; verify its assertion | @homeflare/cloudflare — stateless, jose | | you are the identity provider: sessions, accounts, a D1 | this package |

⚠️ Reaching for the wrong one produces a system that looks authenticated and is not.

★ This is a separate package for a reason: drizzle is an ORM, and a Worker that only wants structured logging or an Access check should not resolve one.

License

MIT © Timothy Schneider