diff --git a/.size-limit.js b/.size-limit.js index e9cad1dcc..faa2a395b 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -13,7 +13,7 @@ module.exports = [ name: 'All Integrations - CDN', path: 'dist/legacy/js-integrations/*.min.js', gzip: true, - limit: '447.3 kB', + limit: '454.1 kB', }, { name: 'Core - NPM', diff --git a/src/integrations/Appcues/browser.js b/src/integrations/Appcues/browser.js index 34091c57b..c1c8b1e63 100644 --- a/src/integrations/Appcues/browser.js +++ b/src/integrations/Appcues/browser.js @@ -2,6 +2,7 @@ import logger from '../../utils/logUtil'; import ScriptLoader from '../../utils/ScriptLoader'; import { NAME } from './constants'; +import { isDefinedAndNotNullAndNotEmpty } from '../../utils/commonUtils'; class Appcues { constructor(config, analytics, destinationInfo) { @@ -11,6 +12,7 @@ class Appcues { this.analytics = analytics; this.accountId = config.accountId; this.apiKey = config.apiKey; + this.proxyUrl = config.proxyUrl; this.name = NAME; ({ shouldApplyDeviceModeTransformation: this.shouldApplyDeviceModeTransformation, @@ -21,7 +23,11 @@ class Appcues { init() { logger.debug('===in init Appcues==='); - ScriptLoader('appcues-id', `https://fast.appcues.com/${this.accountId}.js`); + + const url = isDefinedAndNotNullAndNotEmpty(this.proxyUrl) + ? this.proxyUrl + : `https://fast.appcues.com/${this.accountId}.js`; + ScriptLoader('appcues-id', url); } isLoaded() {