v6.0.0-alpha.1
Pre-release
Pre-release
YDB JavaScript SDK [first αlpha]
We are excited to introduce the first alpha of our revamped SDK for interacting with YDB databases in JavaScript and TypeScript!
🚀 What's new
Monorepo & Modular Packages
- Monorepo setup: The SDK is now structured as a monorepo, with independent, logically separated packages:
@ydbjs/api
– Generated protobuf messages (using Buf)
@ydbjs/core
– Driver creation, client-side balancing (can be disabled for single-endpoint/serverless), gRPC client setup
@ydbjs/auth
– Token providers for authentication: token, login+password, metadata service, anonymous
@ydbjs/error
– Unified YDBError wrapper based on operation status
@ydbjs/retry
– Flexible, pluggable operation retries; sensible defaults according to YDB client policies
@ydbjs/value
– Convenient YDB type wrappers and helpers for casting/inferring types between native and server representations
@ydbjs/query
– Query service client for YQL queries with template string support, strong typing, flexible result modes (object, string array, raw), and typed parameterization. - NPM Release under @ydbjs: All packages are published to npm under the @ydbjs organization. After v6, the main ydb-sdk will become a proxy package aggregating these.
Drivers, Endpoints & Balancer
- Dynamic endpoint set: The driver actualizes the available endpoints every minute for resilience.
- Client-side balancer: Toggle balancer off to connect to a single endpoint—ideal for serverless functions!
Authentication
- Multiple auth modes: Token, login/password, metadata service, or anonymous – all through pluggable providers.
Error Handling
- Consistent error wrapper: Always receive errors in the unified YDBError format.
Query Service
- Type-safe YQL: Write YQL queries with full type support and safe template strings, plus parameterization.
- Flexible outputs: Choose between structured objects, plain string arrays, or raw results.
- Automatic retries: All query operations use the SDK’s robust, configurable retry policies.
Toolbox & Development
- Developer-friendly setup: DevContainers support – a database instance is automatically launched for you alongside the IDE!
- Testing: Core test suite in place, with initial integration and end-to-end tests.