| name | supabase-hello-world |
| description | Run your first Supabase query — insert a row and read it back.
Use when starting a new Supabase project, verifying your connection works,
or learning the basic insert-then-select pattern with @supabase/supabase-js.
Trigger with phrases like "supabase hello world", "first supabase query",
"supabase quick start", "test supabase connection", "supabase insert and select".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(npx:*), Bash(supabase:*) |
| version | 1.53.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","supabase","database","getting-started"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Supabase Hello World — First Query
Overview
Execute your first real Supabase query: create a todos table in the dashboard, insert a row with the JS client, and read it back. This validates that your project URL, anon key, and Row Level Security are configured correctly before you build anything else.
Prerequisites
- Completed
supabase-install-auth setup (project URL + anon key in .env)
@supabase/supabase-js v2+ installed (npm install @supabase/supabase-js)
- A Supabase project at supabase.com/dashboard
Instructions
The workflow is three steps: create the table (dashboard SQL), insert a row
with the JS client, and read it back to prove the round-trip. The skeleton
below is enough to follow along; the fully annotated code for every step —
including the error-branch comments and expected console output — lives in
the full implementation walkthrough.
Step 1: Create the todos Table
In the Supabase dashboard SQL Editor, create the table, enable Row Level
Security (required for anon-key access), and add permissive read + insert
policies for the hello-world exercise:
create table public.todos (
id bigint generated always as identity primary key,
task text not null,
is_complete boolean default false,
inserted_at timestamptz default now()
);
alter table public.todos enable row level security;
create policy "Allow public read" on public.todos
for select using (true);
create policy "Allow public insert" on public.todos
for insert with check ();