# @kafkajs/confluent-schema-registry

> ConfluentSchemaRegistry is a library that makes it easier to interact with the Confluent schema registry, it provides convenient methods to encode, decode and register new schemas using the Apache Avro serialization format.

Latest version **4.1.0** (published 2026-05-29) · 0 weekly downloads

## Install

```sh
npm install @kafkajs/confluent-schema-registry
pnpm add @kafkajs/confluent-schema-registry
yarn add @kafkajs/confluent-schema-registry
bun add @kafkajs/confluent-schema-registry
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2026-05-29 |
| First published | 2019-09-12 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 4 |
| Unpacked size | 95.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 170 |
| Maintainers | tulios, engervall, nevon |
| Keywords | confluent schema registry, kafka |

## Links

- npm: https://www.npmjs.com/package/@kafkajs/confluent-schema-registry
- Repository: https://github.com/kafkajs/confluent-schema-registry
- Homepage: https://github.com/kafkajs/confluent-schema-registry#readme
- Issues: https://github.com/kafkajs/confluent-schema-registry/issues
- npm.io page: https://npm.io/package/@kafkajs/confluent-schema-registry

## Dependencies (4)

- [ajv](https://npm.io/package/ajv.md) ^8.18.0
- [avsc](https://npm.io/package/avsc.md) >= 5.4.13 < 6
- [protobufjs](https://npm.io/package/protobufjs.md) ^7.4.0
- [mappersmith](https://npm.io/package/mappersmith.md) >= 2.44.0 < 3

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 4.1.0 (latest) — 2026-05-29
- 4.0.8 — 2026-03-30
- 3.9.0 — 2025-05-27
- 3.8.0 — 2025-03-19
- 3.7.0 — 2025-03-19
- 3.6.1 — 2025-01-21
- 3.6.0 — 2025-01-12
- 3.5.1 — 2025-01-11
- 3.5.0 — 2025-01-11
- 3.4.1 — 2024-12-21
- 3.4.0 — 2024-12-21
- 3.3.0 — 2022-10-04
- 3.2.1 — 2022-01-28
- 3.2.0 — 2021-11-22
- 3.1.1 — 2021-11-04
- … 14 more at https://npm.io/package/@kafkajs/confluent-schema-registry/versions

## README

# confluent-schema-registry

`@kafkajs/confluent-schema-registry` is a library that makes it easier to interact with the Confluent schema registry, it provides convenient methods to encode, decode and register new schemas using the Apache Avro serialization format and Confluent's [wire format](https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html#wire-format)

[![Build Status](https://dev.azure.com/tulios/ConfluentSchemaRegistry/_apis/build/status/kafkajs.confluent-schema-registry?branchName=master)](https://dev.azure.com/tulios/ConfluentSchemaRegistry/_build/latest?definitionId=3&branchName=master)

## Getting started

```sh
npm install @kafkajs/confluent-schema-registry
# yarn add @kafkajs/confluent-schema-registry
```

```javascript
const { Kafka } = require('kafkajs')
const { SchemaRegistry } = require('@kafkajs/confluent-schema-registry')

const kafka = new Kafka({ clientId: 'my-app', brokers: ['kafka1:9092'] })
const registry = new SchemaRegistry({ host: 'http://registry:8081/' })
const consumer = kafka.consumer({ groupId: 'test-group' })

const run = async () => {
  await consumer.connect()
  await consumer.subscribe({ topic: 'test-topic', fromBeginning: true })

  await consumer.run({
    eachMessage: async ({ topic, partition, message }) => {
      const decodedKey = await registry.decode(message.key)
      const decodedValue = await registry.decode(message.value)
      console.log({ decodedKey, decodedValue })
    },
  })
}

run().catch(console.error)
```

## Documentation

Learn more about using [KafkaJS Confluent Schema registry on the official site!](https://kafkajs.github.io/confluent-schema-registry/)

## License

See [LICENSE](https://github.com/kafkajs/confluent-schema-registry/blob/master/LICENSE) for more details.

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