Files
GLM-Tools-Skills-Agents/skills/external/supabase-tools-supabase-usage/references/auth.md
uroma 5889d3428b Add comprehensive skills, agents, commands collection
- Added 44 external skills from obra/superpowers, ui-ux-pro-max-skill, claude-codex-settings
- Added 8 autonomous agents (commit-creator, pr-creator, pr-reviewer, etc.)
- Added 23 slash commands for Git/GitHub, setup, and plugin development
- Added hooks for code formatting, notifications, and validation
- Added MCP configurations for Azure, GCloud, Supabase, MongoDB, etc.
- Added awesome-openclaw-skills registry (3,002 skills referenced)
- Updated comprehensive README with full documentation

Sources:
- github.com/obra/superpowers (14 skills)
- github.com/nextlevelbuilder/ui-ux-pro-max-skill (1 skill)
- github.com/fcakyon/claude-codex-settings (29 skills, 8 agents, 23 commands)
- github.com/VoltAgent/awesome-openclaw-skills (registry)
- skills.sh (reference)
- buildwithclaude.com (reference)
2026-02-13 10:30:11 +00:00

2.2 KiB

Supabase Authentication

Supabase Auth provides user management with JWT-based sessions.

Auth Tables

Key tables in the auth schema:

  • auth.users - User accounts (id, email, phone, created_at, etc.)
  • auth.sessions - Active sessions
  • auth.identities - OAuth provider identities

JavaScript SDK

// Initialize client
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(url, anonKey);

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

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

// Get current user
const {
  data: { user },
} = await supabase.auth.getUser();

// Sign out
await supabase.auth.signOut();

// Listen to auth state changes
supabase.auth.onAuthStateChange((event, session) => {
  console.log("Auth event:", event);
  if (session) console.log("User ID:", session.user.id);
});

// OAuth sign in
const { data, error } = await supabase.auth.signInWithOAuth({
  provider: "google",
});

Python SDK

from supabase import Client, create_client

supabase: Client = create_client(url, key)

# Sign up
response = supabase.auth.sign_up({"email": "user@example.com", "password": "securepassword"})

# Sign in
response = supabase.auth.sign_in_with_password({"email": "user@example.com", "password": "securepassword"})

# Get current user
user = supabase.auth.get_user()

# Sign out
supabase.auth.sign_out()

User Profile Table Pattern

Link a public profile table to auth.users:

create table public.profiles (
  id uuid not null references auth.users on delete cascade,
  first_name text,
  last_name text,
  avatar_url text,
  primary key (id)
);

alter table public.profiles enable row level security;

-- Auto-create profile on signup (trigger)
create function public.handle_new_user()
returns trigger as $$
begin
  insert into public.profiles (id)
  values (new.id);
  return new;
end;
$$ language plpgsql security definer;

create trigger on_auth_user_created
  after insert on auth.users
  for each row execute procedure public.handle_new_user();