Package detail

hockeystack

HockeyStack843MIT1.3.209

You should make your changes in the develop branch. We don't actually use the master branch here.

readme

hockeystack-js

You should make your changes in the develop branch. We don't actually use the master branch here.

The main tracking script is in hockeystack.js. This script can call other integration specific scripts within it.

CDN and Hosting

The script is generated through an NPM package and is hosted through the JSDelivr CDN like this: https://cdn.jsdelivr.net/npm/hockeystack@latest/hockeystack.min.js

Deploying to CDN

When you've made a change and want to deploy it to the CDN, follow these steps:

  1. git push your changes to develop branch
  2. npm version patch to save your changes to the NPM package. This will output the new version of the script in your terminal (Make sure you have authenticated)
  3. npm publish to publish them to NPM
  4. git push again because NPM creates one extra commit
  5. Purge the script in CDN to get the latest version.
  6. Hard reload the jsdelivr link and make sure you see the new version.

NPM Authentication

We have an NPM account that you might need to publish the change. Ask Arda for the username and password.

Send requests

  1. First we try to send requests via Beacon (sendReqViaBeacon - hockeystack.js)
  2. If it fails, we are retrying via XHR (sendReqViaXHR - hockeystack.js)
  3. You can check sendActions function in the hockeystack.js file to have better understanding of the request flow

Testing new features

We have a file called hockeystack-staging.js, we use it to test new stuff in production. Use hsstaging=true in the URL to enable it

Debug mode

If you add hsdebug=true to the query parameters in the URL, you can enable Debug Mode. This basically logs a lot more things in the browser console to debug issues faster.