Get started

This section gives an overview of the official Neo4j JavaScript Driver and how to connect to a Neo4j database with a "Hello World" example.

1. About the official JavaScript driver

Neo4j provides official drivers for a number of popular programming languages. These drivers are supported by Neo4j.

Community drivers also exist for many languages, but vary greatly in terms of feature sets, maturity, and support. To find more about community drivers, visit

The following languages and frameworks are officially supported by Neo4j:

Table 1. Supported languages and frameworks for the 4.x driver series
Language/framework Versions supported



All the Go versions officially supported (


Java 8+ (latest patch releases).


All LTS versions of Node.JS, specifically the 4.x and 6.x series runtimes (


Python 3.6 and above.

The driver API is intended to be topologically agnostic. This means that the underlying database topology — single instance, Causal Cluster, etc. — can be altered without requiring a corresponding alteration to application code.

In the general case, only the connection URI needs to be modified when changes are made to the topology.

The official drivers do not support HTTP communication. If you need an HTTP driver, choose one of the community drivers.

See also the HTTP API documentation.

2. Driver versions and installation

Starting with Neo4j 4.0, the versioning scheme for the database, driver and protocol have all been aligned. This simplifies general compatibility concerns.

Cross-version compatibility is still available, and minimum support for current and previous versions between both server and driver is guaranteed. More specifically, this means that Neo4j 4.0 is guaranteed to be compatible with both 4.0 Drivers and 1.7 Drivers, and the 4.0 Drivers are guaranteed to be compatible with both Neo4j 4.0 and Neo4j 3.5. In cases where at least one peer is below version 4.0, communication will occur in fallback mode, limiting functionality to that available in the lowest-versioned component.

Drivers 1.7 do not support multiple databases and Neo4j Fabric, features introduced in Neo4j 4.0. To be able to run multiple databases online concurrently and to do distributed queries over them, you must upgrade Drivers from 1.7 to 4.0. For information, see 4.0 Migration Guide → Chapter 6. Upgrade Neo4j drivers.

Wherever possible, it is recommended to use the latest stable driver release available. This will provide the greatest degree of stability and will ensure that the full set of server functionality is available. The drivers, when used with Neo4j Enterprise Edition, come with full cluster routing support. The drivers make no explicit distinction between Enterprise Edition and Community Edition however, and simply operate with the functionality made available by Neo4j itself.

Example 2. Acquire the driver

To use the JavaScript driver, it is recommended employing npm. To find the latest version of the driver, use:

npm show neo4j-driver@* version


  • Babel/Runtime (^7.5.5)

  • RxJS (^6.5.2)

  • buffer (^6.0.3)

  • string_decoder (^1.3.0)

The JavaScript Reactive API is built and exposed via RxJs. A dependency of RxJs is automatically installed with the driver.

Example 1. Installation via npm

To install the latest version of the driver:

npm install neo4j-driver

It is also an option to install a certain version of the driver.

npm install neo4j-driver@$JAVASCRIPT-DRIVER-VERSION

In the following example, driver version 4.4.0 is installed.

npm install neo4j-driver@4.4.0

The release notes for this driver are available here.

3. A "Hello World" example

The example below shows the minimal configuration necessary to interact with Neo4j through the JavaScript driver.

Example 3. Hello World
const driver = neo4j.driver(uri, neo4j.auth.basic(user, password))
const session = driver.session()

try {
  const result = await session.writeTransaction(tx =>
      'CREATE (a:Greeting) SET a.message = $message RETURN a.message + ", from node " + id(a)',
      { message: 'hello, world' }

  const singleRecord = result.records[0]
  const greeting = singleRecord.get(0)

} finally {
  await session.close()

// on application exit:
await driver.close()

4. Driver API docs

For a comprehensive listing of all driver functionality, please see the JavaScript API reference documentation.