@coveo/headless-react
    Preparing search index...

    Interface EngineDefinition<TControllers, TEngineOptions, TSolutionType>

    interface EngineDefinition<
        TControllers extends ControllerDefinitionsMap<Controller>,
        TEngineOptions,
        TSolutionType extends SolutionType,
    > {
        build: Build<
            TEngineOptions,
            InferControllersMapFromDefinition<TControllers, TSolutionType>,
            InferControllerPropsMapFromDefinitions<TControllers>,
            TControllers,
            TSolutionType,
        >;
        fetchStaticState: FetchStaticState<
            InferControllersMapFromDefinition<TControllers, TSolutionType>,
            UnknownAction,
            InferControllerStaticStateMapFromDefinitionsWithSolutionType<
                TControllers,
                TSolutionType,
            >,
            InferControllerPropsMapFromDefinitions<TControllers>,
            TControllers,
            TSolutionType,
        >;
        getAccessToken: () => string;
        hydrateStaticState: HydrateStaticState<
            InferControllersMapFromDefinition<TControllers, TSolutionType>,
            UnknownAction,
            InferControllerPropsMapFromDefinitions<TControllers>,
            TControllers,
            TSolutionType,
        >;
        setAccessToken: (accessToken: string) => void;
        setNavigatorContextProvider: (
            navigatorContextProvider: NavigatorContextProvider,
        ) => void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    Builds an engine and its controllers from an engine definition.

    Fetches the static state on the server side using your engine definition.

    getAccessToken: () => string

    Returns the access token.

    Fetches the hydrated state on the client side using your engine definition and the static state.

    setAccessToken: (accessToken: string) => void

    Updates the access token.

    Type declaration

      • (accessToken: string): void
      • Parameters

        • accessToken: string

          The access token to update.

        Returns void

    setNavigatorContextProvider: (
        navigatorContextProvider: NavigatorContextProvider,
    ) => void

    Sets the navigator context provider. This provider is essential for retrieving navigation-related data such as referrer, userAgent, location, and clientId, which are crucial for handling both server-side and client-side API requests effectively.

    Note: The implementation specifics of the navigator context provider depend on the Node.js framework being utilized. It is the developer's responsibility to appropriately define and implement the navigator context provider to ensure accurate navigation context is available throughout the application. If the user fails to provide a navigator context provider, a warning will be logged either on the server or the browser console.