node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »



Travis Dependencies Join the chat at


The official GoSquared Node.js module for integrating the GoSquared API into your Node.JS app with ease.


npm install --save gosquared


Tracking API

See the Tracking API docs site for full documentation.

Reporting API

var GoSquared = require('gosquared');
var gosquared = new GoSquared({
  api_key: 'demo',
  site_token: 'GSN-181546-E'

Methods mirror the structure of the GoSquared API:


Consult the Reporting API Docs for available namespaces, versions, and functions.

Example: We want to get the total number of visitors online on the site right now. For this, we need to use the concurrents function under the v3 version of the now namespace:

var GoSquared = require('gosquared');
var gosquared = new GoSquared({
  api_key: 'demo',
  site_token: 'GSN-181546-E'
});,data) {
  if (e) return console.log(e);

All functions listed in the Reporting API documentation are methods you can call on the gosquared object. The documentation also demonstrates the response data you can expect to get back.

Run tests

Install test dependencies using npm install then:

SITE_TOKEN=<your site token> API_KEY=<your api key> npm test-tracking
SITE_TOKEN=<your site token> API_KEY=<your api key> npm test-retrieval