You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the supabase and clerk docs for creating user_id column where i cant copy this code to weok?
`import { useSession, useUser } from '@clerk/nextjs'
import { createClient } from '@supabase/supabase-js'
export default function Home() {
// The useSession() hook will be used to get the Clerk session object
const { session } = useSession()
// Create a custom supabase client that injects the Clerk Supabase token into the request headers
function createClerkSupabaseClient() {
return createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_KEY!,
{
global: {
// Get the custom Supabase token from Clerk
fetch: async (url, options = {}) => {
// The Clerk `session` object has the getToken() method
const clerkToken = await session?.getToken({
// Pass the name of the JWT template you created in the Clerk Dashboard
// For this tutorial, you named it 'supabase'
template: 'supabase',
})
// Insert the Clerk Supabase token into the headers
const headers = new Headers(options?.headers)
headers.set('Authorization', `Bearer ${clerkToken}`)
// Call the default fetch
return fetch(url, {
...options,
headers,
})
},
},
},
)
}
//... The rest of the code is removed for brevity
Based on the supabase and clerk docs for creating user_id column where i cant copy this code to weok?
`import { useSession, useUser } from '@clerk/nextjs'
import { createClient } from '@supabase/supabase-js'
export default function Home() {
// The
useSession()
hook will be used to get the Clerksession
objectconst { session } = useSession()
}
`
guide link: https://supabase.com/partners/integrations/clerk
The text was updated successfully, but these errors were encountered: