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

@drivly/authjs-clickhouse

v0.0.2

Published

Clickhouse adapter for next-auth.

Readme

@drivly/authjs-clickhouse

A ClickHouse adapter for Auth.js / NextAuth.js.

Features

  • Full Auth.js adapter implementation
  • Works in any environment (Node.js, Edge, Cloudflare Workers)
  • Uses the official ClickHouse HTTP client
  • TypeScript support
  • Zero dependencies (other than the ClickHouse client)

Installation

npm install @drivly/authjs-clickhouse @clickhouse/client-web
# or
yarn add @drivly/authjs-clickhouse @clickhouse/client-web
# or
pnpm add @drivly/authjs-clickhouse @clickhouse/client-web

Prerequisites

Before using this adapter, you must create the required tables in your ClickHouse database. This is a one-time setup step.

  1. Copy the schema from schema.clickhouse.sql
  2. Execute the SQL statements in your ClickHouse database

The schema creates four tables:

  • users - Stores user information
  • accounts - Stores OAuth account information
  • sessions - Stores user sessions
  • verificationToken - Stores verification tokens for email verification

Usage

import { ClickHouseClient } from '@clickhouse/client-web'
import ClickhouseAdapter from '@drivly/authjs-clickhouse'
import NextAuth from 'next-auth'

const client = new ClickHouseClient({
  url: process.env.CLICKHOUSE_URL,
  username: process.env.CLICKHOUSE_USER,
  password: process.env.CLICKHOUSE_PASSWORD,
})

export default NextAuth({
  adapter: ClickhouseAdapter(client),
  // ... your NextAuth.js configuration
})

Environment Variables

CLICKHOUSE_URL=https://your-clickhouse-host:8443
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=your-password

Schema Details

The adapter requires four tables in your ClickHouse database. These tables must be created before using the adapter:

Users Table

Stores user information including email, name, and profile image.

Accounts Table

Stores OAuth account information, linking users to their OAuth providers.

Sessions Table

Manages active user sessions.

Verification Token Table

Handles email verification tokens.

For the complete schema definition, see schema.clickhouse.sql.

License

MIT