In this video, I cover how to handle authentication with Supabase, Analog and tRPC. It’s based on my Angular Global Summit talk about the SPARTAN stack you can find on my blog as well.
Code snippets
Create the auth client
const AUTH_URL = `${import.meta.env['VITE_SUPABASE_URL']!}/auth/v1`; const AUTH_HEADERS = { Authorization: `Bearer ${import.meta.env['VITE_SUPABASE_KEY']!}`, apikey: `${import.meta.env['VITE_SUPABASE_KEY']!}`, }; export const authClient = new AuthClient({ headers: AUTH_HEADERS, url: AUTH_URL, fetch: fetch, });
Do you want to become an Angular architect? Check out Angular Architect Accelerator.