mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
5a01291c23
Feature enhancement — smarter incident banner targeting logic ## What is the current behavior? Displaying the incident banner requires toggling a flag or environment variable. Banners are shown to all users regardless of whether their projects are in affected regions or whether the incident affects project creation. ## What is the new behavior? Banner visibility is now driven by `show_banner` metadata from the StatusPage API — no manual flag or env var toggle needed. Per-user targeting is then applied: - Users with projects only see the banner when they have a database in an affected region - Users without projects only see the banner when the incident affects project creation Incident responses are enriched with cache data (`affected_regions`, `affects_project_creation`) fetched from a Supabase table. Visibility logic is extracted into a dedicated hook and pure utility function, backed by unit tests. ## Additional context Resolves FE-2562
10 lines
296 B
TypeScript
10 lines
296 B
TypeScript
import { createClient } from '@supabase/supabase-js'
|
|
|
|
/**
|
|
* Creates a Supabase client using the secret key.
|
|
* For use in server-side API routes only.
|
|
*/
|
|
export function createAdminClient() {
|
|
return createClient(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.LIVE_SUPABASE_SECRET_KEY!)
|
|
}
|