From 074a1fdde283c0138fd8c7c13dbf8fdf6efd58d5 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 3 Oct 2022 10:59:18 -0600 Subject: [PATCH] Hide sprig on non-prod envs --- web/lib/service/sprig.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/lib/service/sprig.ts b/web/lib/service/sprig.ts index 9353020d..b827253f 100644 --- a/web/lib/service/sprig.ts +++ b/web/lib/service/sprig.ts @@ -3,6 +3,7 @@ // Integrate Sprig import { ENV_CONFIG } from 'common/envs/constants' +import { PROD_CONFIG } from 'common/envs/prod' try { ;(function (l, e, a, p) { @@ -18,7 +19,7 @@ try { a.async = 1 a.src = e + '?id=' + S.appId p = l.getElementsByTagName('script')[0] - p.parentNode.insertBefore(a, p) + ENV_CONFIG.domain === PROD_CONFIG.domain && p.parentNode.insertBefore(a, p) })(document, 'https://cdn.sprig.com/shim.js', ENV_CONFIG.sprigEnvironmentId) } catch (error) { console.log('Error initializing Sprig, please complain to Barak', error)