Documentation
Next.js
On Next.js, install Splitlab with the Next.js Orchestrator package instead of pasting the install snippet. It renders the same engine script, plus the anti-flicker style, the way Next.js expects: server-rendered on the App Router, so visitors never see the original page flash before a variant applies.
Steps
-
Install the package:
npm install @splitlabio/nextjs-orchestrator -
Add it to your app with your project key (from the dashboard → Install / SmartCode).
App Router (recommended), in
app/layout.tsx:import { MVTScripts } from '@splitlabio/nextjs-orchestrator'; export default function RootLayout({ children }) { return ( <html lang="en"> <body> <MVTScripts orchestratorKey="YOUR_PROJECT_KEY" /> {children} </body> </html> ); }Pages Router, in
pages/_app.tsx:import { MVTOrchestrator } from '@splitlabio/nextjs-orchestrator'; export default function MyApp({ Component, pageProps }) { return ( <MVTOrchestrator orchestratorKey="YOUR_PROJECT_KEY"> <Component {...pageProps} /> </MVTOrchestrator> ); } -
Deploy or restart your Next.js app.
Going further
Requirements, router-specific behaviour, the full API and troubleshooting live in the Next.js SDK reference.