1.1.0 • Published 4 years ago

trackjs-api-client v1.1.0

Weekly downloads
60
License
ISC
Repository
github
Last release
4 years ago

TrackJS Data API for NodeJS

NodeJS implementation of the Track JS Data API.

Reference

Prerequisites

You'll need to get a Track JS API key and a Track JS API Customer ID from https://my.trackjs.com/Account/Organization.

Usage

Install the dependency:

npm install trackjs-api-client

Then in your Node application:

import { Client } from 'trackjs-api-client';

const trackJs = new Client(
  '<insert your apiKey here>',
  '<insert your customerId here>'
);

After that you are good to go!

Available exports

trackJs.getErrors(params)

API reference: http://docs.trackjs.com/data-api/errors

ParametertypeRequiredDescription
applicationStringnoFilter the results to only the Application key provided.
endDateISO 8601 StringnoFilter the results to only return errors before this date. Time precision is within 1 second.
startDateISO 8601 StringnoFilter the results to only return errors after this date. Time precision is within 1 second.
pageNumbernoThe page of data you want returned. By default, the first page of data is returned.
sizeNumbernoThe size of the page of data you want returned.
queryNumbernoFilter the results to errors that match the supplied query term.
includeStackBooleannoWhether to return a stackTrace with the Error response.

trackJs.getErrorsByDay(params)

API reference: http://docs.trackjs.com/data-api/errors-by-day

ParametertypeRequiredDescription
applicationStringnoFilter the results to only the Application key provided.
endDateISO 8601 StringnoFilter the results to only return errors before this date. Time precision is within 1 second.
startDateISO 8601 StringnoFilter the results to only return errors after this date. Time precision is within 1 second.
pageNumbernoThe page of data you want returned. By default, the first page of data is returned.
sizeNumbernoThe size of the page of data you want returned.
sortStringnoBy default the endpoint returns results sorted by date in descending order. You may adjust the sort field and sort direction. Supported fields are date, count and usercount. Sort directions are specified by appending | asc or | desc. Default value is date | desc if not specified.

trackJs.getErrorsByHour(params)

API reference: http://docs.trackjs.com/data-api/errors-by-hour

ParametertypeRequiredDescription
applicationStringnoFilter the results to only the Application key provided.
endDateISO 8601 StringnoFilter the results to only return errors before this date and time. Time precision is within 1 second.
startDateISO 8601 StringnoFilter the results to only return errors after this date and time. Time precision is within 1 second.
pageNumbernoThe page of data you want returned. By default, the first page of data is returned.
sizeNumbernoThe size of the page of data you want returned.
sortStringnoBy default the endpoint returns results sorted by date in descending order. You may adjust the sort field and sort direction. Supported fields are date, count and usercount. Sort directions are specified by appending | asc or | desc. Default value is date | desc if not specified.

trackJs.getErrorsByMessage(params)

API reference: http://docs.trackjs.com/data-api/errors-by-message

ParametertypeRequiredDescription
applicationStringnoFilter the results to only the Application key provided.
endDateISO 8601 StringnoFilter the results to only return errors before this date. Time precision is within 1 second.
startDateISO 8601 StringnoFilter the results to only return errors after this date. Time precision is within 1 second.
pageNumbernoThe page of data you want returned. By default, the first page of data is returned.
sizeNumbernoThe size of the page of data you want returned.
sortStringnoBy default the endpoint returns results sorted by date in descending order. You may adjust the sort field and sort direction. Supported fields are date, count and usercount. Sort directions are specified by appending | asc or | desc. Default value is date | desc if not specified.

trackJs.getErrorsByUrl(params)

API reference: http://docs.trackjs.com/data-api/errors-by-url

ParametertypeRequiredDescription
applicationStringnoFilter the results to only the Application key provided.
endDateISO 8601 StringnoFilter the results to only return errors before this date. Time precision is within 1 second.
startDateISO 8601 StringnoFilter the results to only return errors after this date. Time precision is within 1 second.
pageNumbernoThe page of data you want returned. By default, the first page of data is returned.
sizeNumbernoThe size of the page of data you want returned.
sortStringnoBy default the endpoint returns results sorted by date in descending order. You may adjust the sort field and sort direction. Supported fields are date, count and usercount. Sort directions are specified by appending | asc or | desc. Default value is date | desc if not specified.

trackJs.getPageViewsByDay(params)

API reference: http://docs.trackjs.com/data-api/pageviews-by-day

ParametertypeRequiredDescription
applicationStringnoFilter the results to only the Application key provided.
endDateISO 8601 StringnoFilter the results to only return errors before this date. Time precision is within 1 second.
startDateISO 8601 StringnoFilter the results to only return errors after this date. Time precision is within 1 second.
pageNumbernoThe page of data you want returned. By default, the first page of data is returned.
sizeNumbernoThe size of the page of data you want returned.
1.1.0

4 years ago

1.0.0

4 years ago