Module @influxdata/influxdb-client

The @influxdata/influxdb-client package provides optimized APIs that write or query InfluxDB v2.

The entry point of this package is the @influxdata/influxdb-client!InfluxDB class. It is initialized with options that tells how to communicate with InfluxDB. The simple usage pattern is:

import {InfluxDB} = from('@influxdata/influxdb-client')
const influxDB = new InfluxDB({
url: "http://localhost:8086",
token: "your-api-token"
})

The influxDB object let you create two essential API instances, @influxdata/influxdb-client!InfluxDB.getWriteApi and @influxdata/influxdb-client!InfluxDB.getQueryApi. The @influxdata/influxdb-client!WriteApi asynchronously writes measurement points on background, in batches to optimize network traffic, and with retries upon failures. The @influxdata/influxdb-client!QueryApi let you execute a flux query against InfluxDB and offers several ways to stream query results.

The influxDB object is also used to create more specialized InfluxDB management API instances in @influxdata/influxdb-client-apis .

See also examples to know more.

@influxdata/influxdb-client

The reference javascript client for InfluxDB 2.x. Both node and browser environments are supported. The package.json

  • main points to node.js CJS distribution
  • module points to node.js ESM distribution
  • browser points to browser (UMD) distribution

Node.js distributions do not work in browser and vice versa, because different platform APIs are used. Use @influxdata/influxdb-client-browser to import browser ESM module. See https://github.com/influxdata/influxdb-client-js to know more.

Note: This library is for use with InfluxDB 2.x or 1.8+. For connecting to InfluxDB 1.x instances, see node-influx.

Classes

AbortError
HttpError
IllegalArgumentError
InfluxDB
LineSplitter
Point
RequestTimedOutError

Interfaces

AnnotatedCSVResponse
Cancellable
ChunkCombiner
ClientOptions
CommunicationObserver
ConnectionOptions
FluxParameterLike
FluxResultObserver
FluxTableColumn
FluxTableMetaData
Logger
Observable
Observer
ParameterizedQuery
PointSettings
QueryApi
QueryOptions
RetriableDecision
RetryDelayStrategy
RetryDelayStrategyOptions
Row
SendOptions
Subscribable
Subscription
Transport
WriteApi
WriteOptions
WriteRetryOptions

Type Aliases

APIExecutor
ColumnType
HttpHeaders
IterableResultExecutor
ObserverComplete
ObserverError
ObserverNext
ResponseStartedFn
WritePrecisionType

Variables

consoleLogger
currentTime
dateToProtocolTimestamp
DEFAULT_ConnectionOptions
DEFAULT_RetryDelayStrategyOptions
DEFAULT_WriteOptions
escape
FLUX_VALUE
Log
symbolObservable
typeSerializers
UNKNOWN_COLUMN

Functions

canRetryHttpCall
chunksToLines
chunksToLinesIterable
convertTimeToNanos
createFluxTableColumn
createFluxTableMetaData
createTextDecoderCombiner
flux
fluxBool
fluxDateTime
fluxDuration
fluxExpression
fluxFloat
fluxInteger
fluxRegExp
fluxString
getRetryDelay
isStatusCodeRetriable
linesToRowsIterable
linesToTables
newFluxTableColumn
sanitizeFloat
sanitizeInteger
serializeDateTimeAsDate
serializeDateTimeAsNumber
serializeDateTimeAsString
setLogger
stringToLines
toFluxValue
useProcessHrtime

References

Headers → HttpHeaders
MMNEPVFCICPMFPCPTTAAATR