Skip to main content

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-orchestrator

Uninstall 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 MVTScripts in your root app/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) → use MVTOrchestrator in pages/_app.tsx. It is a client component and injects the scripts via useEffect after hydration.

Why is MVTOrchestrator client-only? It injects <script> and <style> tags, accesses window and document, and defines window.rmfk. These operations only exist in the browser. MVTScripts avoids this by rendering the tags into the server HTML directly instead of touching the DOM at runtime.