@supabase/supabase-js and @supabase/ssr - difference? #28997
Replies: 3 comments 6 replies
-
supabase-js is the main supabase client used for all REST API access in javascript. |
Beta Was this translation helpful? Give feedback.
-
The pure supabase JS Client comes from createClient in @supabase/supabase-js - All other createClient versions (@supabase/ssr or @supabase/auth-helpers... and so on) use createClient adding some helpers around them to help integrating supabase in certain environments. Choose the one that fits yours the best, but understand the environment well if you use one that is "further down the chain" so to speak, in order to not make mistakes. So for SSR use the @supabase/ssr library and the create*Client's present in there, in order to make sure they work correctly together, especially when handing sessions from server to client and such... Use createClient from @supabase/supabase-js for clients you use in places like edge functions which are server-sided only. That's how I would explain it.. not sure if that helps you. Fabian |
Beta Was this translation helpful? Give feedback.
-
You should go thru the docs for SSR. It provides specific examples. |
Beta Was this translation helpful? Give feedback.
-
Tell me difference between
@supabase/supabase-js
and@supabase/ssr
As I see I also can use
@supabase/supabase-js
in server component and get SSG pageBeta Was this translation helpful? Give feedback.
All reactions