Configuration
Authentication
Most of the GoSquared API requires authentication credentials. Sometimes you'll only need an API Key, other times you might also need to specify the token for the project.
It depends on the function being used, but usually you'll need to specify the following parameters:
Parameter | Description |
---|---|
api_key | An API Key associated with your account. You can manage your API keys under the API Access section of your account settings |
site_token | The token for the project you are retrieving data for. You can find this by navigating to Settings > Current Project > General. |
API Key Scopes
When you create an API Key for your account, you can choose to grant it a set of scopes which indicate what permissions are associated with that API Key. Scopes restrict access for a particular API Key to specific sections of the API, and prevent applications from accessing, tracking or modifying data when they shouldn't.
The Node.js module requires a valid api_key
and site_token
.
Options
Option | Description | Type | Default |
---|---|---|---|
api_key | An API Key that's authorised to write_tracking . | String | undefined |
site_token | The site token of the site to track data for. | String | undefined |
requestTimeout | Max running time of requests in milliseconds. | Number | 10000 |
log | Logging function for internal debug. | Function | function(d) |
var gosquared = new GoSquared({
api_key: 'demo',
site_token: 'GSN-106863-S',
requestTimeout: 20000,
log: function(d) {
console.log('GoSquared Log: ', d);
}
});