Skip to content

Commit

Permalink
Updated loadIntegrationModule method
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Aug 17, 2021
1 parent 154a797 commit 737138e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import {
import {
CONFIG_URL,
MAX_WAIT_FOR_INTEGRATION_LOAD,
INTEGRATION_LOAD_CHECK_INTERVAL
INTEGRATION_LOAD_CHECK_INTERVAL,
CDN_BASE_URL,
} from "./utils/constants";
import RudderElementBuilder from "./utils/RudderElementBuilder";
import Storage from "./utils/storage";
Expand Down Expand Up @@ -206,11 +207,14 @@ class Analytics {
}

/*
* Dyanamically load the required client integration from CDN
*/
* Dyanamically load the required client integration from CDN
*/
loadIntegrationModule(modName) {
const cdnURL = `https://cdn.rudderstack.com/v2/js-integrations/${modName}.js`;
/*import(cdnURL)
// const cdnURL = `${CDN_BASE_URL}/${modName}.js`;
// For testing purposes only
const cdnURL =
"https://ddim5kcy73icz.cloudfront.net/integration/AdobeAnalytics.js";
fetch(cdnURL)
.then((modObj) => {
this.dynamicallyLoadedIntegrations[modName] = modObj;
})
Expand All @@ -220,7 +224,7 @@ class Analytics {
modName,
err
);
});*/
});
}

/**
Expand Down
1 change: 1 addition & 0 deletions utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const RudderIntegrationPlatform = {

const BASE_URL = "https://hosted.rudderlabs.com"; // default to RudderStack
const CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=process.module_type&v=process.package_version";
const CDN_BASE_URL = "https://cdn.rudderstack.com/v2/js-integrations";

const FLUSH_QUEUE_SIZE = 30;

Expand Down

0 comments on commit 737138e

Please sign in to comment.