RLS and APIs

I'm querying Supabase from my dynamic API route using NextJS 14, and a standard fetch statement, seen in attachment.
I also use the SSR Supabase package to createSupabaseServerClient().

The issue is that if RLS is enabled on my users table, my API can't request data because the request is coming from an API and not a user, thus no auth.uid() can be obtained and the authenticated check fails.

How do I get around this issue?

Thanks.
image.png
image.png
Was this page helpful?