Registry / database / neo4j-driver-bolt-connection

neo4j-driver-bolt-connection

JSON →
library5.28.3jsnpmunverified

The `neo4j-driver-bolt-connection` package provides the low-level implementation for establishing and managing connections to Neo4j databases using the binary Bolt Protocol. It is an internal dependency foundational to the official `neo4j-driver` and `neo4j-driver-lite` packages for JavaScript and TypeScript. Crucially, this package is explicitly *not* intended for direct consumption by end-users, serving as an abstraction layer for Bolt protocol specifics. The current stable version is 5.28.3, with version 6.0.x introducing new features like support for Neo4j's Vector type. Release cadence for the main `neo4j-driver` and its internal components, including this one, has evolved; post-6.0, minor releases occur as warranted by significant features or improvements, moving away from a monthly cadence to reduce user update overhead. Key differentiators include its role in abstracting complex network communication and Bolt handshake protocols, enabling the higher-level drivers to offer robust API usability, transaction management, and connection pooling capabilities transparently. While it handles the core communication, developers should always use the comprehensive `neo4j-driver` for a stable and supported experience.

npm install neo4j-driver-bolt-connection
INSTALL
IMPORT
SIG · NEO4J-DRIVER-BOLT-
N
neo4j-driver-bolt-connection
databasejavascriptv5.28.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Connection
// This package is for internal use. Use 'neo4j-driver' instead.
import { Connection } from 'neo4j-driver-bolt-connection';
Directly importing internal types or modules from `neo4j-driver-bolt-connection` is strongly discouraged as its API is unstable and subject to breaking changes without notice. It's intended to be an internal dependency of `neo4j-driver`.
ConnectionProvider
// This package is for internal use. Use 'neo4j-driver' instead.
const { ConnectionProvider } = require('neo4j-driver-bolt-connection');
For CommonJS environments, requiring this internal package directly is also a footgun. Always use the public API provided by `neo4j-driver` for reliable interaction with Neo4j.
any internal export
// Refer to the 'neo4j-driver' documentation for public APIs.
import * as boltInternals from 'neo4j-driver-bolt-connection';
Any attempt to access internal components of `neo4j-driver-bolt-connection` directly constitutes an unsupported usage pattern that bypasses the stable, versioned API of the main `neo4j-driver` package. This can lead to unhandled errors and difficult-to-debug issues.

This quickstart demonstrates how to connect to a Neo4j database using the official `neo4j-driver` package, which internally relies on `neo4j-driver-bolt-connection`. It shows a basic query execution and proper resource management, emphasizing that direct usage of this internal package is discouraged.

import neo4j from 'neo4j-driver'; // IMPORTANT: neo4j-driver-bolt-connection is an internal package. // Always use the official 'neo4j-driver' for your applications. const uri = process.env.NEO4J_URI ?? 'bolt://localhost:7687'; const user = process.env.NEO4J_USERNAME ?? 'neo4j'; const password = process.env.NEO4J_PASSWORD ?? 'password'; const driver = neo4j.driver(uri, neo4j.auth.basic(user, password)); async function queryNeo4j() { const session = driver.session(); try { const result = await session.run( 'CREATE (a:Greeting {message: $message}) RETURN a.message AS message', { message: 'Hello, Neo4j!' } ); const singleRecord = result.records[0]; const message = singleRecord.get('message'); console.log(`Successfully created a node with message: ${message}`); } catch (error) { console.error('Error connecting to Neo4j or running query:', error); } finally { await session.close(); console.log('Session closed.'); } } queryNeo4j() .then(() => driver.close()) .catch(error => { console.error('Driver encountered an error:', error); driver.close(); });
Debug
Known issues
gotchaThis package (`neo4j-driver-bolt-connection`) is an internal component of the official `neo4j-driver` and `neo4j-driver-lite`. It is explicitly *not* intended for direct consumption by end-users. Direct usage can lead to unexpected behavior, API instability, and lack of support.
fix
Always use the main `neo4j-driver` or `neo4j-driver-lite` package instead. This internal package handles low-level Bolt protocol details transparently, which is encapsulated by the public drivers.
affects: >=5.0
breakingThe `protocolVersion` property on the `ServerInfo` object changed its type from a `Number` to a new `ProtocolVersion` type in v6.0.0 of the `neo4j-driver`. Code expecting a plain number for Bolt protocol version information will break.
fix
Update code that accesses `ServerInfo.protocolVersion` to correctly handle the new `ProtocolVersion` type. This change prevents issues if Bolt minor versions exceed 9. Ensure your application's logic adapts to this new type rather than assuming a primitive number.
affects: >=6.0.0
gotchaTypeScript exports for `Vector` and `vectors` types were initially incorrect or incomplete in the `neo4j-driver` v6.0.0 release, affecting applications utilizing the new Bolt 6.0 features for vector data types.
fix
Upgrade to `neo4j-driver` version 6.0.1 or higher to ensure correct TypeScript typings for `Vector` and `vectors` are available when working with the new vector features.
affects: 6.0.0
gotchaWhen connecting directly to IP addresses using previous versions of the `neo4j-driver`, users might encounter SNI (Server Name Indication) deprecation messages, indicating a potential issue with hostname verification.
fix
Upgrade to `neo4j-driver` version 5.28.3 or newer. This version includes a fix specifically addressing the SNI deprecation message when connecting directly to IP addresses.
affects: >=5.x <5.28.3
Errors
Common errors & fixes
Error: Cannot find module 'neo4j-driver-bolt-connection'
Attempting to import `neo4j-driver-bolt-connection` directly or it's missing as a transitive dependency due to incorrect installation or package manager issues.
fix
This package is an internal dependency. Do not install or import it directly. Instead, ensure `neo4j-driver` (or `neo4j-driver-lite`) is correctly installed: `npm install neo4j-driver`.
TypeError: Cannot read properties of undefined (reading 'protocolVersion')
Accessing `ServerInfo.protocolVersion` expecting a `Number` after upgrading to `neo4j-driver` v6.0.0 or higher, but the type has changed to `ProtocolVersion`.
fix
Refactor code to handle the new `ProtocolVersion` type for `ServerInfo.protocolVersion` in `neo4j-driver` v6.0.0+. Consult the `neo4j-driver` v6 documentation for updated API details on `ServerInfo`.
Upgrade
Version history
5.28.3latest on npm
Audit
Dependencies
neo4j-driver-corerequiredProvides core interfaces like Connection and ConnectionProvider, which this package implements.
Agent activity
6 hits · last 30 days
node
6
Resources
neo4j-driver-bolt-connection — npm install neo4j-driver-bolt-connection · libregistry