# Supabase

> Query tables, insert rows, and manage auth users via Supabase PostgREST API.

- Skill: `qhkm/supabase` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add qhkm/supabase`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhkm/supabase/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: qhkm (https://skillmd.com/u/qhkm)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/qhkm/supabase

---


# Supabase Skill

Query and modify data in Supabase using the PostgREST API. Also manage auth users.

## Setup

1. Go to your project at [supabase.com/dashboard](https://supabase.com/dashboard)
2. Project Settings → API → Copy the URL and keys

```bash
export SUPABASE_URL="https://xxx.supabase.co"
export SUPABASE_ANON_KEY="eyJhbGci..."
export SUPABASE_SERVICE_KEY="eyJhbGci..."  # optional, for admin ops
```

## Query a Table

```bash
curl -s "$SUPABASE_URL/rest/v1/todos?select=*&order=created_at.desc&limit=20" \
  -H "apikey: $SUPABASE_ANON_KEY" \
  -H "Authorization: Bearer $SUPABASE_ANON_KEY" \
  | jq '.[] | {id, title, done, created_at}'
```

Filter with operators:

```bash
curl -s "$SUPABASE_URL/rest/v1/todos?done=eq.false&select=id,title" \
  -H "apikey: $SUPABASE_ANON_KEY" \
  -H "Authorization: Bearer $SUPABASE_ANON_KEY" \
  | jq .
```

## Insert a Row

```bash
curl -s -X POST "$SUPABASE_URL/rest/v1/todos" \
  -H "apikey: $SUPABASE_ANON_KEY" \
  -H "Authorization: Bearer $SUPABASE_ANON_KEY" \
  -H "Content-Type: application/json" \
  -H "Prefer: return=representation" \
  -d '{"title": "New task from agent", "done": false}' \
  | jq '.[0] | {id, title}'
```

## Update a Row

```bash
curl -s -X PATCH "$SUPABASE_URL/rest/v1/todos?id=eq.1" \
  -H "apikey: $SUPABASE_ANON_KEY" \
  -H "Authorization: Bearer $SUPABASE_ANON_KEY" \
  -H "Content-Type: application/json" \
  -H "Prefer: return=representation" \
  -d '{"done": true}' | jq .
```

## List Auth Users (requires service key)

```bash
curl -s "$SUPABASE_URL/auth/v1/admin/users" \
  -H "apikey: $SUPABASE_SERVICE_KEY" \
  -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
  | jq '.users[] | {id, email, created_at, last_sign_in_at}'
```

## Tips

- Supabase requires BOTH `apikey` header AND `Authorization: Bearer` header
- Use `Prefer: return=representation` to get the inserted/updated row back
- PostgREST operators: `eq`, `neq`, `gt`, `lt`, `gte`, `lte`, `like`, `ilike`, `in`
- Service key bypasses Row Level Security — use only for admin operations
- Rate limit depends on your plan (free: 500 req/min)

