JavaScript SDK
Enbbox JavaScript SDK (@enbbox/js) — lightweight client library for sending notifications and managing subscribers from any JavaScript environment.
The @enbbox/js SDK provides a framework-agnostic client for Enbbox notifications.
Installation
npm install @enbbox/jsInitialization
import { Enbbox } from "@enbbox/js";
const enbbox = new Enbbox({
projectId: "YOUR_PROJECT_ID",
subscriberId: "user-123",
});Features
Initialize Session
await enbbox.init();Fetch Notifications
const notifications = await enbbox.notifications.list({ page: 0 });Mark as Read
await enbbox.notifications.markAsRead(notificationId);Mark All as Read
await enbbox.notifications.markAllAsRead();Listen for New Notifications
enbbox.on("notification_received", (notification) => {
console.log("New notification:", notification);
});Get Unread Count
const count = await enbbox.notifications.unreadCount();When to Use
Use @enbbox/js when you need direct control over the notification lifecycle without a framework. For React or Next.js projects, prefer the dedicated SDKs:
- React SDK —
@enbbox/react - Next.js SDK —
@enbbox/nextjs
For triggering workflows from your backend, use the API Client (@enbbox/api).
Next.js SDK
Enbbox Next.js SDK (@enbbox/nextjs) — server-side notification management for Next.js apps. Workflow serving, API routes, and server component support.
Flutter SDK
Enbbox Flutter SDK — add multi-channel notifications to Flutter and Dart apps. Installation, configuration, Inbox widget, and notification handling.