Developers

SetSearchContext

Usage

Use this method to log the user information for rating events from a search source.

Note: Remember to set up the session before calling this function.

To start a session see methods generateSession and setSessionToken.

Mandatory parameters

This method accepts only one parameter, which is mandatory.

Name Type Description
contextGenerator function This function's logic needs to generate the desired user information (context) and return it.

Optional parameters

This method has no optional parameters.

Response data format

This method does not return any values.

Example

const userInfo = {
    username: "John Doe",
    company: "Inbenta"
};

sdk.client.setSearchContext(() => userInfo);