centrifuge 0.1.0

  • README.md
  • Installing
  • Versions
  • 70

Build Status



  • example\flutter_app simple chat application
  • example\console simple console application


Create client:

import 'package:centrifuge/centrifuge.dart' as centrifuge;

final client = centrifuge.createClient(url);

Connect to server:

await client.connect();

Subscribe to channel:

final subscription = client.subscribe(channel);



Subscribe to private channel:

final privateSubscription = client.subscribe(channel, token: 'token');


final output = jsonEncode({'input': message});
final data = utf8.encode(output);
await subscription.publish(data);


  • [ ] connect to server using JSON protocol format
  • [x] connect to server using Protobuf protocol format
  • [x] connect with JWT
  • [ ] connect with custom header
  • [ ] support automatic reconnect in case of errors, network problems etc
  • [ ] connect and disconnect events
  • [ ] handle disconnect reason
  • [x] subscribe on channel and handle asynchronous Publications
  • [x] handle Join and Leave messages
  • [x] handle unsubscribe notifications
  • [ ] handle subscribe error
  • [ ] support publish, presence, presence stats and history methods
  • [ ] send asynchronous messages to server
  • [x] handle asynchronous messages from server
  • [ ] send RPC commands
  • [x] subscribe to private channels with JWT
  • [ ] support connection JWT refresh
  • [ ] support private channel subscription JWT refresh
  • [ ] ping/pong to find broken connection
  • [ ] support message recovery mechanism


German Saprykin, saprykin.h@gmail.com


  • Added authorization with JWT
  • Added subscription to private channel with JWT


  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  centrifuge: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:centrifuge/centrifuge.dart';
Version Uploaded Documentation Archive
0.1.0 Sep 15, 2018 Go to the documentation of centrifuge 0.1.0 Download centrifuge 0.1.0 archive
0.0.1 Aug 24, 2018 Go to the documentation of centrifuge 0.0.1 Download centrifuge 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10


Detected platforms: Flutter, other

Primary library: package:centrifuge/centrifuge.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

62 out of 62 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Fix lib/src/proto/client.pb.dart. (-1 points)

Analysis of lib/src/proto/client.pb.dart reported 2 hints:

line 1200 col 7: Name types using UpperCamelCase.

line 1250 col 7: Name types using UpperCamelCase.

Maintenance suggestions

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use centrifuge.dart. Packages with multiple examples should use example/readme.md.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
meta ^1.1.5 1.1.7
protobuf ^0.9.1 0.9.1 0.11.0
Transitive dependencies
fixnum 0.10.9
Dev dependencies
mockito ^3.0.0
test ^1.3.0