Quick Start
Wrap your app at the root level. The component must be in a client component file ('use client';).
App Router
// app/layout.tsx
'use client';
import { MVTOrchestrator } from '@mvtlab/nextjs-orchestrator';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<MVTOrchestrator orchestratorKey="YOUR_PROJECT_KEY">
{children}
</MVTOrchestrator>
</body>
</html>
);
}
Pages Router
// pages/_app.tsx
'use client';
import { MVTOrchestrator } from '@mvtlab/nextjs-orchestrator';
export default function MyApp({ Component, pageProps }) {
return (
<MVTOrchestrator orchestratorKey="YOUR_PROJECT_KEY">
<Component {...pageProps} />
</MVTOrchestrator>
);
}
Note: Replace
YOUR_PROJECT_KEYwith your actual MVTLab.io project key. You can find this in your MVTLab.io dashboard.