mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
* added supabase example * removed unused files * added jwt endpoint * supabase server action * removed unused * updated dependencies * reverted package changes * fixed bugs * added supabase docs * updated docs * updated pnpm lock
14 lines
425 B
TypeScript
14 lines
425 B
TypeScript
import { createBrowserClient } from "@supabase/ssr";
|
|
import { getSupabaseJwt } from "./actions";
|
|
|
|
/*
|
|
Creates a supabase client with the JWT signed by the server (instead of supabase auth)
|
|
*/
|
|
export const createSupabaseClient = () => {
|
|
return createBrowserClient(
|
|
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
|
{ accessToken: async () => await getSupabaseJwt() || "" }
|
|
);
|
|
}
|