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

@custom-auth/core

v1.0.11

Published

The framework-agnostic core engine for @custom-auth.

Readme

@custom-auth/core


📦 Ecosystem Packages


The framework-agnostic authentication engine that powers the entire @custom-auth ecosystem.

Installation

The core engine requires a database adapter and an email adapter to function. Choose the ones that match your stack:

# General Format
npm install @custom-auth/core <your-db-adapter> <your-email-adapter>

# Example 1: Prisma + Resend
npm install @custom-auth/core @custom-auth/prisma @custom-auth/adapter-resend

# Example 2: Drizzle + Nodemailer
npm install @custom-auth/core @custom-auth/drizzle @custom-auth/adapter-nodemailer

(See the Ecosystem Packages list above for all available adapters)

Quick Start

Initialize the core authentication engine with your chosen database and email adapters. The API remains exactly the same regardless of which adapters you pick!

import { CustomAuth } from '@custom-auth/core';

// 1. Import your preferred Database Adapter
import { PrismaAdapter } from '@custom-auth/prisma';
// import { DrizzleAdapter } from '@custom-auth/drizzle';
// import { MongooseAdapter } from '@custom-auth/mongoose';

// 2. Import your preferred Email Adapter
import { ResendAdapter } from '@custom-auth/adapter-resend';
// import { NodemailerAdapter } from '@custom-auth/adapter-nodemailer';

export const auth = new CustomAuth({
  // Use your chosen DB adapter
  db: new PrismaAdapter(prisma), 
  
  // Use your chosen Email adapter
  email: new ResendAdapter('your-resend-api-key'),
  
  secret: process.env.AUTH_SECRET
});

Documentation

Here is a detailed guide on how to use the core features of the authentication engine.

1. Creating the Auth Instance

import { createAuth } from '@custom-auth/core';
// Import your chosen adapters
import { PrismaAdapter } from '@custom-auth/prisma';
import { ResendEmailAdapter } from '@custom-auth/adapter-resend';

export const auth = createAuth({
  secret: process.env.AUTH_SECRET,
  dbAdapter: new PrismaAdapter(prisma),
  emailAdapter: new ResendEmailAdapter({ apiKey: process.env.RESEND_API_KEY, from: 'Auth <[email protected]>' }),
  emailVerification: true,
  verifyEmailUrl: 'https://yourapp.com/verify-email',
  resetPasswordUrl: 'https://yourapp.com/reset-password',
});

2. Registration & Login Flows

The core engine provides all the necessary methods to handle user authentication:

// Register a new user
const { user, token } = await auth.register(email, password, name);

// Login an existing user
const { user, token } = await auth.login(email, password);

// Create a session for the user
const sessionData = await auth.createSession(user);

3. Password Reset Flow

// Send a password reset email
await auth.forgotPassword(email);

// Reset the password using the token sent to the email
await auth.resetPassword(token, newPassword);

4. Magic Links

// Send a magic link to the user's email
await auth.sendMagicLink(email);

// Verify the magic link token
const user = await auth.verifyMagicLink(token);

Documentation

For full documentation, please visit the Main Repository.