FAQ
Is this safe with SSR?
Yes. All DOM access runs inside useEffect, which only executes in the browser. The component renders {children} on the server, and script injection happens client-side only.
Can I use multiple project keys on the same page or site?
No. The orchestrator is designed to be used once at the root of your app with a single orchestratorKey for the whole website. Rendering with different keys on the same page is not supported and will log an error in the console as a safety check.
Can I disable anti-flicker in development?
Yes. Pass antiFlickerEnabled={false} when you don't need it:
<MVTOrchestrator
orchestratorKey="abc123xyz"
antiFlickerEnabled={process.env.NODE_ENV === 'production'}
>
{children}
</MVTOrchestrator>
What happens if the engine script fails to load?
The anti-flicker timeout (default 3000ms) will still remove the hidden style, so your page will become visible even if the engine doesn't load. The engine functionality simply won't be available.
Can I use this with other React frameworks?
Yes. While optimized for Next.js, this package works with any React application (Create React App, Vite, etc.). Just ensure you're using it in a client component context.
Does this work with TypeScript?
Yes. Full TypeScript support is included with exported types:
import type { MVTOrchestratorProps } from '@mvtlab/nextjs-orchestrator';
How do I get my project key?
Contact MVTLab.io support or check your MVTLab.io dashboard to obtain your project key.
What browsers are supported?
The component works in all modern browsers that support:
- ES2019+ JavaScript
- React 18+
document.createElementanddocument.head.appendChild