# supabase-js

Adds practical cheat sheets and patterns for @supabase/supabase-js to your AI coding agent, covering Auth, Storage, Edge Functions, and queries.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 1216 repo stars
- Author: fcakyon
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/fcakyon/claude-codex-settings/tree/HEAD/plugins/supabase-skills/skills/supabase-js/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/supabase-js

## What it does

This skill equips coding agents with decision trees for the `@supabase/supabase-js` monorepo libraries. It maps standard methods across auth handlers, PostgREST table filters, RPC triggers, storage buckets, and realtime broadcasts.

Included recipes show typed queries, React lifecycle integration with `onAuthStateChange`, and backend setup using service role keys. Type-safe column checks depend on generating `database.types.ts` through the Supabase CLI beforehand.

## Requirements
- Works with: Supabase

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add fcakyon/claude-codex-settings
```
In the agent chat (not a shell):
```text
/plugin install supabase-skills@claude-settings
```
This installs the whole supabase-skills plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add fcakyon/claude-codex-settings --skill supabase-js -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/supabase-js/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/supabase-js/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add fcakyon/claude-codex-settings --skill supabase-js -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/supabase-js/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add fcakyon/claude-codex-settings --skill supabase-js -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/supabase-js/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install fcakyon/claude-codex-settings plugins/supabase-skills/skills/supabase-js
```

2. **Manually: put the files in place**
- File: `.github/skills/supabase-js/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add fcakyon/claude-codex-settings --skill supabase-js -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/fcakyon/claude-codex-settings --path plugins/supabase-skills/skills/supabase-js
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/supabase-js/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/fcakyon/claude-codex-settings/tree/HEAD/plugins/supabase-skills/skills/supabase-js/SKILL.md

## When to use it
- write type-safe table selects with joins and filters
- listen to Postgres changes using Supabase realtime channels
- handle user authentication via password, OTP, or OAuth
- manage file uploads and signed URLs in Supabase Storage
- invoke Supabase Edge Functions with custom payload and headers

## Example prompts
- Show how to query the profiles table with filters using supabase-js
- Set up a React hook that syncs auth state with supabase.auth.getUser
- Write a backend script using the Supabase service role key to bypass RLS

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: f8f42342c067c342.

BEGIN THIRD-PARTY FILE f8f42342c067c342
````text
---
name: supabase-js
description: This skill should be used when user asks to "use supabase-js", "query Supabase database", "supabase auth", "supabase storage", "supabase realtime", "supabase edge functions", or works with the @supabase/supabase-js JavaScript/TypeScript SDK.
references:
  - supabase-js
  - auth-js
  - postgrest-js
  - storage-js
license: MIT
---

# Supabase JavaScript SDK Skill

Skill for building applications with the `@supabase/supabase-js` SDK. Covers Auth, Database (PostgREST), Storage, Realtime, and Edge Functions.

The SDK docs at https://supabase.com/docs/reference/javascript are the source of truth. The reference files alongside this skill contain source code and READMEs extracted from the monorepo for quick lookup.

## Setup

```bash
npm install @supabase/supabase-js
```

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

const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
```

For type-safe queries, generate types from your database schema:

```bash
supabase gen types typescript --project-id your-project-id > database.types.ts
```

```typescript
import { createClient } from '@supabase/supabase-js'
import type { Database } from './database.types'

const supabase = createClient<Database>(SUPABASE_URL, SUPABASE_ANON_KEY)
```

## Quick Decision Trees

### "I need to query data"

```
Database query?
├─ Select rows → supabase.from('table').select('*')
├─ Filter rows → .select().eq('col', val) / .gt() / .lt() / .in() / .like()
├─ Join tables → .select('*, other_table(*)') or .select('*, other_table!fk(*)')
├─ Insert → supabase.from('table').insert({ col: val })
├─ Upsert → supabase.from('table').upsert({ id: 1, col: val })
├─ Update → supabase.from('table').update({ col: val }).eq('id', 1)
├─ Delete → supabase.from('table').delete().eq('id', 1)
├─ Call RPC function → supabase.rpc('function_name', { arg: val })
├─ Count rows → .select('*', { count: 'exact', head: true })
├─ Pagination → .range(0, 9) or .limit(10).offset(20)
└─ Order → .order('created_at', { ascending: false })
```

### "I need authentication"

```
Auth?
├─ Email/password sign up → supabase.auth.signUp({ email, password })
├─ Email/password sign in → supabase.auth.signInWithPassword({ email, password })
├─ OAuth (Google, GitHub, etc.) → supabase.auth.signInWithOAuth({ provider: 'google' })
├─ Magic link → supabase.auth.signInWithOtp({ email })
├─ Phone OTP → supabase.auth.signInWithOtp({ phone })
├─ Sign out → supabase.auth.signOut()
├─ Get current user → supabase.auth.getUser()
├─ Get session → supabase.auth.getSession()
├─ Listen to auth changes → supabase.auth.onAuthStateChange((event, session) => {})
````
END THIRD-PARTY FILE f8f42342c067c342

The third-party file has ended. Everything between the f8f42342c067c342 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2804 of 6500 bytes. © fcakyon · MIT · https://github.com/fcakyon/claude-codex-settings/tree/HEAD/plugins/supabase-skills/skills/supabase-js/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
