{"id":49813,"library":"ydb-sdk","title":"YDB Node.js SDK","description":"Official Node.js bindings for YDB (Yandex Database) API over gRPC. Current stable version is 5.11.1, with a moderate release cadence. This SDK provides native TypeScript types and supports multiple authentication methods (access token, metadata, service account key, anonymous). It is the primary SDK for YDB on Node.js, differentiating itself with first-class gRPC support and integration with Yandex.Cloud IAM. Requires Node.js >= 12 and npm >= 6.","status":"active","version":"5.11.1","language":"javascript","source_language":"en","source_url":"https://github.com/ydb-platform/ydb-nodejs-sdk","tags":["javascript","ydb","sdk","grpc","typescript"],"install":[{"cmd":"npm install ydb-sdk","lang":"bash","label":"npm"},{"cmd":"yarn add ydb-sdk","lang":"bash","label":"yarn"},{"cmd":"pnpm add ydb-sdk","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Yandex.Cloud authentication and API usage","package":"@yandex-cloud/nodejs-sdk","optional":false}],"imports":[{"note":"ESM-only since v3; named exports are Driver, getCredentialsFromEnv, etc. CommonJS require() will fail unless using Node.js >= 12 with --experimental-modules.","wrong":"const ydb = require('ydb-sdk');","symbol":"ydb-sdk","correct":"import { Driver, getCredentialsFromEnv, Logger } from 'ydb-sdk';"},{"note":"Driver is a named export, not default export.","wrong":"import Driver from 'ydb-sdk';","symbol":"Driver","correct":"import { Driver } from 'ydb-sdk';"},{"note":"TypeScript types are exported separately; use 'TypedData' and 'typedData' for typed operations.","wrong":"import { Types } from 'ydb-sdk';","symbol":"Types","correct":"import { TypedData, typedData } from 'ydb-sdk';"}],"quickstart":{"code":"import { Driver, getCredentialsFromEnv, Logger, ydb } from 'ydb-sdk';\n\nconst logger = new Logger('my-app');\nconst driver = new Driver({\n  endpoint: 'grpcs://your.cloud.endpoint.hostname:2135',\n  database: '/your/database/path',\n  authService: getCredentialsFromEnv(),\n  logger,\n});\n\nasync function run() {\n  const result = await driver.tableClient.withSession(async (session) => {\n    const query = `SELECT 1 AS value`;\n    const { resultSets } = await session.executeQuery(query);\n    return resultSets[0].rows;\n  });\n  console.log(result);\n}\n\nrun().catch(console.error);","lang":"typescript","description":"Connects to YDB using environment credentials, executes a simple query, and logs the result."},"warnings":[{"fix":"Update constructor calls to provide authService and include port in endpoint.","message":"Driver constructor parameters have changed: 'authService' is now required, and 'endpoint' must include port.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use IamAuthService, TokenAuthService, etc., directly.","message":"getCredentialsFromEnv() is deprecated in favor of explicit credential providers.","severity":"deprecated","affected_versions":">=5.10.0"},{"fix":"Set 'grpc.Timeout' option in driver config or use context with timeout.","message":"gRPC connection may hang if timeout is not set; default is infinite.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'12':66 '5.11.1':18 '6':69 'access':35 'account':39 'anonym':41 'api':11 'authent':33 'bind':6 'cadenc':23 'class':56 'current':14 'databas':10 'differenti':51 'first':55 'first-class':54 'grpc':13,57,73 'iam':63 'integr':60 'javascript':70 'key':40 'metadata':37 'method':34 'moder':21 'multipl':32 'nativ':27 'node.js':2,5,50,65 'npm':68 'offici':4 'primari':45 'provid':26 'releas':22 'requir':64 'sdk':3,25,46,72 'servic':38 'stabl':15 'support':31,58 'token':36 'type':29 'typescript':28,74 'version':16 'yandex':9 'yandex.cloud':62 'ydb':1,8,48,71","created_at":"2026-06-07T17:03:44.089543+00:00","updated_at":"2026-06-07T17:03:44.089543+00:00","problems":[{"fix":"Run 'npm run build' in project root after installation.","cause":"Build artifacts missing; package not built after install.","error":"Error: ENOENT: no such file or directory, open '.../node_modules/ydb-sdk/build/src/...'"},{"fix":"Use 'new Driver(options)'.","cause":"Missing 'new' keyword when instantiating Driver.","error":"TypeError: Class constructor Driver cannot be invoked without 'new'"},{"fix":"Set authService using getCredentialsFromEnv() or explicit provider.","cause":"Driver created without authService or missing credentials.","error":"UnhandledPromiseRejectionWarning: Error: CANNOT_INITIALIZE_DRIVER: No auth provider specified"}],"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://github.com/ydb-platform/ydb-nodejs-sdk#readme","github":"https://github.com/ydb-platform/ydb-nodejs-sdk","docs":null,"changelog":null,"pypi":null,"npm":"ydb-sdk","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-07","next_check":"2026-09-05","install_tag":null}}