# @ydbjs/api

> TypeScript gRPC service definitions and protobuf types for all YDB APIs. Enables strongly-typed client generation and low-level protocol access.

Latest version **6.0.7** (published 2026-06-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ydbjs/api
pnpm add @ydbjs/api
yarn add @ydbjs/api
bun add @ydbjs/api
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.7 |
| Published | 2026-06-01 |
| First published | 2025-04-06 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 3 |
| Unpacked size | 1.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 82 |
| Author | YDB Team |
| Maintainers | ydb-platform |
| Keywords | api, database, grpc, protobuf, typescript, ydb |

## Links

- npm: https://www.npmjs.com/package/@ydbjs/api
- Repository: https://github.com/ydb-platform/ydb-js-sdk
- Homepage: https://github.com/ydb-platform/ydb-js-sdk#readme
- Issues: https://github.com/ydb-platform/ydb-js-sdk/issues
- npm.io page: https://npm.io/package/@ydbjs/api

## Dependencies (3)

- [nice-grpc](https://npm.io/package/nice-grpc.md) ^2.1.13
- [@grpc/grpc-js](https://npm.io/package/@grpc/grpc-js.md) ^1.14.0
- [@bufbuild/protobuf](https://npm.io/package/@bufbuild/protobuf.md) 2.12.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 6.0.7 (latest) — 2026-06-01
- 6.0.1-alpha.31 (alpha) — 2025-07-09
- 6.0.6 — 2026-03-02
- 6.0.5 — 2025-11-04
- 6.0.4 — 2025-10-11
- 6.0.3 — 2025-10-11
- 6.0.2 — 2025-10-11
- 6.0.1 — 2025-10-11
- 6.0.0 — 2025-09-23
- 7.0.0-alpha.33 — 2025-09-08
- 6.0.1-alpha.32 — 2025-07-11
- 6.0.1-alpha.30 — 2025-07-02
- 6.0.0-alpha.29 — 2025-06-29
- 6.0.0-alpha.28 — 2025-06-28
- 6.0.0-alpha.27 — 2025-06-28
- … 7 more at https://npm.io/package/@ydbjs/api/versions

## README

# @ydbjs/api

The `@ydbjs/api` package provides TypeScript/JavaScript bindings for interacting with YDB services. It includes generated gRPC service definitions and protocol buffer types for various YDB APIs.

## Features

- gRPC service definitions for YDB APIs
- Protocol buffer types for YDB entities
- TypeScript support with type definitions

## Installation

Install the package using npm:

```sh
npm install @ydbjs/api
```

## Usage

### Importing Services

```ts
import { DiscoveryServiceDefinition } from '@ydbjs/api/discovery'
import { CmsServiceDefinition } from '@ydbjs/api/cms'
import { QueryServiceDefinition } from '@ydbjs/api/query'
```

### Example: Using a Service

```ts
import { createClientFactory, createChannel } from 'nice-grpc'
import { DiscoveryServiceDefinition } from '@ydbjs/api/discovery'

const clientFactory = createClientFactory()
const discoveryClient = clientFactory.create(
  DiscoveryServiceDefinition,
  createChannel('http://localhost:2136')
)

async function listEndpoints() {
  const response = await discoveryClient.listEndpoints({ database: '/local' })
  console.log(response)
}

listEndpoints().catch(console.error)
```

### Using with @ydbjs/core

```ts
import { DiscoveryServiceDefinition } from '@ydbjs/api/discovery'
import { Driver } from '@ydbjs/core'

const driver = new Driver('grpc://localhost:2136')
const client = driver.createClient(DiscoveryServiceDefinition)
client.listEndpoints({ database: '/local' })
```

## Development

### Generating gRPC and Protocol Buffer Files

```sh
npm run generate
```

## License

This project is licensed under the [Apache 2.0 License](../../LICENSE).

## Links

- [YDB Documentation](https://ydb.tech)
- [GitHub Repository](https://github.com/ydb-platform/ydb-js-sdk)
- [Issues](https://github.com/ydb-platform/ydb-js-sdk/issues)

---
_Source: https://npm.io/package/@ydbjs/api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
