# @hasura/ndc-sdk-typescript

> This SDK is mostly analogous to the Rust SDK, except where necessary.

Latest version **8.5.2** (published 2026-10-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @hasura/ndc-sdk-typescript
pnpm add @hasura/ndc-sdk-typescript
yarn add @hasura/ndc-sdk-typescript
bun add @hasura/ndc-sdk-typescript
```

## Health

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

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.5.2 |
| Published | 2026-10-26 |
| First published | 2023-10-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 19 |
| Unpacked size | 441.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hasura |
| Maintainers | hasura |
| Keywords | hasura, ndc |

## Links

- npm: https://www.npmjs.com/package/@hasura/ndc-sdk-typescript
- npm.io page: https://npm.io/package/@hasura/ndc-sdk-typescript

## Dependencies (19)

- [semver](https://npm.io/package/semver.md) ^7.6.3
- [fastify](https://npm.io/package/fastify.md) ^5.7.2
- [commander](https://npm.io/package/commander.md) ^11.0.0
- [pino-pretty](https://npm.io/package/pino-pretty.md) ^10.2.3
- [prom-client](https://npm.io/package/prom-client.md) ^15.1.2
- [@grpc/grpc-js](https://npm.io/package/@grpc/grpc-js.md) ^1.14.6
- [@fastify/compress](https://npm.io/package/@fastify/compress.md) ^8.0.1
- [@opentelemetry/api](https://npm.io/package/@opentelemetry/api.md) ^1.9.0
- [@opentelemetry/sdk-node](https://npm.io/package/@opentelemetry/sdk-node.md) ^0.220.0
- [@opentelemetry/resources](https://npm.io/package/@opentelemetry/resources.md) ^2.9.0
- [@opentelemetry/sdk-metrics](https://npm.io/package/@opentelemetry/sdk-metrics.md) ^2.9.0
- [@json-schema-tools/meta-schema](https://npm.io/package/@json-schema-tools/meta-schema.md) ^1.7.0
- [@opentelemetry/instrumentation-http](https://npm.io/package/@opentelemetry/instrumentation-http.md) ^0.220.0
- [@opentelemetry/instrumentation-pino](https://npm.io/package/@opentelemetry/instrumentation-pino.md) ^0.66.0
- [@opentelemetry/semantic-conventions](https://npm.io/package/@opentelemetry/semantic-conventions.md) ^1.39.0
- [@opentelemetry/instrumentation-fetch](https://npm.io/package/@opentelemetry/instrumentation-fetch.md) ^0.220.0
- [@opentelemetry/instrumentation-fastify](https://npm.io/package/@opentelemetry/instrumentation-fastify.md) ^0.55.0
- [@opentelemetry/exporter-metrics-otlp-grpc](https://npm.io/package/@opentelemetry/exporter-metrics-otlp-grpc.md) ^0.220.0
- [@opentelemetry/exporter-metrics-otlp-proto](https://npm.io/package/@opentelemetry/exporter-metrics-otlp-proto.md) ^0.220.0

## Recent versions

- 8.5.2 (latest) — 2026-10-26
- 8.5.1 — 2026-10-26
- 8.5.0 — 2026-03-06
- 8.4.0 — 2026-02-06
- 8.3.0 — 2026-01-23
- 8.2.0 — 2025-07-18
- 7.1.0 — 2025-05-12
- 8.1.0 — 2025-05-12
- 8.0.0 — 2025-03-13
- 8.0.0-rc.1 — 2025-01-30
- 8.0.0-rc.0 — 2025-01-08
- 7.0.0 — 2024-09-20
- 6.1.0 — 2024-08-26
- 6.0.0 — 2024-08-08
- 5.2.0 — 2024-07-30
- … 28 more at https://npm.io/package/@hasura/ndc-sdk-typescript/versions

## README

# Native Data Connector SDK for TypeScript

This SDK is mostly analogous to the Rust SDK, except where necessary.

All functions of the Connector interface are analogous to their Rust counterparts.

## Installing

### From NPM

```sh
npm install @hasura/ndc-sdk-typescript
```

### From this repo:

The repo does not include build artifacts, so you'll need to run the build step:

```sh
npm install https://github.com/hasura/ndc-sdk-typescript

cd node_modules/ndc-sdk-typescript

npm install

npm run build
```

## Using this SDK

The SDK exports a `start` function, which takes a `connector` object, that is an object that implements the `Connector` interface defined in `connector.ts`

This function should be your starting point.

A connector can thus start liks so:

```ts
const connector: Connector = {
  /* implementation of the Connector interface removed for brevity */
};

start(connector);
```

Please refer to the [NDC Spec](https://hasura.github.io/ndc-spec/) for details on implementing the Connector interface.

## Publishing a new version of the SDK to NPM

Pushing a new version tag will automatically publish the tag to NPM provided that it matches the version specified in `package.json`.

See `.github/workflows/build_test_publish.yaml` for details.

## Regenerating Schema Types
The NDC spec types are generated from the NDC Spec Rust types. First, a JSON schema is derived from the Rust types into `./src/schema/schema.generated.json` (see `./typegen/src/main.rs`).

Then the TypeScript types are generated from that JSON Schema document into `./src/schema/schema.generated.ts`.

In order to regenerate the types, run
```
> npm run regenerate-schema
```

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