confluentinc / confluent-kafka-javascript

Confluent's Apache Kafka JavaScript client
https://www.npmjs.com/package/@confluentinc/kafka-javascript
MIT License
50 stars 5 forks source link

Request: TypeScript example of KafkaJS #33

Closed abrkn closed 4 months ago

abrkn commented 6 months ago

I'm not understanding how to construct an instance of KafkaJS.Kafka since KafkaJS is exported as a type and not a namespace. Are there any examples of this?

milindl commented 6 months ago

Hi @abrkn, typescript definitions of the KafkaJS types are broken right now ( #31 ). I do plan to fix it within the EA. I'll add an example for it, too.

abrkn commented 5 months ago

Thanks, let me know if you need help. Would love to migrate away from KafkaJS

milindl commented 5 months ago

I added the examples and fixed the types. I've not created a release yet with the fixes, but if you want to try it out before that you can install it from GitHub too (npm install "git+https://git@github.com/confluentinc/confluent-kafka-javascript.git")

abrkn commented 5 months ago

I added the examples and fixed the types. I've not created a release yet with the fixes, but if you want to try it out before that you can install it from GitHub too (npm install "git+https://git@github.com/confluentinc/confluent-kafka-javascript.git")

Appreciate the update. I'll wait for the release

milindl commented 5 months ago

I've made a release v0.1.12-devel, it's available on npm. You can use that to try.

milindl commented 4 months ago

Closing this as the typing are working and an example is added in the release.