Gathering detailed insights and metrics for kafkajs
Gathering detailed insights and metrics for kafkajs
Gathering detailed insights and metrics for kafkajs
Gathering detailed insights and metrics for kafkajs
@opentelemetry/instrumentation-kafkajs
OpenTelemetry instrumentation for `kafkajs` messaging client for Apache Kafka
@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.
opentelemetry-instrumentation-kafkajs
open telemetry instrumentation for the `kafkajs` kafka client
kafkajs-snappy
Snappy codec for KafkaJS
npm install kafkajs
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (98.33%)
Shell (0.87%)
TypeScript (0.55%)
Java (0.14%)
CSS (0.11%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3,887 Stars
3,097 Commits
561 Forks
36 Watchers
27 Branches
116 Contributors
Updated on Jul 11, 2025
Latest Version
2.2.4
Package Id
kafkajs@2.2.4
Unpacked Size
714.96 kB
Size
143.73 kB
File Count
391
NPM Version
6.14.18
Node Version
14.21.3
Published on
Feb 27, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
27
A modern Apache Kafka® client for Node.js
Get Started »
Read the Docs
·
Report Bug
·
Request Feature
KafkaJS is a modern Apache Kafka client for Node.js. It is compatible with Kafka 0.10+ and offers native support for 0.11 features.
KAFKA is a registered trademark of The Apache Software Foundation and has been licensed for use by KafkaJS. KafkaJS has no affiliation with and is not endorsed by The Apache Software Foundation.
![]() Upstash: Serverless Kafka
|
![]() Get help directly from a KafkaJS developer
|
To become a sponsor, reach out in our Slack community to get in touch with one of the maintainers. Also consider becoming a Github Sponsor by following any of the links under "Sponsor this project" in the sidebar.
1npm install kafkajs 2# yarn add kafkajs
1const { Kafka } = require('kafkajs') 2 3const kafka = new Kafka({ 4 clientId: 'my-app', 5 brokers: ['kafka1:9092', 'kafka2:9092'] 6}) 7 8const producer = kafka.producer() 9const consumer = kafka.consumer({ groupId: 'test-group' }) 10 11const run = async () => { 12 // Producing 13 await producer.connect() 14 await producer.send({ 15 topic: 'test-topic', 16 messages: [ 17 { value: 'Hello KafkaJS user!' }, 18 ], 19 }) 20 21 // Consuming 22 await consumer.connect() 23 await consumer.subscribe({ topic: 'test-topic', fromBeginning: true }) 24 25 await consumer.run({ 26 eachMessage: async ({ topic, partition, message }) => { 27 console.log({ 28 partition, 29 offset: message.offset, 30 value: message.value.toString(), 31 }) 32 }, 33 }) 34} 35 36run().catch(console.error)
Learn more about using KafkaJS on the official site!
Read something on the website that didn't work with the latest stable version?
Check the pre-release versions - the website is updated on every merge to master.
KafkaJS is an open-source project where development takes place in the open on GitHub. Although the project is maintained by a small group of dedicated volunteers, we are grateful to the community for bug fixes, feature development and other contributions.
See Developing KafkaJS for information on how to run and develop KafkaJS.
We welcome contributions to KafkaJS, but we also want to see a thriving third-party ecosystem. If you would like to create an open-source project that builds on top of KafkaJS, please get in touch and we'd be happy to provide feedback and support.
Here are some projects that we would like to build, but haven't yet been able to prioritize:
See LICENSE for more details.
Apache Kafka and Kafka are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries. KafkaJS has no affiliation with the Apache Software Foundation.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
Found 6/10 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
61 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More