{"id":31956298,"url":"https://github.com/confluentinc/confluent-kafka-javascript","last_synced_at":"2025-12-30T13:28:48.241Z","repository":{"id":222823240,"uuid":"715507877","full_name":"confluentinc/confluent-kafka-javascript","owner":"confluentinc","description":" Confluent's Apache Kafka JavaScript client ","archived":false,"fork":false,"pushed_at":"2025-10-10T19:18:31.000Z","size":6777,"stargazers_count":227,"open_issues_count":81,"forks_count":22,"subscribers_count":125,"default_branch":"master","last_synced_at":"2025-10-11T15:58:33.695Z","etag":null,"topics":["confluent","consumer","javascript","kafka","kafka-client","librdkafka","producer"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@confluentinc/kafka-javascript","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/confluentinc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.kafkajs","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-07T09:34:36.000Z","updated_at":"2025-10-10T14:31:46.000Z","dependencies_parsed_at":"2024-03-06T06:44:31.659Z","dependency_job_id":"11e5edc0-338f-42a1-9119-2d15d7f3cfed","html_url":"https://github.com/confluentinc/confluent-kafka-javascript","commit_stats":null,"previous_names":["confluentinc/confluent-kafka-javascript"],"tags_count":66,"template":false,"template_full_name":null,"purl":"pkg:github/confluentinc/confluent-kafka-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confluentinc%2Fconfluent-kafka-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confluentinc%2Fconfluent-kafka-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confluentinc%2Fconfluent-kafka-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confluentinc%2Fconfluent-kafka-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/confluentinc","download_url":"https://codeload.github.com/confluentinc/confluent-kafka-javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confluentinc%2Fconfluent-kafka-javascript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010641,"owners_count":26084783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["confluent","consumer","javascript","kafka","kafka-client","librdkafka","producer"],"created_at":"2025-10-14T14:48:22.534Z","updated_at":"2025-12-30T13:28:48.235Z","avatar_url":"https://github.com/confluentinc.png","language":"JavaScript","readme":"Confluent's JavaScript Client for Apache Kafka\u003csup\u003eTM\u003c/sup\u003e\n=====================================================\n\n**confluent-kafka-javascript** is Confluent's JavaScript client for [Apache Kafka](http://kafka.apache.org/) and the\n[Confluent Platform](https://www.confluent.io/product/compare/). The goal is to provide an highly performant, reliable and easy to use JavaScript client that is based on [node-rdkafka](https://github.com/Blizzard/node-rdkafka) yet also API compatible with [KafkaJS](https://github.com/tulios/kafkajs) to provide flexibility to users and streamline migrations from other clients.\n\nFeatures:\n\n- **High performance** - confluent-kafka-javascript is a lightweight wrapper around\n[librdkafka](https://github.com/confluentinc/librdkafka), a finely tuned C\nclient.\n\n- **Reliability** - There are a lot of details to get right when writing an Apache Kafka\nclient. We get them right in one place (librdkafka) and leverage this work\nacross all of our clients.\n\n- **Supported** - Commercial support is offered by [Confluent](https://confluent.io/).\n\n- **Future proof** - Confluent, founded by the\ncreators of Kafka, is building a [streaming platform](https://www.confluent.io/product/)\nwith Apache Kafka at its core. It's high priority for us that client features keep\npace with core Apache Kafka and components of the [Confluent Platform](https://www.confluent.io/product/).\n\nThis library leverages the work and concepts from two popular Apache Kafka JavaScript clients: [node-rdkafka](https://github.com/Blizzard/node-rdkafka) and [KafkaJS](https://github.com/tulios/kafkajs). The core is heavily based on the node-rdkafka library, which uses our own [librdkafka](https://github.com/confluentinc/librdkafka) library for core client functionality. However, we leverage a promisified API and a more idiomatic interface, similar to the one in KafkaJS, making it easy for developers to migrate and adopt this client depending on the patterns and interface they prefer. We're very happy to have been able to leverage the excellent work of the many authors of these libraries!\n\nTo use **Schema Registry**, use the [@confluentinc/schemaregistry](https://www.npmjs.com/package/@confluentinc/schemaregistry) library that is compatible with this library. For a simple schema registry example, see [sr.js](https://github.com/confluentinc/confluent-kafka-javascript/blob/master/examples/kafkajs/sr.js).\n\n## Requirements\n\nThe following configurations are supported:\n\n* Linux (x64 and arm64) - we support both musl and glibc based distributions:\n\n| Distribution                              | Supported Node Versions |\n| ----------------------------------------- | ----------------------- |\n| Debian Bullseye/Ubuntu 20.04              | 18, 20, 21, 22, 23, 24  |\n| Debian Bookworm/Ubuntu 22.04              | 18, 20, 21, 22, 23, 24  |\n| Alpine Linux 3.20+                        | 18, 20, 21, 22, 23, 24  |\n| AlmaLinux 9/Rocky Linux 9/CentOS Stream 9 | 18, 20, 21, 22, 23, 24  |\n\nOther distributions will probably work given a modern version of gcc/glibc, but we don't test the pre-built binaries with them.\n\n* macOS - arm64/m1. macOS (Intel) is supported on a best-effort basis. Node versions 18, 20, 21, 22, 23 and 24 are supported.\n* Windows - x64. Node versions 18, 20, 21, 22, 23 and 24 are supported.\n\n\u003e [!WARNING]\n\u003e Pre-built binary support will be dropped after the EOL of the node version or the OS.\n\nInstallation on any of these platforms is meant to be seamless, without any C/C++ compilation required.\n\n```bash\nnpm install @confluentinc/kafka-javascript\n```\n\nIn case your system configuration is not within the supported ones, check the detailed [installation instructions](./INTRODUCTION.md#Installation-Instructions) for more information.\n\nYarn and pnpm support is experimental.\n\n# Getting Started\n\nBelow is a simple produce example using the promisified API.\n\n```javascript\nconst { Kafka } = require('@confluentinc/kafka-javascript').KafkaJS;\n\nasync function producerStart() {\n    const producer = new Kafka().producer({\n        'bootstrap.servers': '\u003cfill\u003e',\n        'security.protocol': 'SASL_SSL',\n        'sasl.mechanisms': 'PLAIN',\n        'sasl.username': '\u003cfill\u003e',\n        'sasl.password': '\u003cfill\u003e',\n    });\n\n    await producer.connect();\n    console.log(\"Connected successfully\");\n\n    const res = []\n    for (let i = 0; i \u003c 50; i++) {\n        res.push(producer.send({\n            topic: 'test-topic',\n            messages: [\n                { value: 'v', partition: 0, key: 'x' },\n            ]\n        }));\n    }\n    await Promise.all(res);\n\n    await producer.disconnect();\n    console.log(\"Disconnected successfully\");\n}\n\nproducerStart();\n```\n\nThere are two variants of the API offered by this library. A promisified API and a callback-based API.\n\n1. If you're starting afresh, you should use the [promisified API](INTRODUCTION.md#promisified-api).\n2. If you're migrating from `kafkajs`, you can use the [migration guide](MIGRATION.md#kafkajs) to get started quickly.\n3. If you're migrating from `node-rdkafka`, you can use the [migration guide](MIGRATION.md#node-rdkafka).\n\nAn in-depth reference may be found at [INTRODUCTION.md](INTRODUCTION.md).\n\n## Contributing\n\nBug reports and feedback is appreciated in the form of Github Issues.\nFor guidelines on contributing please see [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Librdkafka Version\n\n| confluent-kafka-javascript | librdkafka |\n| -------------------------- | ---------- |\n| 1.0.0                      | 2.6.1      |\n| 1.2.0                      | 2.8.0      |\n| 1.3.0                      | 2.10.0     |\n| 1.3.1                      | 2.10.0     |\n| 1.3.2                      | 2.10.1     |\n| 1.4.0                      | 2.11.0     |\n| 1.4.1                      | 2.11.1     |\n| 1.5.0                      | 2.11.1     |\n| 1.6.0                      | 2.12.0     |\n| 1.7.0                      | 2.12.1     |\n| 1.8.0                      | 2.13.0     |\n\nThis mapping is applicable if you're using a pre-built binary. Otherwise, you can check the librdkafka version with the following command:\n\n```bash\nnode -e 'console.log(require(\"@confluentinc/kafka-javascript\").librdkafkaVersion)'\n```\n","funding_links":[],"categories":["Clients"],"sub_categories":["Node.js / TypeScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfluentinc%2Fconfluent-kafka-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfluentinc%2Fconfluent-kafka-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfluentinc%2Fconfluent-kafka-javascript/lists"}