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

supabase-baileys

v1.0.0

Published

A lightweight TypeScript adapter that seamlessly integrates Baileys (WhatsApp Web) authentication state and end‑to‑end encryption keys with Supabase for persistent, restart‑resilient WhatsApp sessions.

Readme

Authentication with Supabase for Baileys

npm version license GitHub issues GitHub pull requests

🔐 Persistent WhatsApp session authentication using Supabase and Baileys.


Introduction

supabase-baileys is a persistent authentication adapter for Baileys that uses Supabase as a storage backend. It allows WhatsApp multi-session states to be synced across processes or instances using a PostgreSQL + S3 backend via Supabase.


Features

  • 🔄 Supports get, set, clear, and removeCreds operations
  • 🧠 Automatically serializes and deserializes keys using BufferJSON
  • 📦 Supports multiple session IDs
  • ☁️ Supabase-compatible with JSONB schema
  • 📁 Clear separation between creds and key data

Installation

npm install supabase-baileys

Usage

import makeWASocket from "baileys";
import { useSupabaseAuthState } from "supabase-baileys";

const { state, saveCreds } = await useSupabaseAuthState({
  supabaseUrl: "https://your-project.supabase.co",
  supabaseKey: "your-anon-key",
  session: "your-session-id",
});

const sock = makeWASocket({
  auth: state,
  // ...other config
});

sock.ev.on("creds.update", saveCreds);

Supabase Table Schema

Create the following table in Supabase:

create table if not exists auth (
  session text not null,
  id text not null,
  value jsonb,
  primary key (session, id)
);

You can rename the table by passing tableName in the config.


Environment Variables

Alternatively, you can set Supabase credentials via .env:

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key

Then call:

const { state, saveCreds } = await useSupabaseAuthState({
  session: "your-session-id",
});

API

useSupabaseAuthState(config: SupabaseConfig): Promise<SupabaseAuthState>

Parameters:

| Name | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------ | | supabaseUrl | string | No | Your Supabase project URL. If not provided, it will be read from the SUPABASE_URL environment variable. | | supabaseKey | string | No | Your Supabase anon/public key. If not provided, it will be read from the SUPABASE_ANON_KEY environment variable. | | tableName | string | No | Name of the Supabase table to store credentials (default: auth). | | session | string | Yes | A unique session ID for each WhatsApp account. |

Returns:

{
  state: AuthenticationState;
  saveCreds: (updatedCreds: Partial<AuthenticationCreds>) => Promise<void>;
  clear: () => Promise<void>;
  removeCreds: () => Promise<void>;
}

License

MIT © Ahmad Rosyihuddin