© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
15 replies
Vimes

session with @supabase/ssr

Using @supabase/auth-helpers-nextjs I can get and set session data for users that I use to tell if they are logged inn amongst other things
Something like this
export default function Login({}) {
  const [session, setSession] = useState<Session | null>();
  const supabase = createClientComponentClient();

  const getSession = async () => {
    const { data, error } = await supabase.auth.getSession();
    if (data?.session) {
      setSession(data.session);
    } else if (error) {
      console.error("Could not find a session:", error);
    }
  };
export default function Login({}) {
  const [session, setSession] = useState<Session | null>();
  const supabase = createClientComponentClient();

  const getSession = async () => {
    const { data, error } = await supabase.auth.getSession();
    if (data?.session) {
      setSession(data.session);
    } else if (error) {
      console.error("Could not find a session:", error);
    }
  };


But @supabase/ssr does not export any session, so how can I get access to the same data with @supabase/ssr?
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

Supabase ssr + Sveltekit + GetClaims() sliding session implementation
SupabaseSSupabase / help-and-questions
6mo ago
Supabase SSR client with Clerk
SupabaseSSupabase / help-and-questions
7mo ago
NestJS with Supabase Auth SSR package
SupabaseSSupabase / help-and-questions
3y ago
Supabase Session Management
SupabaseSSupabase / help-and-questions
4y ago