Created
June 10, 2023 15:28
-
-
Save victory-sokolov/40c92d061d685567b9180ef98aad88cb to your computer and use it in GitHub Desktop.
Supabase snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { cookies, headers } from 'next/headers'; | |
import { createServerComponentSupabaseClient } from '@supabase/auth-helpers-nextjs'; | |
const supabase = createServerComponentSupabaseClient({ | |
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL, | |
supabaseKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY, | |
headers, | |
cookies | |
}); | |
const { | |
data: { session } | |
} = await supabase.auth.getSession(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment