Requirements
- Node 12 or newer.
Install
npm install @peaka/client
or
yarn add @peaka/client
Usage
Create a Peaka connection
Submit a query
Iterate through the query results
Alternative: map and aggregate the data
Handle the Errors
Query errors are returned in two different ways.- The
connection.query()method throws an error object, and theerror.response.dataobject contains the following properties:
| Error Property | Description |
|---|---|
| errorCode | Code of error |
| message | Description of the error |
| traceId | The identifier that you can give Peaka Team to learn more about the error |
- The
connection.query()method returns successfully, but the response may include anerrorobject with the following structure: