Skip to main content

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 the error.response.data object contains the following properties:
  • The connection.query() method returns successfully, but the response may include an error object with the following structure:
In order to handle all possible errors, please make sure to check both objects, as demonstrated in the example below: