Registry / database / typedb-driver-http

typedb-driver-http

JSON →
library3.5.5jsnpmunverified

Official HTTP TypeScript driver for TypeDB (v3.x, ~monthly releases). Provides typed API for opening transactions, executing queries (match, insert, delete, update), and retrieving results. Supports authentication, TLS, and concurrent operations. Differentiator: full TypeScript types included, integrates with TypeDB's type system and transaction isolation. No ORM overhead — direct HTTP calls to TypeDB Server REST API.

npm install typedb-driver-http
INSTALL
IMPORT
SIG · TYPEDB-DRIVER-HTTP
T
typedb-driver-http
databasejavascriptv3.5.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

TypeDBHttpDriver
import { TypeDBHttpDriver } from 'typedb-driver-http'
import TypeDBHttpDriver from 'typedb-driver-http'
Named export, not default. Requires ESM or CJS with named imports.
isApiErrorResponse
import { isApiErrorResponse } from 'typedb-driver-http'
const { isApiErrorResponse } = require('typedb-driver-http')
TypeScript/ESM module; require() may not work in all bundlers.
ApiResponse
import type { ApiResponse } from 'typedb-driver-http'
import { ApiResponse } from 'typedb-driver-http'
ApiResponse is a type-only export; use type import for TypeScript to avoid runtime error.

Opens a read transaction, runs a match query, and logs results handling errors with isApiErrorResponse.

import { TypeDBHttpDriver, isApiErrorResponse } from 'typedb-driver-http' async function run() { const driver = new TypeDBHttpDriver({ username: 'admin', password: process.env.TYPEDB_PASS ?? 'password', addresses: ['localhost:1729'], }) const txnResp = await driver.openTransaction('my-db', 'read') if (isApiErrorResponse(txnResp)) { console.error('Transaction error:', txnResp.err) return } const txnId = txnResp.ok.transactionId const answerResp = await driver.query(txnId, 'match entity $x;') if (isApiErrorResponse(answerResp)) { console.error('Query error:', answerResp.err) return } const answer = answerResp.ok if (answer.answerType === 'conceptRows') { answer.answers.forEach(row => console.log(row.data)) } await driver.closeTransaction(txnId) } run()
Debug
Known issues
breakingDriver API changed from callback-style to promise-based in v2.x. Old code using `.then()` on transaction methods may break.
fix
Migrate to async/await or update .then() calls to handle new return types.
affects: >=2.0.0 <3.0.0
deprecatedopenTransaction() option parameter 'type' is deprecated; use 'transactionType' instead.
fix
Replace { type: 'read' } with { transactionType: 'read' }.
affects: >=3.0.0
gotchaisApiErrorResponse() must be called to check for errors; the driver does not throw on HTTP error status codes (non-2xx).
fix
Always call isApiErrorResponse() on responses before accessing .ok.
affects: >=3.0.0
gotchaDriver does not support connection pooling or retry logic; each HTTP request is independent.
fix
Implement custom retry/backoff around driver calls for production use.
affects: >=3.0.0
breakingIn v3.0.0, the query() method now returns ApiResponse wrapping structured answer objects instead of raw JSON.
fix
Update code to destructure .ok and check answerType before accessing answers.
affects: >=3.0.0 <3.5.0
Errors
Common errors & fixes
Error: Cannot find module 'typedb-driver-http'
Package not installed or missing from dependencies.
fix
Run npm install typedb-driver-http
TypeError: driver.openTransaction is not a function
Importing default export instead of named export.
fix
Use import { TypeDBHttpDriver } from 'typedb-driver-http'
Property 'answerType' does not exist on type 'ApiResponse'
Forgetting to check for error with isApiErrorResponse() before accessing .ok.
fix
Wrap with isApiErrorResponse(resp) and only access .ok after successful check.
Upgrade
Version history
3.5.5latest on npm
Audit
Dependencies
typedb-protocolrequiredProtocol definitions (query results, errors)
Agent activity
14 hits · last 30 days
node
10
Meta
2
Amazon
1
OpenAI (training)
1
Resources
typedb-driver-http — npm install typedb-driver-http · libregistry