--- title: "clearContext()" slug: "clearcontext" updated: 2024-06-13T14:03:12Z published: 2024-06-13T14:03:12Z canonical: "docs.xgen.ai/clearcontext" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.xgen.ai/llms.txt > Use this file to discover all available pages before exploring further. # clearContext() `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 ```javascript 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. ```javascript // Create integration (use existing integration if you already created one) const integration = new XG(...config); // Clear context integration.clearContext(); ```