neo4j-driver-javascript-skill

Implements Neo4j connectivity in JavaScript and TypeScript using the official driver v6.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-driver-javascript-skill-cardox6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-driver-javascript-skill
Source: https://github.com/cardox6/steuer-graph/tree/main/.agents/skills/neo4j-driver-javascript-skill
Command: npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-driver-javascript-skill-cardox6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires neo4j-driver, and includes references (resource) components.

What problem does it solve? Connecting JavaScript or TypeScript applications to Neo4j involves many subtle pitfalls: Integer serialization errors, leaked sessions, unretried transactions, and records that are not plain objects. This Skill provides correct, production-oriented patterns for the official Neo4j JavaScript Driver v6 so these mistakes are avoided from the start. ## Core Features & Use Cases - Driver Lifecycle & Connection Setup: Create a single shared driver instance, choose the right URI scheme (neo4j+s://, bolt://), configure authentication, and verify connectivity at startup. - Query Execution Patterns: Guidance on executeQuery, managed transactions (executeRead/executeWrite), and session.run, including retry behavior, streaming results, and session cleanup in finally blocks. - Type Handling & Serialization: Correct handling of 64-bit Integers, temporal and spatial types, record access via .get(), and safe JSON serialization for REST APIs. - Use Case: You are building a Node.js Express API backed by Neo4j Aura. Use this Skill to set up the driver singleton, run parameterized Cypher with executeQuery, batch writes with UNWIND, and serialize query results to JSON without Integer or DateTime corruption. ## Quick Start Ask the assistant to write a Node.js script that connects to Neo4j Aura with the official driver and runs a parameterized query using executeQuery.

Frequently Asked Questions about neo4j-driver-javascript-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Neo4j from Node.js with the official driver?▼

Install neo4j-driver, then create one driver instance at startup with neo4j.driver(URI, neo4j.auth.basic(user, password)) and call await driver.verifyConnectivity(). Share that single instance everywhere and close it with await driver.close() on shutdown.

What is the difference between executeQuery, executeRead, and session.run?▼

executeQuery is the default API returning eager results with auto-retry. executeRead and executeWrite are managed transactions that stream results and auto-retry transient failures. session.run is an implicit transaction without retries, intended for LOAD CSV or CALL IN TRANSACTIONS.

Why does JSON.stringify on Neo4j query results produce wrong output?▼

Neo4j Integers serialize as {low, high} objects and temporal types serialize as empty objects. Convert values first with .toNumber() or .toString(), or configure the driver with disableLosslessIntegers: true when values stay within Number.MAX_SAFE_INTEGER.

Does the Neo4j JavaScript driver work in the browser?▼

Yes, the driver works in browsers bundled with webpack, Vite, or Rollup, but it connects over WebSockets. Use neo4j+s:// (WSS) or neo4j:// (WS) URIs instead of bolt://, and never embed production credentials in client-side code.

Why does my transaction callback return empty records?▼

await tx.run() returns a stream handle, not records, and the stream is gone when the callback returns. Collect results inside the callback with await result.collect() or iterate with for-await, then return plain mapped data.

When should I not use this driver skill?▼

This Skill does not cover Cypher query authoring, which belongs to neo4j-cypher-skill, nor driver version migration, which belongs to neo4j-migration-skill. It focuses strictly on driver usage patterns for neo4j-driver v6.