© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
8 replies
WreckNoFear

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
SSR Supabase
package to createSupabaseServerClient().

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

How do I get around this issue?

Thanks.
image.png
image.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Views and RLS?
SupabaseSSupabase / help-and-questions
6mo ago
RLS and CORS
SupabaseSSupabase / help-and-questions
4y ago
RLS and security suggestions
SupabaseSSupabase / help-and-questions
3d ago
Partition Tables and RLS
SupabaseSSupabase / help-and-questions
9mo ago