Skip to content
pubscout

pubnub

9.2.0, released 12 days ago by pubnub.com

PubNub SDK for Dart and Flutter to build real-time messaging applications

WASM-ready
$ flutter pub add pubnub
Source repository

What it does

Connects your Dart or Flutter application to the PubNub Data Streaming Network. It allows you to publish messages, subscribe to channels using streams, and fetch channel history.

AI-written summary of version 9.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need real-time messaging or chat features in your app
  • You want to stream data updates across multiple clients instantly

Skip it when

  • You are using a completely different backend or messaging service like Firebase

Strengths

  • Native Flutter and Dart support
  • Stream-based subscription model
  • Supports multiple keysets and channel history retrieval

Weaknesses

  • License is unknown

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
12

Add the dependency to pubspec.yaml, configure your keyset with PubNub keys, and run build_runner if generating necessary source files.

final myKeyset = Keyset(
  subscribeKey: 'demo',
  publishKey: 'demo',
  uuid: UUID('demo'));

final pubnub = PubNub(defaultKeyset: myKeyset);
pubnub.publish('my_channel', { 'content': 'Hello world!' });

Alternatives

Packages that do the same job and could replace pubnub.

Works with

Packages commonly used together with pubnub: ones it builds on, ones built on it, and its own family.