Skip to main content

Authentication

The kit uses Supabase for authentication with anonymous auth by default.

How It Works

App Launch → Check session → Create anonymous user if needed → Continue

Key Files

FilePurpose
lib/supabase.tsSupabase client
contexts/auth-context.tsxAuth state

Usage

import { useAuth } from '@/contexts/auth-context';

const { user, signIn, signOut } = useAuth();

Adding Email/Password

Enable in Supabase Dashboard → Authentication → Providers:
await supabase.auth.signUp({
  email: 'user@example.com',
  password: 'password123',
});

Adding Apple Sign In

import * as AppleAuthentication from 'expo-apple-authentication';

const credential = await AppleAuthentication.signInAsync({...});

await supabase.auth.signInWithIdToken({
  provider: 'apple',
  token: credential.identityToken,
});