Installation
Install the package using npm, yarn, or pnpm:
npm install @splitlabio/nextjs-orchestrator
# or
yarn add @splitlabio/nextjs-orchestrator
# or
pnpm add @splitlabio/nextjs-orchestrator
Migrating from
@mvtlab/nextjs-orchestratorUninstall the old package and install the new one — the API is identical:
npm uninstall @mvtlab/nextjs-orchestrator
npm install @splitlabio/nextjs-orchestrator
Then update your imports from @mvtlab/nextjs-orchestrator to @splitlabio/nextjs-orchestrator.
Requirements
- Next.js >= 13.0.0 (App Router or Pages Router)
- React >= 18.0.0
- React DOM >= 18.0.0
Which component do I use?
- App Router → use
MVTScriptsin your rootapp/layout.tsx. It is a Server Component, so it does not need'use client'. This is the recommended path — the anti-flicker style and engine script are server-rendered and run before hydration, so there is no content flash. - Pages Router (or when you cannot edit
layout.tsx) → useMVTOrchestratorinpages/_app.tsx. It is a client component and injects the scripts viauseEffectafter hydration.
Why is
MVTOrchestratorclient-only? It injects<script>and<style>tags, accesseswindowanddocument, and defineswindow.rmfk. These operations only exist in the browser.MVTScriptsavoids this by rendering the tags into the server HTML directly instead of touching the DOM at runtime.