mirror of
https://github.com/supabase/supabase.git
synced 2026-06-14 14:08:31 +08:00
This PR runs `prettier` on the `examples` folder. Depends on https://github.com/supabase/supabase/pull/43849.
18 lines
486 B
TypeScript
18 lines
486 B
TypeScript
import { createServerClient } from '@supabase/ssr'
|
|
import { cookies } from 'next/headers'
|
|
import { Database } from './database.types'
|
|
|
|
export default function useSupabaseServer(cookieStore: ReturnType<typeof cookies>) {
|
|
return createServerClient<Database>(
|
|
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
|
|
{
|
|
cookies: {
|
|
get(name: string) {
|
|
return cookieStore.get(name)?.value
|
|
},
|
|
},
|
|
}
|
|
)
|
|
}
|