Contentful Personalization & Analytics
    Preparing search index...
    • Provides the Optimization instance to all child components via React Context.

      Handles SDK initialization, loading state, and cleanup internally. Children are not rendered until the SDK is ready (loading gate).

      Parameters

      Returns Element | null

      A context provider wrapping the children, or null while initializing

      Config is captured on first render and subsequent prop changes are ignored. To force re-initialization, change the React key prop.

      Prefer using OptimizationRoot instead, which wraps this provider with additional functionality such as live updates and the preview panel.

      <OptimizationProvider clientId="your-client-id" environment="main">
      <App />
      </OptimizationProvider>