Node.js SDK
Last updated
Was this helpful?
Last updated
Was this helpful?
The Node.js SDK is the easiest way to use and query with Node.js.
It uses to efficiently stream data to the client and Records as data frames which are then easily converted to JavaScript objects/arrays or JSON.
Import SpiceClient
and instantiate a new instance with an API Key.
You can then submit queries using the query
function.
SpiceClient
has the following arguments:
apiKey
(string, required): API key to authenticate with the endpoint.
url
(string, optional): URL of the endpoint to use (default: flight.spiceai.io:443)
Retries are performed for connection and system internal errors. It is the SDK user's responsibility to properly handle other errors, for example RESOURCE_EXHAUSTED (HTTP 429)
.
Follow the to install and run spice locally.
Check to learn more.
From the SpiceClient
implements connection retry mechanism (3 attempts by default). The number of attempts can be configured via setMaxRetries
:
Contribute to or file an issue with the spice.js
library at: .