Skip to main content
Gainsight Inc.

Hosting SDK

This article explains the steps to host the SDK.

Overview

Gainsight PX is SOC-2 Type-II compliant and takes security measures to protect access to the code or data. If hosting the SDK is still a security requirement for your organization, this document will walk you through the process.

For more information on how to proxy the traffic with your own CNAME, which is not required for hosting, read the Enable PX Tracking with Proxy Server article from the Additional Resources section.

Steps to Host the SDK

The process to host the SDK comprises of the following two steps: 

  1. Host the JS files and CSS
  2. Override the SDK Path 

Host the JS Files and CSS

This first step is to host the JS and CSS file, depending on the version you wish to use:

Host Latest SDK Version

To use the most latest SDK version provided by Gainsight, use the below URLs. To use any other/specific version, refer to the Host A Specific SDK Version section instead. 

File US Path EU Path  Description Variables
SDK

https://web-sdk.aptrinsic.com/api/aptrinsic.js


https://web-sdk.aptrinsic.com/api/aptrinsic.js?a=AP-UPDATE_KEY-2

https://web-sdk-eu.aptrinsic.com/api/aptrinsic.js

https://web-sdk-eu.aptrinsic.com/api/aptrinsic.js?a=AP-UPDATE_KEY-2

You require the Product KEY if you need to fetch content from Gainsight PX before hosting. URL (For more information, refer to the screenshot below this table)
CSS

https://web-sdk.aptrinsic.com/style.css

https://web-sdk.aptrinsic.com/style.css?a=AP-UPDATE_KEY-2

https://web-sdk-eu.aptrinsic.com/style.css

https://web-sdk-eu.aptrinsic.com/style.css?a=AP-UPDATE_KEY-2

You require the Product KEY if you need to fetch content from Gainsight PX before hosting.

cssFileEndpoint

(Refer to the Tag Snippet Example)

Widget https://web-sdk.aptrinsic.com/widget/aptrinsic-widget.js  https://web-sdk-eu.aptrinsic.com/widget/aptrinsic-widget.js Key is not required widgetFileEndpoint 

(Refer to the Tag Snippet Example)
Badge icons

The following   file paths are branched off the root https://web-sdk.aptrinsic.com

/images/badge/types/announce.svg

/images/badge/types/bulb.svg

/images/badge/types/cap.svg

/images/badge/types/exclam.svg

/images/badge/types/question.svg

/images/badge/types/flag.svg

/images/badge/types/guide.svg

/images/badge/types/arrow.svg

/images/badge/types/badge.svg

/images/badge/types/check.svg

/images/badge/types/cross.svg

/images/badge/types/dash.svg

/images/badge/types/feedback.svg

/images/badge/types/info.svg

/images/badge/types/nps.svg

/images/badge/types/star.svg

/images/badge/types/tooltip.svg

   

 

The following is an example of the snippet while using the most latest SDK version:

<script type="text/javascript">
  (function(n,t,a,e,co){var i="aptrinsic";n[i]=n[i]||function() {
    (n[i].q=n[i].q||[]).push(arguments)},n[i].p=e;n[i].c=co;
    var r=t.createElement("script");r.async=!0,r.src=a+"?a="+e;
    var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(r,c)
  })
  (window,document,"https://web-sdk.aptrinsic.com/api/aptrinsic.js","AP-ZZZZZZZZ-2");
</script>

Host A Specific SDK Version

If your organization uses SDK versioning and you choose to use a specific SDK version,  perform the following steps:

  1. Use the following URL https://cdnjs-web-sdk.aptrinsic.com/web-sdk/<APP-VERSION>/api/aptrinsic.js 
  2. Replace <APP-VERSION> with the applicable SDK version. Click here to learn more about the version number.

Note: Configuration using a traffic proxy is not supported when you use a specific SDK version. For more information on using a proxy server, refer to the Enable PX Tracking with Proxy Server article.

Here is an example of the snippet while using a specific SDK version: 

<script type="text/javascript">
  (function(n,t,a,e,co){var i="aptrinsic";n[i]=n[i]||function() {
    (n[i].q=n[i].q||[]).push(arguments)},n[i].p=e;n[i].c=co;
    var r=t.createElement("script");r.async=!0,r.src=a+"?a="+e;
    var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(r,c)
  })
  (window,document,"https://cdnjs-web-sdk.aptrinsic.com/web-sdk/0.54.0/api/aptrinsic.js","AP-ZZZZZZZZ-2");
</script>

Override the SDK Path

Once the SDK file is hosted, the next step is to overide the SDK path tag and override the Content Endpoint settings. 

Note: Gainsight PX SDK will try to fetch relevant assets such as JS/CSS unless you override the cssFileEndpoint and widgetFileEndpoint properties. 

To override the path: 

  1. Update the domain with the new host
  2. Pass the setting to the SDK via cssFileEndpoint and widgetFileEndpoint 
  3. Update the product KEY.

The following is an example of the snippet while using the most latest SDK version:

{
      "cssFileEndpoint":"https://web-sdk.aptrinsic.com/style.css" ,   
      "widgetFileEndpoint":"https://web-sdk.aptrinsic.com/widget/aptrinsic-widget.js"
    }

The following is an example of the snippet while using a specific SDK version: 

{
  "cssFileEndpoint":"https://cdnjs-web-sdk.aptrinsic.com/web-sdk/0.54.0/style.css" ,   
  "widgetFileEndpoint":"https://cdnjs-web-sdk.aptrinsic.com/web-sdk/0.54.0/widget/aptrinsic-widget.js"
    }

Gainsight PX Guide Editor 

These are the files used by the in-app Editor for Gainsight PX admin. These files are not required for runtime tracking or engagement, and therefore not required for hosting.

/api/editor.js
/api/guide-editor.min.js
/editor.css
/images/preview-green.svg
/images/reoder-1.svg
/font/font-awesome/4.4.0/font-awesome.css
/froala/css/2.5.1/froala_editor.pkgd.min.css
/froala/css/2.5.1/colors.min.css
/froala/css/2.5.1/froala_style.min.css
/froala/css/2.5.1/plugins/emoticons.min.css
/froala/css/2.5.1/plugins/video.min.css
/froala/css/2.5.1/plugins/table.min.css
/froala/css/2.5.1/plugins/image.min.css
/froala/css/2.5.1/plugins/file.min.css
/color-picker/color-picker.min.css
/color-picker/color-picker.min.js
/opentip-native.min.js
/opentip.css

  • Was this article helpful?