First off, you'll need to require in the SDK to your script. This can be done in the usual way, as you can see below.
//Require in the JavaScript SDK const Analytics = require('@blinkmobile/analytics-sdk')
Next, we recommend setting up global variables for your Access key and Secret Key, as well as the URL of the Analytics Service (Here we'll just be using the URL to the BlinkMobile Simple Analytics Service: https://analytics.blinkm.io)
// Set your keys and Simple Analytics service URL const ANALYTICS_ACCESS_KEY = 'my-api-project' const ANALYTICS_SECRET_KEY = '887659807=3124hjkgf987hjgf77t876t876g' const ANALYTICS_URL = 'https://analytics.blinkm.io'
This will allow you to quickly reference these throughout your script, rather than hardcoding each value.
Next we'll show you how to initialise your custom collector.