Flutter SDK
Enbbox Flutter SDK — add multi-channel notifications to Flutter and Dart apps. Installation, configuration, Inbox widget, and notification handling.
The enbbox SDK is a pure Dart package for integrating Enbbox notifications into Flutter, Dart CLI, or server-side Dart apps.
Available on pub.dev.
Installation
dart pub add enbboxOr add to pubspec.yaml:
dependencies:
enbbox: ^1.0.0Initialization
import 'package:enbbox/enbbox.dart';
final enbbox = Enbbox(
options: EnbboxOptions(
projectId: 'YOUR_PROJECT_ID',
subscriberId: 'user-123',
subscriberHash: 'HMAC_HASH', // optional, for production
),
);Features
Fetch Notifications
final result = await enbbox.notifications.list(
const NotificationFilter(limit: 20),
);
if (result.isSuccess) {
for (final n in result.data!.notifications) {
print('${n.subject}: ${n.body}');
}
}Mark as Read
await enbbox.notifications.read('notification-id');Mark All as Read
await enbbox.notifications.readAll();Get Unread Count
final counts = await enbbox.notifications.count(
filters: [const NotificationFilter(read: false)],
);Listen for Real-Time Events
final sub = enbbox.on<NotificationReceivedEvent>(
EnbboxEvents.notificationReceived,
(event) => print('New: ${event.result.body}'),
);
// Later: sub.cancel();Manage Preferences
final prefs = await enbbox.preferences.list();
await enbbox.preferences.update(
const ChannelPreference(email: true, push: false),
);Clean Up
enbbox.disconnect();When to Use
Use enbbox for Flutter and Dart apps — mobile, desktop, CLI, or server-side. It's a pure Dart package with zero Flutter dependencies, so it works in any Dart runtime.
For web projects, use the dedicated JavaScript SDKs:
- React SDK —
@enbbox/react - Next.js SDK —
@enbbox/nextjs - JavaScript SDK —
@enbbox/js
For triggering workflows from your backend, use the API Client (@enbbox/api).
JavaScript SDK
Enbbox JavaScript SDK (@enbbox/js) — lightweight client library for sending notifications and managing subscribers from any JavaScript environment.
API Client
Enbbox Server SDK (@enbbox/api) — server-side notification management for Node.js, Deno, and Bun. Trigger workflows, manage subscribers, and configure integrations programmatically.