From 579ef8e8415d2a9bd0a4c07b9dad009f25eda684 Mon Sep 17 00:00:00 2001 From: SbDove <100377552+SbDove@users.noreply.github.com> Date: Fri, 24 May 2024 10:06:26 -0700 Subject: [PATCH] Revert initialization to kit skeleton --- src/initialization.js | 44 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/initialization.js b/src/initialization.js index 7f5989c..4889e89 100644 --- a/src/initialization.js +++ b/src/initialization.js @@ -10,39 +10,31 @@ var initialization = { */ initForwarder: function(forwarderSettings, testMode, userAttributes, userIdentities, processEvent, eventQueue, isInitialized, common, appVersion, appName, customFlags, clientId) { /* `forwarderSettings` contains your SDK specific settings such as apiKey that your customer needs in order to initialize your SDK properly */ + if (!testMode) { /* Load your Web SDK here using a variant of your snippet from your readme that your customers would generally put into their tags Generally, our integrations create script tags and append them to the . Please follow the following format as a guide: */ - if (!window.heap) { - var heapScript = document.createElement('script'); - heapScript.type = 'text/javascript'; - heapScript.async = true; - heapScript.src = 'https://cdn.heapanalytics.com/js/heap-' + forwarderSettings.appId + '.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(heapScript); - heapScript.onload = function() { - isInitialized = true; - - if (window.heap && eventQueue.length > 0) { - // Process any events that may have been queued up while forwarder was being initialized. - for (var i = 0; i < eventQueue.length; i++) { - processEvent(eventQueue[i]); - } - // now that each queued event is processed, we empty the eventQueue - eventQueue = []; - } - window.heap.load(forwarderSettings.appId); - }; - } else { - isInitialized = true; - } - - - + // var clientScript = document.createElement('script'); + // clientScript.type = 'text/javascript'; + // clientScript.async = true; + // clientScript.src = 'https://www.clientscript.com/static/clientSDK.js'; // <---- Update this to be your script + // (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript); + // clientScript.onload = function() { + // if (clientSDKObject && eventQueue.length > 0) { + // // Process any events that may have been queued up while forwarder was being initialized. + // for (var i = 0; i < eventQueue.length; i++) { + // processEvent(eventQueue[i]); + // } + // // now that each queued event is processed, we empty the eventQueue + // eventQueue = []; + // } + // clientSDKObject.initialize(forwarderSettings.apiKey); + // }; } else { // For testing, you should fill out this section in order to ensure any required initialization calls are made, - // window.heap.initialize(forwarderSettings.apiKey) + // clientSDKObject.initialize(forwarderSettings.apiKey) } } };