Supabase Auth

Supabase Auth

Built-in authentication for the Supabase platform

Features

  • Email/password, magic link, phone auth
  • 30+ OAuth providers
  • Row-level security integration with PostgreSQL
  • Server-side auth helpers for Next.js, SvelteKit, etc.

Pros

  • Seamlessly integrated with Supabase database and RLS
  • Free tier included with Supabase project
  • JWT-based with customizable claims

Cons

  • Tightly coupled to Supabase ecosystem
  • Less customizable than standalone auth libraries
  • UI components less polished than Clerk

Overview

Supabase Auth is the authentication module built into the Supabase platform. It provides email/password, magic link, phone (SMS), and 30+ OAuth provider authentication, all integrated with Supabase’s PostgreSQL database and row-level security policies.

The key advantage of Supabase Auth is its deep integration with the database layer. Authentication tokens are automatically available in PostgreSQL RLS policies, enabling fine-grained access control without additional backend code. Server-side auth helpers are available for Next.js, SvelteKit, and other frameworks.

When to Use

Supabase Auth is the natural choice when already using Supabase for your database, when you want auth that integrates directly with PostgreSQL row-level security, or when you need a free auth solution bundled with your BaaS platform.

Getting Started

import { createClient } from "@supabase/supabase-js";

const supabase = createClient(url, anonKey);

// Sign up
await supabase.auth.signUp({
  email: "user@example.com",
  password: "password",
});

// Sign in
const { data } = await supabase.auth.signInWithPassword({
  email: "user@example.com",
  password: "password",
});