dart_nats
A Dart client for the NATS messaging system. Design to use with Dart and flutter.
1.4.1
3.9K downloads/mo
#4224 most downloaded on pub.dev
dart-nats/dart-nats
What this package is like to depend on
Last release today
24 Aug 2026
Ships unpredictably
gaps range from 8 days to 1.6 years
Most releases are documented
notes for 51 of 58 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
58 releases · first in 2019
13 releases in the last 12 months
see the full history below
Release timeline
58 releases · Dec 2019 to Aug 2026Releases
latest 58-
1.4.124 Aug 2026Release notes
Open source →- Fix heartbeat pings raising an unhandled zone error on every disconnect. The PONG-tracking callback added in 1.3.0 used an expression body, so type inference picked
then<int>and the null-returningonErrorhandler could not satisfyFutureOr<int>-- visible on the Dart VM and dart2wasm (dart2js elides the cast).
Release notes
Open source →- Fix heartbeat pings raising an unhandled zone error on every disconnect. The PONG-tracking callback added in 1.3.0 used an expression body, so type inference picked
then<int>and the null-returningonErrorhandler could not satisfyFutureOr<int>-- visible on the Dart VM and dart2wasm (dart2js elides the cast).
- Fix heartbeat pings raising an unhandled zone error on every disconnect. The PONG-tracking callback added in 1.3.0 used an expression body, so type inference picked
-
1.4.023 Jul 2026Release notes
Open source →- Add filtered/keep/seq-bounded stream purge:
JsStream.purge()/JetStream.purgeStream()now accept optionalfilter,keep, andseqparameters ($JS.API.STREAM.PURGE's own options), instead of only supporting an all-or-nothing purge. - Add
ObjectStore.putStream()/getStream()for uploading/downloading objects as aStream<List<int>>/Stream<Uint8List>without buffering the whole payload in memory, computing the SHA-256 digest incrementally as chunks arrive. - Fix
ObjectStore.put()/putStream()leaving a previous object's chunks orphaned in the backing stream when overwriting an existing name -- the old version's chunks are now purged once the new version is safely written. - Bump
actions/checkout/actions/cachein CI to versions that don't trigger GitHub's Node 20 deprecation warning.
Release notes
Open source →- Add filtered/keep/seq-bounded stream purge:
JsStream.purge()/JetStream.purgeStream()now accept optionalfilter,keep, andseqparameters ($JS.API.STREAM.PURGE's own options), instead of only supporting an all-or-nothing purge. - Add
ObjectStore.putStream()/getStream()for uploading/downloading objects as aStream<List<int>>/Stream<Uint8List>without buffering the whole payload in memory, computing the SHA-256 digest incrementally as chunks arrive. - Fix
ObjectStore.put()/putStream()leaving a previous object's chunks orphaned in the backing stream when overwriting an existing name -- the old version's chunks are now purged once the new version is safely written. - Bump
actions/checkout/actions/cachein CI to versions that don't trigger GitHub's Node 20 deprecation warning.
- Add filtered/keep/seq-bounded stream purge:
-
1.3.023 Jul 2026Release notes
Open source →- Add consumer pause/resume support (NATS 2.11+):
JetStream.pauseConsumer(stream, consumer, pauseUntil)andJetStream.resumeConsumer(stream, consumer), calling$JS.API.CONSUMER.PAUSE.ConsumerInfoalso gainspaused/pauseUntilfields reflecting the consumer's current pause state. - Add GitHub Actions CI (test suite against local NATS containers, analyze/format checks, cross-platform analyze jobs, publish dry-run) and automated
pub.devpublishing on tagged releases. - Fix heartbeat pings (
pingInterval/maxPingsOut) never confirming a PONG reply actually arrived before counting toward the missed-ping limit, so a connection that was responding perfectly fine still got force-disconnected aftermaxPingsOutheartbeat ticks. The periodic heartbeat now tracks its PONG the same wayClient.ping()does and resets the missed-ping counter on receipt.
Release notes
Open source →- Add consumer pause/resume support (NATS 2.11+):
JetStream.pauseConsumer(stream, consumer, pauseUntil)andJetStream.resumeConsumer(stream, consumer), calling$JS.API.CONSUMER.PAUSE.ConsumerInfoalso gainspaused/pauseUntilfields reflecting the consumer's current pause state. - Add GitHub Actions CI (test suite against local NATS containers, analyze/format checks, cross-platform analyze jobs, publish dry-run) and automated
pub.devpublishing on tagged releases. - Fix heartbeat pings (
pingInterval/maxPingsOut) never confirming a PONG reply actually arrived before counting toward the missed-ping limit, so a connection that was responding perfectly fine still got force-disconnected aftermaxPingsOutheartbeat ticks. The periodic heartbeat now tracks its PONG the same wayClient.ping()does and resets the missed-ping counter on receipt.
- Add consumer pause/resume support (NATS 2.11+):
-
1.2.420 Jul 2026Release notes
Open source →- Update package homepage and repository URLs to point to the new
dart-natsGitHub organization.
- Update package homepage and repository URLs to point to the new
-
1.2.319 Jul 2026Release notes
Open source →- Fix background reconnection loop getting stuck or stopping prematurely after network loss by evaluating connection and closed states more robustly.
- Fix socket cleanups hanging on zombie connections during abrupt network loss by introducing a soft cleanup with a 2-second timeout window.
- Correct connection callback trigger logic, ensuring
onReconnectcorrectly fires during a reconnection cycle instead ofonConnect. - Many thanks to contributor @JuanCordovaLazo for these crucial reconnect fixes.
-
1.2.217 Jul 2026Release notes
Open source →- Fix
JetStream.listStreams()/listConsumers()silently truncating at the server's page size (256 items) instead of paginating viaoffset/total— accounts with more streams/consumers than that lost visibility into everything past the first page, with no error or truncation flag. - Fix
Consumer.messages()'s pull loop andOrderedConsumerswallowing every delivery failure into a silent retry loop instead of surfacing it through the stream'saddError. For pull consumers specifically, a deleted server-side consumer never actually threw fromfetch()— it silently timed out with an empty batch, indistinguishable from a merely idle consumer — so the loop now also confirms the consumer still exists whenever a batch comes back empty. - Fix
KeyValue.watch()/history()/keys()leaking their ephemeral push consumer on every call — theConsumerreturned bycreateConsumer()was discarded and never deleted once the caller cancelled or the call finished.ConsumerConfigalso gains aninactiveThresholdfield (serialized asinactive_threshold, same convention asidleHeartbeat) so ephemeral consumers can be given a server-side reap window as a safety net. - Add
Message.nakSync()/termSync()/inProgressSync(), awaitable twins of the existingackSync()fornak()/term()/inProgress(). The originals callpub()without awaiting its ownFuture<bool>, so a disconnected client still reports success even though the ack/nak/term never reached the server — prefer the*Syncvariants when that needs to be known.
- Fix
-
1.2.116 Jul 2026Release notes
Open source →- Update README.md with Microservices Framework (ADR-32) and Client Discovery documentation.
-
1.2.016 Jul 2026Release notes
Open source →- Add heartbeats, clustering, robust reconnection, buffer limits, pull flow control, and NATS Microservices Framework (ADR-32).
- Add client-side service discovery for the ADR-32 Microservices framework, complementing the
addService/MicroServicehosting side:Client.discoverServices(),getServicesInfo(), andgetServicesStats()fan a request out to$SRV.*(optionally scoped to service name and ID) and collect all replies within a bounded timeout window.- Adds
PingResponse,InfoResponse,EndpointInfo,StatsResponse, andEndpointStatsInfoto parse standard response payloads. - Thanks nverbeek for the contribution.
-
1.1.212 Jul 2026Release notes
Open source →1.1.2
- Fix
JetStream.accountInfo()returning all-zeroTierfor single-tier accounts by parsing usage fields from the top-level response instead of a nonexistent nestedtierkey. Also fixTier.fromJsoncrash on uint64 sentinel values by reading fields asnum. Thanks @nverbeek for the contribution.
Release notes
Open source →- Fix
JetStream.accountInfo()returning all-zeroTierfor single-tier accounts by parsing usage fields from the top-level response instead of a nonexistent nestedtierkey. Also fixTier.fromJsoncrash on uint64 sentinel values by reading fields asnum. Thanks nverbeek for the contribution.
- Fix
-
1.1.125 Jun 2026Release notes
Open source →- Fix defect #42: Ensure
newInboxalways appends a dot suffix (.) toinboxPrefixto conform to hierarchical NATS subject structures (_INBOX.>gateway callout authorization policy). - Retain backward compatibility: Do not append double dots (
..) if the prefix argument already ends with a dot.
- Fix defect #42: Ensure
-
1.1.024 Jun 2026Release notes
Open source →- Add JetStream, Key-Value, and Object Store API enhancements and handle-based classes:
- Introduce
JsStreamclass wrapping JetStream stream operations (info,purge,consumer,createConsumer). - Introduce generic
Consumer<T>class withfetch(for pull batching) andmessages()(stream for push deliver or continuous pull polling in the background). - Introduce
AccountInfoAPI mapping JetStream tier resource usage and account details. - Add support for
numReplicasandmaxAgeproperties inStreamConfig. - Support flexible payload publishing using
publishPayload<T>on theJetStreamclass.
- Introduce
- Key-Value Store API updates:
- Add
createandupdatemethods supporting optimistic concurrency control (viaPubOpts). - Add
getRevisionto retrieve historical values. - Support tracking and emitting key-value entry operations (
KeyValueOplikeput,delete, andpurge). - Filter out deleted and purged keys automatically in
KeyValue.get().
- Add
- Object Store API updates:
- Introduce
ObjectStoreConfigsupportingreplicas,maxBytes, andttl. - Add
addLinkandaddBucketLinkmethods to align with standard NATS conventions (aliasing/replacing oldputLinkandputBucketLink). - Update
list()to correctly track tombstones and filter deleted object metadata. - Add helper methods
putBytesandgetBytes.
- Introduce
- Performance and refactoring improvements:
- Optimize NATS protocol parser by replacing dynamic List growth/sublisting with direct byte processing on a manual buffer manager.
- Clean up and document API definitions, including configuration options, exception models, and platform stubs.
- Add JetStream, Key-Value, and Object Store API enhancements and handle-based classes:
-
1.0.009 Jun 2026Release notes
Open source →- Add NATS JetStream Support (Stream/Consumer management, Publish/Subscribe, Pull mode with Ack/Nak/Term)
- Add NATS Key-Value (KV) Store (Put, Get, Delete, Purge, Watch)
- Add NATS Object Store (128 KiB chunking, automatic SHA-256 validation)
-
0.7.009 Jun 2026Nothing published for this version
-
0.6.517 Nov 2024Release notes
Open source →- Issue resolved when app is in background. Thanks nileshsoni97 for contribution.
-
0.6.408 Nov 2024Release notes
Open source →- Fix Uint8List and List<int> inconsistency. Thank myxzlpltk for contribution.
-
0.6.309 Oct 2024Release notes
Open source →- fix Exposing Security Context#31.
- Fix missing headers in request response.
-
0.6.202 Jul 2023Release notes
Open source →- fix a bug that does not correctly parse headers containing the ':' character. Thank https://github.com/CoryHagerman for contribution.
-
0.6.116 Nov 2022 -
0.6.016 Nov 2022Release notes
Open source →- Support verbos acknowledge
- Chang pub, pubString to async
- Header support (hpub and hmsg)
-
0.5.009 Oct 2022Release notes
Open source →- Add nkeys publicKey privateKey functions
- Revamp rqeust
- Custom inbox prefix
- Inbound structure data
-
0.4.907 Oct 2022 -
0.4.806 Oct 2022 -
0.4.706 Oct 2022Release notes
Open source →- add generic type to client.request()
- fix reconnect issue
- fix retry issue
-
0.4.604 Oct 2022 -
0.4.503 Oct 2022 -
0.4.402 Oct 2022Release notes
Open source →- fix bug #20 larger MSG payloads not always working, check if full payload present in buffer
-
0.4.302 Oct 2022Nothing published for this version
-
0.4.202 Oct 2022 -
0.4.102 Oct 2022 -
0.4.002 Oct 2022Release notes
Open source →- client.connect() support with url schema example ws://host:port or nats://nost:port
- tls:// not support yet
- discontinue client.tcpConnect()
- add nkey authentication
- add jwt authentication
-
0.3.525 Aug 2021 -
0.3.424 Aug 2021 -
0.3.323 Aug 2021 -
0.3.201 Aug 2021 -
0.3.028 May 2021 -
0.2.007 Mar 2021Release notes
Open source →- Add user passwor authentication
- Add token authentication
- Convert to Null safety
- Dart SDK version 2.12.0 - 3.0.0
- fix inbox security
-
0.1.831 May 2020 -
0.1.726 Jan 2020 -
0.1.618 Jan 2020Release notes
Open source →- async connect
- fix defect message delay when sub receive continuous message
-
0.1.6+119 Jan 2020 -
0.1.505 Jan 2020 -
0.1.5+105 Jan 2020 -
0.1.401 Jan 2020Nothing published for this version
-
0.1.4+101 Jan 2020Release notes
Open source →- add inbox to generate unique inbox subject
- add nuid to generate unique id
-
0.1.330 Dec 2019Nothing published for this version
-
0.1.3+130 Dec 2019Release notes
Open source →- add string api client.pubString and message.string
- fix defect: pub sub non ascii
- fix defect: message include \r or \n
- revamp message decoding
-
0.1.3+201 Jan 2020Nothing published for this version
-
0.1.3+301 Jan 2020Nothing published for this version
-
0.1.3+401 Jan 2020 -
0.1.127 Dec 2019 -
0.1.022 Dec 2019Nothing published for this version
-
0.1.0+122 Dec 2019 -
0.1.0+222 Dec 2019 -
0.1.0+322 Dec 2019 -
0.1.0+422 Dec 2019 -
0.0.222 Dec 2019 -
0.0.2+122 Dec 2019 -
0.0.122 Dec 2019