- Fork the repository.
- Create a
Supabase
account. - Copy the
Project URL
andanon
public
keys. - You can create a
.env
file and set the variables like this:
PUBLIC_SUPABASE_URL=
PUBLIC_SUPABASE_ANON_KEY=
- In the
SQL Editor
onSupabase
, paste the following:
-- First, drop existing policies
drop policy if exists "Enable insert for anonymous users" on pastes;
drop policy if exists "Enable select for anonymous users" on pastes;
drop policy if exists "Anyone can create pastes" on pastes;
drop policy if exists "Anyone can read pastes" on pastes;
-- Disable RLS temporarily to ensure a clean slate
alter table pastes disable row level security;
-- Enable RLS again
alter table pastes enable row level security;
-- Create policies with explicit permissions
create policy "Public insert access"
on pastes for insert
with check (true);
create policy "Public select access"
on pastes for select
using (true);
-- Grant necessary permissions to the anon role
grant usage on schema public to anon;
grant all on pastes to anon;
grant usage on all sequences in schema public to anon;
Note
The drop policy
section is not mandatory; it is only required if the user made a mistake.