{"id":42160,"library":"typedb-driver-http","title":"TypeDB HTTP Driver (TypeScript)","description":"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.","status":"active","version":"3.5.5","language":"javascript","source_language":"en","source_url":"https://github.com/typedb/typedb-driver","tags":["javascript","database","typedb","typescript"],"install":[{"cmd":"npm install typedb-driver-http","lang":"bash","label":"npm"},{"cmd":"yarn add typedb-driver-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add typedb-driver-http","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Protocol definitions (query results, errors)","package":"typedb-protocol","optional":false}],"imports":[{"note":"Named export, not default. Requires ESM or CJS with named imports.","wrong":"import TypeDBHttpDriver from 'typedb-driver-http'","symbol":"TypeDBHttpDriver","correct":"import { TypeDBHttpDriver } from 'typedb-driver-http'"},{"note":"TypeScript/ESM module; require() may not work in all bundlers.","wrong":"const { isApiErrorResponse } = require('typedb-driver-http')","symbol":"isApiErrorResponse","correct":"import { isApiErrorResponse } from 'typedb-driver-http'"},{"note":"ApiResponse is a type-only export; use type import for TypeScript to avoid runtime error.","wrong":"import { ApiResponse } from 'typedb-driver-http'","symbol":"ApiResponse","correct":"import type { ApiResponse } from 'typedb-driver-http'"}],"quickstart":{"code":"import { TypeDBHttpDriver, isApiErrorResponse } from 'typedb-driver-http'\n\nasync function run() {\n  const driver = new TypeDBHttpDriver({\n    username: 'admin',\n    password: process.env.TYPEDB_PASS ?? 'password',\n    addresses: ['localhost:1729'],\n  })\n\n  const txnResp = await driver.openTransaction('my-db', 'read')\n  if (isApiErrorResponse(txnResp)) {\n    console.error('Transaction error:', txnResp.err)\n    return\n  }\n  const txnId = txnResp.ok.transactionId\n\n  const answerResp = await driver.query(txnId, 'match entity $x;')\n  if (isApiErrorResponse(answerResp)) {\n    console.error('Query error:', answerResp.err)\n    return\n  }\n  const answer = answerResp.ok\n  if (answer.answerType === 'conceptRows') {\n    answer.answers.forEach(row => console.log(row.data))\n  }\n\n  await driver.closeTransaction(txnId)\n}\nrun()","lang":"typescript","description":"Opens a read transaction, runs a match query, and logs results handling errors with isApiErrorResponse."},"warnings":[{"fix":"Migrate to async/await or update .then() calls to handle new return types.","message":"Driver API changed from callback-style to promise-based in v2.x. Old code using `.then()` on transaction methods may break.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Replace { type: 'read' } with { transactionType: 'read' }.","message":"openTransaction() option parameter 'type' is deprecated; use 'transactionType' instead.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Always call isApiErrorResponse() on responses before accessing .ok.","message":"isApiErrorResponse() must be called to check for errors; the driver does not throw on HTTP error status codes (non-2xx).","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Implement custom retry/backoff around driver calls for production use.","message":"Driver does not support connection pooling or retry logic; each HTTP request is independent.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Update code to destructure .ok and check answerType before accessing answers.","message":"In v3.0.0, the query() method now returns ApiResponse wrapping structured answer objects instead of raw JSON.","severity":"breaking","affected_versions":">=3.0.0 <3.5.0"}],"env_vars":null,"search_vec":"'api':16,59 'authent':30 'call':54 'concurr':33 'databas':61 'delet':24 'differenti':35 'direct':52 'driver':3,8 'execut':20 'full':36 'http':2,6,53 'includ':39 'insert':23 'integr':40 'isol':48 'javascript':60 'match':22 'month':12 'offici':5 'open':18 'oper':34 'orm':50 'overhead':51 'provid':14 'queri':21 'releas':13 'rest':58 'result':28 'retriev':27 'server':57 'support':29 'system':45 'tls':31 'transact':19,47 'type':15,38,44 'typedb':1,10,42,56,62 'typescript':4,7,37,63 'updat':25 'v3.x':11","created_at":"2026-06-04T18:55:54.628380+00:00","updated_at":"2026-06-04T18:55:54.628380+00:00","problems":[{"fix":"Run npm install typedb-driver-http","cause":"Package not installed or missing from dependencies.","error":"Error: Cannot find module 'typedb-driver-http'"},{"fix":"Use import { TypeDBHttpDriver } from 'typedb-driver-http'","cause":"Importing default export instead of named export.","error":"TypeError: driver.openTransaction is not a function"},{"fix":"Wrap with isApiErrorResponse(resp) and only access .ok after successful check.","cause":"Forgetting to check for error with isApiErrorResponse() before accessing .ok.","error":"Property 'answerType' does not exist on type 'ApiResponse'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://typedb.com","github":"https://github.com/typedb/typedb-driver","docs":null,"changelog":null,"pypi":null,"npm":"typedb-driver-http","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}