SU

supabase-auth-storage-realtime-core

Configures Auth, Storage, and Realtime features in Supabase to build a complete backend.

Install

mkdir -p .claude/skills/supabase-auth-storage-realtime-core && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8792" && unzip -o skill.zip -d .claude/skills/supabase-auth-storage-realtime-core && rm skill.zip

Installs to .claude/skills/supabase-auth-storage-realtime-core

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Implement Supabase Auth (signUp, signIn, OAuth, session management),
68 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Manage user authentication flows
  • Handle file uploads and signed URLs
  • Configure bucket-level RLS policies
  • Subscribe to Postgres database changes
  • Implement presence tracking and broadcast channels

How it works

It integrates authentication, storage, and real-time subscriptions into a single client, securing all operations with Row-Level Security policies.

Inputs & outputs

You give it
User credentials or file data
You get back
Authenticated session or stored file or real-time event

When to use supabase-auth-storage-realtime-core

  • Implement user sign-up and login flows
  • Setup file upload to Supabase storage
  • Enable real-time database updates in UI
  • Configure bucket-level RLS policies

About this skill

Supabase Auth + Storage + Realtime Core

Overview

Implement the three pillars that turn a Supabase database into a full application backend: user authentication (email/password, OAuth, magic links, session lifecycle), file storage (uploads, downloads, signed URLs, bucket-level RLS policies), and real-time subscriptions (Postgres change events, client-to-client broadcast, presence tracking). Every operation integrates with Row-Level Security through auth.uid().

Each pillar below carries a lean skeleton in this file; the full, copy-paste walkthroughs live in references/ so this file stays scannable.

Prerequisites

  • Supabase project created at supabase.com/dashboard
  • @supabase/supabase-js v2 installed (npm install @supabase/supabase-js)
  • SUPABASE_URL and SUPABASE_ANON_KEY available from project Settings > API
  • For Python: pip install supabase (wraps postgrest-py, gotrue-py, storage3, realtime-py)

Instructions

Read the file (Read), edit or create the client and route/component code (Write, Edit), and grep the project (Grep) to reuse an existing Supabase client before creating a new one. Use Bash(npm:*) to install the SDK and Bash(supabase:*) to run migrations/policies.

Step 1: Auth — registration, login, OAuth

Initialize the client once, then wire the flows your app needs. The skeleton:

import { createClient } from '@supabase/supabase-js'

const supabase = createClient(process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!)

// Email/password
await supabase.auth.signUp({ email, password })
await supabase.auth.signInWithPassword({ email, password })

// OAuth — redirect the user to data.url
const { data } = await supabase.auth.signInWithOAuth({ provider: 'google' })

// React to session changes (SIGNED_IN / SIGNED_OUT / TOKEN_REFRESHED)
supabase.auth.onAuthStateChange((event, session) => { /* update UI */ })

Full auth walkthrough — OAuth callback, magic link, session lifecycle, password reset: references/auth.md. Python: references/python-examples.md.

Step 2: Storage — upload, download, secure with bucket policies

Public buckets serve via CDN URLs; private buckets require signed URLs. The skeleton:

// Upload to the signed-in user's own folder (RLS enforces ownership)
await supabase.storage.from('avatars').upload(`${userId}/avatar.png`, file, { upsert: true })

// Public URL (public bucket) vs. time-limited signed URL (private bucket)
supabase.storage.from('avatars').getPublicUrl(`${userId}/avatar.png`)
await supabase.storage.from('documents').createSignedUrl('reports/q4.pdf', 3600)

Full storage walkthrough — download, list, delete, and the bucket RLS policies that enforce per-user access: references/storage.md. Python: references/python-examples.md.

Step 3: Realtime — Postgres changes, broadcast, presence

Three channel types: database change listeners, client-to-client broadcast, and presence. The skeleton:

const channel = supabase
  .channel('chat-room')
  .on('postgres_changes',
    { event: 'INSERT', schema: 'public', table: 'messages' },
    (payload) => console.log('New:', payload.new))
  .subscribe()
// One-time table setup: ALTER PUBLICATION supabase_realtime ADD TABLE messages;
supabase.removeChannel(channel)  // clean up

Full realtime walkthrough — UPDATE/DELETE filters, RLS-scoped subscriptions, broadcast, and presence tracking: references/realtime.md. Python: references/python-examples.md.

Output

  • Auth: user registration, password login, OAuth flow (Google/GitHub), magic link, session lifecycle with onAuthStateChange, password reset
  • Storage: file upload/download, public URLs for CDN-served assets, time-limited signed URLs for private files, bucket-level RLS policies using auth.uid() and storage.foldername()
  • Realtime: Postgres change subscriptions with server-side filters, broadcast channels for client-to-client messaging, presence tracking for online status

Error Handling

ErrorCauseSolution
AuthApiError: User already registeredDuplicate email signupUse signInWithPassword or check existence first
AuthApiError: Invalid login credentialsWrong email or passwordVerify credentials; check email confirmation status
AuthApiError: Email not confirmedUser has not clicked confirmation linkResend with resend({ type: 'signup', email })
StorageApiError: Bucket not foundBucket does not existCreate via dashboard or INSERT INTO storage.buckets
StorageApiError: new row violates row-level securityRLS policy blocking the operationVerify storage.objects policies match the user and bucket
StorageApiError: The resource already existsFile exists and upsert: falseSet upsert: true to overwrite or use a unique path
Realtime: channel error or TIMED_OUTNetwork issues or Realtime not enabledCheck ALTER PUBLICATION supabase_realtime ADD TABLE for the target table
Realtime: too many channelsExceeded concurrent channel limitUnsubscribe unused channels with removeChannel()

Examples

The end-to-end flow — sign in, upload an avatar to the user's RLS-guarded folder, resolve its public URL, and subscribe to live profile updates — is in references/examples.md. Each step composes the three skeletons above with no new API surface.

Resources

Next Steps

For common Supabase errors and debugging, see supabase-common-errors. For database queries and CRUD operations, see supabase-crud-core.

Prerequisites

Supabase project@supabase/supabase-js v2SUPABASE_URL and SUPABASE_ANON_KEY

Limitations

  • Concurrent channel limit for Realtime
  • RLS policies must match user and bucket

How it compares

This approach centralizes auth, storage, and real-time logic into a single backend integration rather than managing them as separate services.

Compared to similar skills

supabase-auth-storage-realtime-core side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
supabase-auth-storage-realtime-core (this skill)027dReviewIntermediate
supabase-developer957moReviewIntermediate
supabase-mcp-integration138moReviewAdvanced
better-auth-best-practices186moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry