Flutter and Dart packages for Hibira, the realtime WebSocket and push service that speaks the Pusher protocols.
| Package | What it does | Platforms |
|---|---|---|
hibira |
Channels: public, private, presence and encrypted channels, client events, user sign-in. Pure Dart. | Android, iOS, web, desktop, Dart VM |
hibira_push |
Push notifications through Hibira Push (Beams-compatible), wrapping the native SDKs. | Android, iOS |
hibira_inbox |
Notification inbox: a bell with an unread badge and a feed with read/unread and archive, kept live. | Android, iOS, web, desktop |
hibira_chat |
Chat API client: conversations, message history with paging, live messages, typing, read receipts and translations. Pure Dart. | Android, iOS, web, desktop, Dart VM |
import 'package:hibira/hibira.dart';
final hibira = HibiraClient('YOUR_APP_KEY');
await hibira.connect();
hibira.subscribe('orders').bind('shipped', (e) => print(e.data));import 'package:hibira_push/hibira_push.dart';
await HibiraPush.instance.start('YOUR_INSTANCE_ID');
await HibiraPush.instance.requestPermission();
await HibiraPush.instance.addDeviceInterest('hello');The example app shows both:
cd example
flutter run --dart-define=HIBIRA_APP_KEY=your-app-key \
--dart-define=HIBIRA_PUSH_INSTANCE_ID=your-instance-idAdd --dart-define=HIBIRA_AUTH_ENDPOINT=https://... for private and
presence channels.
The Chat tab is a chat room on one presence channel, with messages and
"typing…" sent as client events (turn client events on for the app). For a
backend and a web page in the same room, run the dependency-free
example/chat_server:
cd example/chat_server
HIBIRA_APP_KEY=your-app-key HIBIRA_APP_SECRET=your-secret node server.mjs
# open http://localhost:8000/?user=Leo, then in example/:
flutter run -d chrome --web-port 8001 --dart-define=HIBIRA_APP_KEY=your-app-key \
--dart-define=HIBIRA_AUTH_ENDPOINT='http://localhost:8000/hibira/auth?user=Mia'Add both http://localhost:8000 and http://localhost:8001 to the app's
allowed origins. Push on Android also needs your google-services.json in
example/android/app.
Building in FlutterFlow? The flutterflow folder has ready
custom actions and widgets (connect, subscribe, presence count, connection
status) for the Hibira Realtime library.
This is a pub workspace.
flutter pub get
(cd packages/hibira && dart test)
(cd packages/hibira_push && flutter test)
(cd packages/hibira_inbox && flutter test)
(cd packages/hibira_chat && dart test)The packages are published on pub.dev by the verified publisher
hibira.io. To release, bump version
in the package's pubspec.yaml, add a CHANGELOG.md entry, merge, and push a
tag; GitHub Actions publishes it:
git tag hibira-v0.1.1 && git push origin hibira-v0.1.1 # packages/hibira
git tag hibira_push-v0.1.1 && git push origin hibira_push-v0.1.1 # packages/hibira_push
git tag hibira_inbox-v0.1.0 && git push origin hibira_inbox-v0.1.0 # packages/hibira_inbox
git tag hibira_chat-v0.1.0 && git push origin hibira_chat-v0.1.0 # packages/hibira_chatA new package's first version has to be published by hand (flutter pub publish by a publisher admin); then enable automated publishing for it on
pub.dev (tag pattern hibira_inbox-v{{version}}, environment pub.dev).
MIT. See LICENSE.
