Use this method to log the user information for rating events from a search source without linking it to a specific session.
Note: User information logged using the setContext method will be overwritten if the setSearchContext method is called afterwards.
This method accepts only one parameter, which is mandatory.
Name | Type | Description |
---|---|---|
context | function | This function's logic needs to generate the desired user information (context) and return it. The character limit is 512. To exceed this character limit, use the setSearchContext method instead. |
This method has no optional parameters.
This method does not return any values.
const userInfo = {
username: "John Doe",
company: "Inbenta"
};
sdk.client.setContext(() => userInfo);