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 fc5f449 commit e5040e2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/integrations/Appcues/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ class Appcues {
init() {
logger.debug('===in init Appcues===');

const url = isDefinedAndNotNullAndNotEmpty(this.proxyUrl)
? this.proxyUrl
: `https://fast.appcues.com/${this.accountId}.js`;
let url = `https://fast.appcues.com/${this.accountId}.js`;
if (isDefinedAndNotNullAndNotEmpty(this.proxyUrl) && typeof this.proxyUrl === 'string') {
url = this.proxyUrl.includes(`${this.accountId}.js`)
? this.proxyUrl
: `${this.proxyUrl}/${this.accountId}.js`;
}
ScriptLoader('appcues-id', url);
}

Expand Down

0 comments on commit e5040e2

Please sign in to comment.