Skip to content

Commit

Permalink
feat(appcues): added proxyUrl support
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir-4116 committed Sep 15, 2023
1 parent d63755b commit fc5f449
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 7 additions & 1 deletion src/integrations/Appcues/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand All @@ -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() {
Expand Down

0 comments on commit fc5f449

Please sign in to comment.