Pure Protocol Implementation
No wrappers around librdkafka. Direct Kafka wire protocol implementation in TypeScript for maximum control and transparency.
High-performance Kafka client and streams library with zero native dependencies
Core Kafka client with producer, consumer, SASL authentication, and low-level protocol access.
Kafka Streams-like DSL with KStream, KTable, windowing, aggregations, and joins.
Zod schema validation for type-safe message encoding and decoding.
LMDB-backed persistent state stores for production stream processing.
import { KafkaClient } from '@kafkats/client'
const client = new KafkaClient({
clientId: 'my-app',
brokers: ['localhost:9092'],
})
// Producer
const producer = client.producer()
await producer.send('events', [{ value: JSON.stringify({ type: 'click', page: '/home' }) }])
// Consumer
const consumer = client.consumer({ groupId: 'my-group' })
await consumer.runEach('events', async message => {
console.log('Received:', message.value.toString())
})