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);
    }
  };


But @supabase/ssr does not export any session, so how can I get access to the same data with @supabase/ssr?
Was this page helpful?