Javascript is one of the Neo4j supported languages and an official driver is provided. Official drivers connect to the databases using BOLT protocol (HTTP is not available).
We are working on supporting Neo4j 4.1 drivers. Please use 4.0 in the meantime.
About connection parameters
We've used test credentials for all the following examples. Please replace them with your real connection parameters.
You'll find all the required information to connect to your database on our admin panel if you navigate to the Connection section. More on connecting to your database [here](🔗)
This section is intended to provide a small working example to connect to a GrapheneDB database using the Javascript driver. To get more detailed information, visit the driver web page: http://neo4j.com/docs/api/javascript-driver/current/
**Bolt protocol is only available in 3.0.0 or higher versions of Neo4j.** You can check your Neo4j version if you navigate to the Overview page of your database.
Install neo4j-driver via npm:
Check the [driver releases](🔗) for the newest driver version available.
In the last version of Neo4j drivers the default configuration for encrypted option is now false. Since **GrapheneDB only accepts encrypted connections**, please ensure encryption is active.
Setting up the connection:
You can also use the new `bolt+s
` URI scheme to enable encryption with a full certificate check:
If you are using **1.7** version of the driver, you need to use `
neo4j.v1
` namespace.
You can test the connection by running a simple query of the Movies dataset example:
If you need to use the driver on the browser, there is a special version which supports connection to your Neo4j database using WebSockets.
One of the following tags need to be included in the HTML code (change X.Y.Z with the driver version, e.g. 4.0.2):
Connect to the Neo4j instance and run a simple query from the browser: