Analytics enabled/disabled via specific ENV variable

This commit is contained in:
Michael Shanks 2020-09-29 17:28:24 +01:00
parent a1db3bfecf
commit e4ea9e608d
3 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ rimraf.sync(homedir)
process.env.BUDIBASE_API_KEY = "6BE826CB-6B30-4AEC-8777-2E90464633DE" process.env.BUDIBASE_API_KEY = "6BE826CB-6B30-4AEC-8777-2E90464633DE"
process.env.NODE_ENV = "cypress" process.env.NODE_ENV = "cypress"
process.env.ENABLE_ANALYTICS = "false"
initialiseBudibase({ dir: homedir, clientId: "cypress-test" }) initialiseBudibase({ dir: homedir, clientId: "cypress-test" })
.then(() => { .then(() => {

View File

@ -17,3 +17,4 @@ LOG_LEVEL=error
DEPLOYMENT_CREDENTIALS_URL="https://dt4mpwwap8.execute-api.eu-west-1.amazonaws.com/prod/" DEPLOYMENT_CREDENTIALS_URL="https://dt4mpwwap8.execute-api.eu-west-1.amazonaws.com/prod/"
DEPLOYMENT_DB_URL="https://couchdb.budi.live:5984" DEPLOYMENT_DB_URL="https://couchdb.budi.live:5984"
SENTRY_DSN=https://a34ae347621946bf8acded18e5b7d4b8@o420233.ingest.sentry.io/5338131 SENTRY_DSN=https://a34ae347621946bf8acded18e5b7d4b8@o420233.ingest.sentry.io/5338131
ENABLE_ANALYTICS="true"

View File

@ -1,3 +1,3 @@
exports.isEnabled = async function(ctx) { exports.isEnabled = async function(ctx) {
ctx.body = JSON.stringify(process.env.NODE_ENV === "production") ctx.body = JSON.stringify(process.env.ENABLE_ANALYTICS === "true")
} }