turn off sprig on dev
This commit is contained in:
parent
81fb2456bd
commit
a149777c0e
|
@ -5,7 +5,8 @@
|
|||
import { ENV_CONFIG } from 'common/envs/constants'
|
||||
import { PROD_CONFIG } from 'common/envs/prod'
|
||||
|
||||
try {
|
||||
if (ENV_CONFIG.domain === PROD_CONFIG.domain) {
|
||||
try {
|
||||
;(function (l, e, a, p) {
|
||||
if (window.Sprig) return
|
||||
window.Sprig = function (...args) {
|
||||
|
@ -19,16 +20,17 @@ try {
|
|||
a.async = 1
|
||||
a.src = e + '?id=' + S.appId
|
||||
p = l.getElementsByTagName('script')[0]
|
||||
ENV_CONFIG.domain === PROD_CONFIG.domain && p.parentNode.insertBefore(a, p)
|
||||
p.parentNode.insertBefore(a, p)
|
||||
})(document, 'https://cdn.sprig.com/shim.js', ENV_CONFIG.sprigEnvironmentId)
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
console.log('Error initializing Sprig, please complain to Barak', error)
|
||||
}
|
||||
}
|
||||
|
||||
export function setUserId(userId: string): void {
|
||||
window.Sprig('setUserId', userId)
|
||||
if (window.Sprig) window.Sprig('setUserId', userId)
|
||||
}
|
||||
|
||||
export function setAttributes(attributes: Record<string, unknown>): void {
|
||||
window.Sprig('setAttributes', attributes)
|
||||
if (window.Sprig) window.Sprig('setAttributes', attributes)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user