@enbbox/nextjs
v1.1.0
Published
Enbbox Next.js SDK for Inbox notifications
Maintainers
Readme
@enbbox/nextjs
Next.js SDK for Enbbox — drop-in notification inbox with App Router and Pages Router support.
Installation
npm install @enbbox/nextjs @enbbox/react @enbbox/jsApp Router (Recommended)
// app/layout.tsx
import { EnbboxProvider } from "@enbbox/nextjs";
export default function RootLayout({ children }) {
return (
<html>
<body>
<EnbboxProvider projectId="YOUR_PROJECT_ID" subscriberId="USER_ID">
{children}
</EnbboxProvider>
</body>
</html>
);
}// app/page.tsx (client component)
"use client";
import { Inbox } from "@enbbox/nextjs";
export default function Page() {
return <Inbox />;
}Pages Router
// pages/_app.tsx
import { EnbboxProvider } from "@enbbox/nextjs";
export default function App({ Component, pageProps }) {
return (
<EnbboxProvider projectId="YOUR_PROJECT_ID" subscriberId="USER_ID">
<Component {...pageProps} />
</EnbboxProvider>
);
}Hooks
All hooks from @enbbox/react are re-exported:
import {
useNotifications,
useCounts,
usePreferences,
} from "@enbbox/nextjs/hooks";Components
All components from @enbbox/react are re-exported from the main entry point.
| Component | Description |
| ------------------ | ---------------------------------------- |
| <EnbboxProvider> | Context provider |
| <Inbox> | Self-contained bell + notification panel |
| <Bell> | Notification bell with unread badge |
| <Notifications> | Notification list |
| <Preferences> | Preference toggles |
License
MIT
