On this page

Use the signed-in user in SQL

Use the signed-in user directly in tables and policies.

A column with a default of auth.uid() records who created each row:

SQL
user_id uuid not null default auth.uid() references auth.users on delete cascade

#Write policies with auth.uid()

SQL
create policy "Users read their own todos" on public.todos
  for select to authenticated
  using (user_id = auth.uid());

#Read token claims

SQL
select auth.jwt() ->> 'email';