© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago
lucksp

server-side database queries warning without session persist

I setup my app like a typical API where the client side auth is handled with Supabase OAUTH. Then it sends requests to backend, and my backend currently queries supabase. The reason for this is 1) i am a Front end dev so my knowledge of SQL is level 0.1 and 2) I do a decent amount of computation, or secondary queries on additional tables so I want to handle this on the server instead of mobile app JS code bundle.
However, when I send my Auth token in the header from the client, and check on my server that the token is valid to ensure my API is secure, I get some warnings:

No storage option exists to persist the session, which may result in unexpected behavior when using auth.
and
If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.

My server is instantiated like:
export const supabase = createClient<Database>(
  SUPABASE_MFI_URL,
  SUPABASE_MFI_API
);
export const supabase = createClient<Database>(
  SUPABASE_MFI_URL,
  SUPABASE_MFI_API
);

and then i use supabase to check the session passed in the request header:
const user = await supabase.auth.getUser(req.headers.authorization);
const user = await supabase.auth.getUser(req.headers.authorization);


Is this flow "normal" for Supabase? Or with Supabase, is there any reason to send requests from my client side app, through my node/express backend, which handles the supabase server query as opposed to just doing it all on client side?
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

Client vs server-side database queries with Supabase
SupabaseSSupabase / help-and-questions
3y ago
Get session data server side
SupabaseSSupabase / help-and-questions
4y ago
How do I use a Supabase session server-side?
SupabaseSSupabase / help-and-questions
4y ago
Supabase.auth.exchangeCodeForSession doesn't persist session
SupabaseSSupabase / help-and-questions
3y ago