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

@aphexcms/auth

v0.2.2

Published

[Better Auth](https://better-auth.com) wiring for [AphexCMS](https://github.com/IcelandicIcecream/aphex), in one call.

Readme

@aphexcms/auth

Better Auth wiring for AphexCMS, in one call.

Aphex is auth-agnostic — cms-core defines an AuthProvider port and doesn't care what implements it. This package is the batteries-included implementation: sessions, organizations, invitations, API keys, two-factor, and the email flows, already mapped onto Aphex's capability model.

📚 Documentation: docs.getaphex.com/authentication

Install

pnpm add @aphexcms/auth better-auth @better-auth/api-key

Quick start

import { createAphexAuth } from '@aphexcms/auth';
import { db, drizzleDb, dbDialect } from '$lib/server/db';
import { email } from '$lib/server/email';

export const {
	auth,
	service: authService,
	provider: authProvider
} = createAphexAuth({
	database: db,
	drizzleDb,
	dialect: dbDialect,
	secret: env.AUTH_SECRET,
	baseURL: env.AUTH_URL,
	trustedOrigins: [env.AUTH_URL],
	emailAdapter: email,
	appName: 'My CMS'
});

provider is what createCMSConfig() wants:

export default createCMSConfig({
	schemaTypes,
	database: db,
	auth: { provider: authProvider, loginUrl: '/login' }
});

Environment

AUTH_SECRET=            # node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"
AUTH_URL=http://localhost:5173
AUTH_TRUSTED_ORIGINS=http://localhost:5173

BETTER_AUTH_SECRET / BETTER_AUTH_URL still work as aliases, but prefer the AUTH_* spellings.

Rotating AUTH_SECRET signs everyone out and invalidates every API key, so generate one per environment and keep it.

AUTH_TRUSTED_ORIGINS is not optional in production: Better Auth uses it for CSRF and origin checks, and without it cookie-authenticated mutations are reachable from any site a signed-in admin visits.

Schema

Auth tables are dialect-specific and exported separately, because Drizzle needs the real table objects:

import * as authSchema from '@aphexcms/auth/schema/pg'; // or /schema/sqlite

Email verification is off by default

The first user to sign up becomes super admin and can sign in immediately, with no SMTP server — which is what makes a fresh project runnable in one command. Turn verification on with AUTH_REQUIRE_EMAIL_VERIFICATION=true once you have an email adapter configured. In production you want it on: without it, anyone can sign up with an address they don't own.

License

MIT