1. Search JS SDK for React

Credentials for authentication

For data security and privacy reasons, all requests made using Sitecore Search JS SDK for React require authentication.

While authenticating, the credentials attributes added to the WidgetsProvider component depend on how your subdomain is set up. You can find their values for the following in the Sitecore Search interface.

The following table lists the attributes needed for authentication:

Attribute

Type

Description

env

string

Environment from where the data should be gathered.

The value must be one of apse2 (for Asia/Oceania domains), prodEu (for European domains), or prod (for US domains).

customerKey

string

Customer ID provided by Search.

serviceHost

string

API host provided by Search. Required when subdomain is set up with Search.

apiKey

string

API key generated by Search. Alternatively, you can use a Bearer token obtained using the API key. Required when subdomain is not set up with Search.

Important

The JS SDK sets a cookie and includes the UUID when tracking events. Visitor information, UUID, is required to personalize search results.

If you have suggestions for improving this article, let us know!