Server: resolveEnv

Resolves Supabase environment configuration from runtime environment variables.

Reads SUPABASE_URL, keys (SUPABASE_PUBLISHABLE_KEYS / SUPABASE_SECRET_KEYS), and the JWKS source (SUPABASE_JWKS for inline keys, or SUPABASE_JWKS_URL for a remote endpoint). Works across Deno, Node.js, and Bun. For Cloudflare Workers, use overrides or enable node-compat.

Parameters

Examples

Reading and overriding env vars

const { data: env, error } = resolveEnv()
if (error) throw error

// Override for tests
const { data: env } = resolveEnv({ url: 'http://localhost:54321' })