Skip to main content

Usage Examples

Basic Usage

import { MVTOrchestrator } from '@mvtlab/nextjs-orchestrator';

<MVTOrchestrator orchestratorKey="abc123xyz">
<YourApp />
</MVTOrchestrator>

Disable Anti-Flicker

If you don't want the anti-flicker behavior:

<MVTOrchestrator
orchestratorKey="abc123xyz"
antiFlickerEnabled={false}
>
<YourApp />
</MVTOrchestrator>

Custom Timeout

Adjust the timeout duration:

<MVTOrchestrator
orchestratorKey="abc123xyz"
antiFlickerTimeoutMs={5000}
>
<YourApp />
</MVTOrchestrator>

Environment Variables

Store your project key in environment variables:

# .env.local
NEXT_PUBLIC_MVT_PROJECT_KEY=your_key_here

Then use it in your code:

<MVTOrchestrator
orchestratorKey={process.env.NEXT_PUBLIC_MVT_PROJECT_KEY!}
>
{children}
</MVTOrchestrator>

Note: Use NEXT_PUBLIC_ prefix for client-side environment variables in Next.js.