From fc5f44979f440f2af185dda7642f9001738d10c9 Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Fri, 15 Sep 2023 14:11:06 +0530 Subject: [PATCH] feat(appcues): added proxyUrl support --- .size-limit.js | 2 +- src/integrations/Appcues/browser.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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() {