@coveo/headless
    Preparing search index...

    Interface HydrateStaticStateOptions<TSearchAction>

    interface HydrateStaticStateOptions<TSearchAction> {
        accessToken?: string;
        navigatorContext?: NavigatorContext;
        searchActions: TSearchAction[];
    }

    Type Parameters

    • TSearchAction
    Index
    accessToken?: string

    A per-request access token (for example, a per-user Coveo search token) to use for this hydrateStaticState() call only.

    When provided, it overrides the access token from the engine definition configuration for this call without mutating the shared definition. When omitted, the definition's configured access token is used.

    Unlike fetchStaticState(), the engine returned by hydrateStaticState() outlives the call, so it stays subscribed to setAccessToken() updates even when this option is provided.

    The token passed to fetchStaticState() is NOT carried over here. If you passed an accessToken to the matching fetchStaticState() call, you MUST pass the same token here, otherwise the hydrated engine falls back to the definition's configured token and every client-side request (facets, pagination, search-as-you-type) queries with the wrong permissions.

    navigatorContext?: NavigatorContext

    The navigator context to use for this hydrateStaticState() call only.

    When provided, it is applied to this call's engine without mutating the shared definition. Pass the same navigator context that was used to fetch the static state so the hydrated engine reports the same client ID and keeps the analytics session continuous. When omitted, the provider set with setNavigatorContextProvider is used.

    searchActions: TSearchAction[]