clearContext()

Prev Next

clearContext() is used to clear the current context object that will be used for XGen’s prediction API.

Context must be configured prior to the prediction API being called. Otherwise, the contextual variables will not be included in the request.

Syntax

clearContext()

Parameters

None.

Return Value

This function has no return value.

Examples

Clear the context

In this example, we will clear the context object to no longer have any contextual variables.

// Create integration (use existing integration if you already created one)
const integration = new XG(...config);

// Clear context
integration.clearContext();