Interface RecommendationEngineConfiguration

The recommendation engine configuration.

interface RecommendationEngineConfiguration {
    accessToken: string;
    analytics?: AnalyticsConfiguration;
    environment?: "dev" | "stg" | "hipaa" | "prod";
    locale?: string;
    name?: string;
    organizationId: string;
    pipeline?: string;
    preprocessRequest?: PreprocessRequest;
    preprocessSearchResponseMiddleware?: PostprocessSearchResponseMiddleware;
    proxyBaseUrl?: string;
    renewAccessToken?: () => Promise<string>;
    searchHub?: string;
    timezone?: string;
}

Hierarchy (View Summary)

Properties

accessToken: string

The access token to use to authenticate requests against the Coveo Cloud endpoints. Typically, this will be an API key or search token that grants the privileges to execute queries and push usage analytics data in the target Coveo Cloud organization.

Allows configuring options related to analytics.

environment?: "dev" | "stg" | "hipaa" | "prod"

The environment in which the organization is hosted.

The dev and stg environments are only available internally for Coveo employees (e.g., Professional Services).

Defaults to prod.

locale?: string

The locale of the current user. Must comply with IETF’s BCP 47 definition: https://www.rfc-editor.org/rfc/bcp/bcp47.txt.

Notes: Coveo Machine Learning models use this information to provide contextually relevant output. Moreover, this information can be referred to in query expressions and QPL statements by using the $locale object.

name?: string

The Engine name (e.g., myEngine). Specifying your Engine name will help in debugging when using an application with multiple Redux stores.

'coveo-headless'
organizationId: string

The unique identifier of the target Coveo Cloud organization (e.g., mycoveocloudorganizationg8tp8wu3)

pipeline?: string

Specifies the name of the query pipeline to use for the query. If not specified, the default query pipeline will be used.

preprocessRequest?: PreprocessRequest

Allows for augmenting a Platform request before it is sent.

Request to be augmented

The origin of the client, can be "analyticsFetch", "analyticsBeacon" or "searchApiFetch"

Augmented request

preprocessSearchResponseMiddleware?: PostprocessSearchResponseMiddleware

Allows for augmenting a search response before the state is updated.

proxyBaseUrl?: string

The base URL to use to proxy Coveo search requests (e.g., https://example.com/search).

This is an advanced option that you should only set if you need to proxy Coveo search requests through your own server. In most cases, you should not set this option.

See Headless proxy: Recommendation engine.

renewAccessToken?: () => Promise<string>

A function that fetches a new access token. The function must return a Promise that resolves to a string (the new access token).

searchHub?: string

The first level of origin of the request, typically the identifier of the graphical search interface from which the request originates. Coveo Machine Learning models use this information to provide contextually relevant output. Notes: This parameter will be overridden if the search request is authenticated by a search token that enforces a specific searchHub. When logging a Search usage analytics event for a query, the originLevel1 field of that event should be set to the value of the searchHub search request parameter.

timezone?: string

The tz database identifier of the time zone to use to correctly interpret dates in the query expression, facets, and result items. By default, the timezone will be guessed.

America/Montreal
MMNEPVFCICPMFPCPTTAAATR