Interana Track SDK
The Interana SDK can be integrated into a JavaScript Web application, allowing you to send events to an Interana instance.
Installing the SDK
To install the SDK, run the following command:
npm install --save interana-sdk
Using the SDK
To start using the SDK, import it into your JS application.
import interana from 'interana-sdk';
If you don't use a module bundler like webpack, you can still directly download the bundle from our CDN and include it via a <script>
tag. You can also use the snippet below.
Note: Even though you can import the SDK in Node.js (server side), the track
calls will not succeed because we use XMLHttpRequest
. Node.js support is not currently on our roadmap.
Browser Snippet:
<script>
var interana=function(){"use strict";var t=window.interana||{init:function(){t.calls.push({i:arguments})},track:function(){t.calls.push({tr:arguments,ti:Date.now()})},trackWithTimestamp:function(){t.calls.push({trt:arguments})},calls:[]};return t}();
</script>
<script async src="https://sdk.interana.com/interana-sdk.browser.min.js"></script>
Usage Docs
Detailed usage docs are available here.