Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(supabase): add read replica routing (#1274)

Gergő Móricz904e69bfbc59
diff --git a/apps/api/src/services/supabase.ts b/apps/api/src/services/supabase.ts
index 4ab638150..fa60d5670 100644
--- a/apps/api/src/services/supabase.ts
+++ b/apps/api/src/services/supabase.ts
@@ -23,7 +23,13 @@ class SupabaseService {
"Supabase environment variables aren't configured correctly. Supabase client will not be initialized. Fix ENV configuration or disable DB authentication with USE_DB_AUTHENTICATION env variable",
);
} else {
- this.client = createClient(supabaseUrl, supabaseServiceToken);
+ this.client = createClient(supabaseUrl, supabaseServiceToken, {
+ global: {
+ headers: {
+ "sb-lb-routing-mode": "alpha-all-services",
+ },
+ },
+ });
}
}