Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: disable usercentrics in staging (#37347)

Alaister Young63028c60f50c
diff --git a/packages/common/consent-state.ts b/packages/common/consent-state.ts
index 8575a76c883..23e1109dfbd 100644
--- a/packages/common/consent-state.ts
+++ b/packages/common/consent-state.ts
@@ -61,10 +61,13 @@ export const consentState = proxy({
async function initUserCentrics() {
if (process.env.NODE_ENV === 'test' || !IS_PLATFORM) return
- // [Alaister] For local development, we accept all consent by default.
- // If you need to test usercentrics locally, comment out the
+ // [Alaister] For local development and staging, we accept all consent by default.
+ // If you need to test usercentrics in these environments, comment out this
// NEXT_PUBLIC_ENVIRONMENT check and add an ngrok domain to usercentrics
- if (process.env.NEXT_PUBLIC_ENVIRONMENT === 'local') {
+ if (
+ process.env.NEXT_PUBLIC_ENVIRONMENT === 'local' ||
+ process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'
+ ) {
consentState.hasConsented = true
return
}