// Single mode
withSupabase({ auth: 'user' }, handler)
// Multiple modes — the first match wins.
// A mode is tried only when its credential is present; a JWT that is
// present but fails verification rejects immediately rather than falling
// through to the next mode.
withSupabase({ auth: ['user', 'publishable'] }, handler)
Authentication mode that determines what credentials a request must provide.
"none"— No credentials required. Every request is accepted."publishable"— Requires a valid publishable key in theapikeyheader. Matches only thedefaultkey."secret"— Requires a valid secret key in theapikeyheader (timing-safe comparison). Matches only thedefaultkey."user"— Requires a valid JWT in theAuthorization: Bearer <token>header.Bare
"publishable"/"secret"resolve thedefaultkey fromSUPABASE_PUBLISHABLE_KEYS/SUPABASE_SECRET_KEYS. To target another key or accept any key, see AuthModeWithKey.