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

@authsome/adapter-supabase

v0.1.12

Published

Supabase adapter for AuthSome UI using Supabase JS client

Readme

@authsome/adapter-supabase

Supabase adapter for AuthSome UI using the official Supabase JS client.

Installation

pnpm add @authsome/adapter-supabase @supabase/supabase-js

Usage

import { AuthClient } from '@authsome/ui-core';
import { SupabaseAdapter } from '@authsome/adapter-supabase';

const authClient = new AuthClient({
  provider: new SupabaseAdapter({
    url: process.env.NEXT_PUBLIC_SUPABASE_URL!,
    anonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
  }),
});

Configuration

interface SupabaseAdapterConfig {
  url: string;
  anonKey: string;
  options?: {
    auth?: {
      autoRefreshToken?: boolean;      // Default: true
      persistSession?: boolean;        // Default: true
      detectSessionInUrl?: boolean;    // Default: true
    };
  };
}

Supported Features

| Feature | Supported | Notes | |---------|-----------|-------| | Email/Password | ✅ | Full support | | OAuth | ✅ | Google, GitHub, Azure, etc. | | Magic Links | ✅ | Via OTP | | Phone Auth | ✅ | SMS OTP | | 2FA (TOTP) | ✅ | Multi-factor authentication | | 2FA (SMS) | ✅ | Phone-based MFA | | Username Auth | ❌ | Not natively supported | | Passkeys | ❌ | Not yet supported by Supabase | | Organizations | ❌ | Not currently implemented (see below) |

Organization Support

Organizations are not currently implemented for the Supabase adapter. However, you can implement organization/tenant support in your Supabase backend using:

  1. Custom Tables: Create organizations and organization_members tables
  2. Row Level Security (RLS): Use Supabase RLS policies to enforce tenant isolation
  3. Custom Adapter: Extend the Supabase adapter to implement the optional organization methods

Example schema:

CREATE TABLE organizations (
  id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
  name text NOT NULL,
  slug text UNIQUE NOT NULL,
  created_at timestamptz DEFAULT now()
);

CREATE TABLE organization_members (
  id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
  organization_id uuid REFERENCES organizations(id),
  user_id uuid REFERENCES auth.users(id),
  role text NOT NULL CHECK (role IN ('owner', 'admin', 'member')),
  created_at timestamptz DEFAULT now()
);

Then extend the adapter:

import { SupabaseAdapter } from '@authsome/adapter-supabase';

class CustomSupabaseAdapter extends SupabaseAdapter {
  async getOrganizations() {
    // Implement using your custom tables
  }
  
  async setActiveOrganization(orgId: string) {
    // Store in user metadata or session
  }
}

Example

import { AuthProvider } from '@authsome/ui-react';
import { SignInForm } from '@authsome/ui-react-shadcn';
import { SupabaseAdapter } from '@authsome/adapter-supabase';

const adapter = new SupabaseAdapter({
  url: 'https://your-project.supabase.co',
  anonKey: 'your-anon-key',
});

function App() {
  return (
    <AuthProvider client={new AuthClient({ provider: adapter })}>
      <SignInForm onSuccess={() => console.log('Signed in!')} />
    </AuthProvider>
  );
}

Using with Server Components

// app/auth-client.ts
import { createClient } from '@supabase/supabase-js';
import { SupabaseAdapter } from '@authsome/adapter-supabase';

export function getAuthClient() {
  return new SupabaseAdapter({
    url: process.env.NEXT_PUBLIC_SUPABASE_URL!,
    anonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
    options: {
      auth: {
        persistSession: true,
        autoRefreshToken: true,
      },
    },
  });
}

Environment Variables

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

License

MIT