Next.js Quickstart
Install adkit-react and add slots to your Next.js app. Supports both App Router (Next.js 13+) and Pages Router.
Prerequisites
Install the package
Add the provider to your root layout
Import AdkitProvider and the styles in your root layout. No "use client" directive needed — the library ships all components pre-marked as client components.
No "use client" required
adkit-react handles this automatically. Import and use its components directly from any Server Component file — no directive needed on your end.Add a slot
Import AdSlot in any component — Server Component or Client Component. No extra directive needed.
Price is in cents
price={2500} = $25/day.Verify it works
Run next dev and open the page. The slot should match this banner placeholder. If it doesn't appear, check the browser console — misconfigured slots log a console.error without crashing the tree.
Refreshing on route change
Slots re-fetch automatically on mount. For SPA-style navigations where the slot component doesn't remount, use useAdkit() to trigger a refresh when the pathname changes.
"use client" because it calls a hook. Render it inside your root layout, nested inside the provider.