@notifyon/next
v0.1.2
Published
Next.js SDK for NotifyOn
Maintainers
Readme
@notifyon/next
Next.js SDK for NotifyOn - Real-time notifications for your Next.js applications.
Installation
npm install @notifyon/next
# or
yarn add @notifyon/next
# or
pnpm add @notifyon/nextUsage
App Router (Next.js 13+)
import { NotifyOn } from '@notifyon/next';
export default function RootLayout({ children }) {
return (
<html>
<body>
<NotifyOn
publicKey="pk_your_public_key"
userId="user_123"
/>
{children}
</body>
</html>
);
}Pages Router
import { NotifyOn } from '@notifyon/next';
export default function MyApp({ Component, pageProps }) {
return (
<>
<NotifyOn
publicKey="pk_your_public_key"
userId="user_123"
/>
<Component {...pageProps} />
</>
);
}Props
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| publicKey | string | Yes | Your NotifyOn public key |
| userId | string | Yes | The user ID to receive notifications |
SSR Support
The component is marked with 'use client' directive and automatically handles server-side rendering. It only initializes on the client side, preventing hydration issues.
License
MIT
