React / Next.js Quickstart
Complete end-to-end guide to embedding real-time in-app notification centers (<Inbox />), toast alerts, and event triggers in React and Next.js applications.
1. Sign Up & Get API Credentials
Register at https://app.hubnest.io. Go to Developer → API Keys → Generate New Key to get your secret key (hn_live_...). Save the key as NEXT_PUBLIC_HUBNEST_API_KEY or use a backend session token to authenticate your frontend user subscribers safely.
2. Install @hubnest/react Package
Install the React notification center library and STOMP WebSocket dependencies:
3. Wrap App with <HubNestProvider>
Wrap your root app component (layout.tsx in Next.js App Router or _app.tsx in Pages Router) with HubNestProvider to initialize the real-time STOMP WebSocket connection:
4. Embed <Inbox /> Notification Center
Add the interactive <Inbox /> bell icon and slide-out notification drawer anywhere in your navigation bar or user dashboard:
5. Real-Time WebSockets & Toast Alerts
Listen to incoming real-time notifications programmatically and display dynamic toast popups using the useHubNest hook:
6. Trigger In-App Notification Event
Trigger an event from your Next.js Server Action or backend API route to deliver an instant message into the user's inbox drawer:
7. Customize Theme & Dark Mode
Style the notification drawer, unread badge colors, and fonts using CSS variables or custom Tailwind classes:
8. Verify Delivery in Logs
Go to Developer → Logs at https://app.hubnest.io to monitor real-time WebSocket connection state, message dispatch latency, and read status tracking for all connected React clients.
Next steps
Configure AWS SES IAM keys, verified domains, and sending rate limits.
Connect SendGrid API Keys and verified sender identities.
Connect Twilio Account SID, Auth Token, and phone numbers.
Connect Meta WhatsApp Cloud API access tokens and phone number IDs.