This repository contains the reference javascript client for InfluxDB 2.0. Both node and browser environments are supported.
Note: Use this client library with InfluxDB 2.x and InfluxDB 1.8+. For connecting to InfluxDB 1.7 or earlier instances, see the node-influx client library.
InfluxDB 2.0 client consists of two packages
- @influxdata/influxdb-client
- Querying data using the Flux language
- Writing data
- batched in chunks on background
- automatic retries on write failures
- @influxdata/influxdb-client-js-apis
- provides all other InfluxDB 2.0 APIs for managing
- sources, buckets
- tasks
- authorizations
- health check
- ...
- built on top of @influxdata/influxdb-client-js
- provides all other InfluxDB 2.0 APIs for managing
To use write or query InfluxDB in your project:
$npm install --save @influxdata/influxdb-client
or
$yarn add @influxdata/influxdb-client
To use InfluxDB management APIs in your project:
$npm install --save @influxdata/influxdb-client-apis
or
$yarn add @influxdata/influxdb-client-apis
See examples
- @influxdata/influxdb-client
- @influxdata/influxdb-client-apis
InfluxDB 2.0 API compatibility endpoints are part of the InfluxDB 1.x line since InfluxDB 1.8.0. This allows you to leverage InfluxDB 2.0 client libraries for both writing and querying data with Flux. For more details, see
- InfluxDB 1.8 example
- https://docs.influxdata.com/influxdb/v1.8/about_the_project/releasenotes-changelog/#forward-compatibility
- node v12.13.1 or higher (older versions will work as well)
- yarn 1.9.4. or higher (older versions will work as well)
Run all unit tests:
$ yarn test:unit
Check code coverage of unit tests:
$ yarn coverage
Ensure that:
- You have administrator access to this repo on GitHub
- You have permissions to publish to the influxdata organization on npm
- You are on
master
and the working tree is clean
Then run the publish script in the root of the repo:
make publish VERSION=1.1.0
If you would like to contribute code you can do through GitHub by forking the repository and sending a pull request into the master
branch.
The InfluxDB 2.0 javascript client is released under the MIT License.