README
Smartlook REST API Client
Smartlook REST API Client is a Typescript library for retrieving data from the Smartlook.
Installation
Use the package manager npm to install the library.
npm install @smartlook/rest-api-client
Usage
At first you need to get an API token for your project. You can do so in settings of your project (managing your project tokens is described in the docs).
import * as SmartlookAPI from '@smartlook/rest-api-client'
const client = SmartlookAPI.createSmartlookClient(<YOUR_API_TOKEN>)
const response = await client.events.getEventDetail({
dateFrom: '2020-01-01',
dateTo: '2020-01-10',
eventId: 'foobar',
occurrenceHistogramInterval: 'day',
})
The client is using node-fetch on the background.
If you want to handle the requests to the Smartlook REST API by yourself, you can pass makeRequest: MakeRequest
function to the client factory instead of the API token.