Next + Supabase
Unanswered
American Sable posted this in #help-forum
American SableOP
Does anyone have any advice on how to handle Next + Supabase with the new app router?
Previously I'd build it using mostly with the supabase browser client, handling all the auth, database queries etc on the client. However now with the app router and SSR its a little confusing.
Sure I can just create specific components for all the client side stuff, but thats most of site, especially when there's auth wrappers etc.
A little confused really on how this should be tackled, so any advice would be appreciated.
Previously I'd build it using mostly with the supabase browser client, handling all the auth, database queries etc on the client. However now with the app router and SSR its a little confusing.
Sure I can just create specific components for all the client side stuff, but thats most of site, especially when there's auth wrappers etc.
A little confused really on how this should be tackled, so any advice would be appreciated.
3 Replies
@American Sable if you check supabase doc, you will find it has new guide for app router.
I promise it will be more easier than before.
I promise it will be more easier than before.
so like when it comes to auth, in your server component(which can be your page or layout), check the session using supabase server instance and redirect if it's invalid