Database
- In Supabase SQL Editor, run this query to add a profiles table (an extension of the authenticated user to store data like Stripe customer_id, subscription access, etc...):
create table public.profiles (
id uuid not null references auth.users on delete cascade,
customer_id text,
price_id text,
has_access boolean,
email text,
primary key (id)
);
alter table public.profiles enable row level security;
- Go to the new profiles table and add 2 RLS policies:
- Enable read access for authenticated users only
- Enable insert access for authenticated users only

- (Optional) If you want to collect leads with ButtonLead, create a new table called leads and add a RLS policy with insert access for anyone:
create table public.leads (
id uuid default gen_random_uuid(),
email text,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
primary key (id)
);
alter table public.leads enable row level security;
Last updated on 9/1/2024