Client Initialization in Supabase

From the Supabase cheat sheet ยท Setup & Configuration ยท verified Jul 2026

Client Initialization

Initialize Supabase client in your application

typescript
import { createClient } from '@supabase/supabase-js'

// Initialize client
const supabase = createClient(
  'YOUR_SUPABASE_URL',
  'YOUR_ANON_KEY'
)

// With TypeScript types
import { Database } from './types/supabase'

const supabase = createClient<Database>(
  url,
  key
)
๐Ÿ”‘ Use environment variables for keys
๐ŸŽฏ TypeScript types can be auto-generated
๐Ÿ” Anon key is safe for client-side use
โšก Different clients for server/client in SSR

More Supabase tasks

Back to the full Supabase cheat sheet