docs/platform/quickstart/nextjs.mdx
Add real-time in-app notifications to Next.js in under 10 minutes using the Novu Inbox component.
<Prompt description="Add Novu Inbox to my Next.js app" icon="sparkles" actions={["copy", "cursor"]}>
Install @novu/nextjs. Add the <Inbox /> component to your header, navbar, or sidebar.
Latest docs: https://docs.novu.co/platform/quickstart/nextjs
npm install @novu/nextjs
'use client';
import { Inbox } from '@novu/nextjs';
export default function NotificationInbox() {
return (
<Inbox
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
subscriberId="YOUR_SUBSCRIBER_ID"
/>
);
}
Use the app's existing auth system to get a unique user identifier for subscriberId. Check for Clerk, NextAuth, Firebase, Supabase, or custom auth. If no auth system exists, use YOUR_SUBSCRIBER_ID.
Extract design tokens from the host app (Tailwind config, CSS variables, theme objects) and apply them via the appearance prop. Only include values you extracted from the host design system — omit empty or placeholder appearance values.
ALWAYS:
<Inbox /> inline in existing UI — no new pages or wrappersNEVER:
@novu/nextjs installed with the project's package manager?<Inbox /> placed inline in existing UI?If any fails, revise. </Prompt>
<Steps> <Step> ### Create a Novu account [Create a Novu account](https://dashboard.novu.co/auth/sign-up) or [sign in](https://dashboard.novu.co/auth/sign-in) to access the Novu dashboard. </Step> <Step> ### Create a new Next.js application Run the following command to [create a new Next.js application](https://nextjs.org/docs/app/getting-started/installation):npm create next-app@latest
npm install @novu/nextjs
'use client';
import { Inbox } from '@novu/react';
export function NovuInbox() {
return (
<Inbox
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
subscriberId="YOUR_SUBSCRIBER_ID"
/>
);
}
If you are signed in to your Novu account, then the <Tooltip tip="The application identifier is a unique identifier for your application.">applicationIdentifier</Tooltip> and <Tooltip tip="The subscriber ID is the unique identifier for the user in your application, typically the user's ID in your database.">subscriberId</Tooltip> will be automatically populated. Otherwise, retrieve them from:
* `applicationIdentifier`: On the Novu dashboard, click **API Keys**, and copy your unique Application Identifier.
* `subscriberId`: This represents a user in your system, usually the user ID from your database. For testing, you can use the auto-generated subscriberId from your Novu dashboard. You can locate it under the Subscribers tab on the Novu dashboard.
<Note>
If you pass a `subscriberId` that does not exist yet, Novu will automatically create a new subscriber with that ID.
</Note>
</Step>
```package-install
npm run dev
```
Once your application is running, you would see a **bell icon** in the navbar. Click on it, to open the notification Inbox UI.
There are no notifications yet, so let’s trigger one!
You should see the notification you just sent from Novu! 🎉