--- title: Add custom context to the Console Hosted Search Page component slug: p1td9000 canonical_url: https://docs.coveo.com/en/p1td9000/ collection: coveo-for-salesforce source_format: adoc --- # Add custom context to the Console Hosted Search Page component > **Available since** > > This feature was introduced in the February 2025 release of Coveo for Salesforce version [6.3](https://docs.coveo.com/en/ob460496#february-2025-release-v6-3-minor-release). To add [custom context](https://docs.coveo.com/en/3389/) to the **Coveo Console Hosted Search Page** component, you must create a custom Apex class that implements `CoveoV2.HostedCustomContextInterface` as described in this article. To add custom context . [Create an Apex class](https://help.salesforce.com/s/articleView?id=sf.code_manage_packages.htm&type=5) that implements `CoveoV2.HostedCustomContextInterface` as follows: ```apex global class MyCustomContext implements CoveoV2.HostedCustomContextInterface { public Map getCustomContext(Map data) { // Returns the map of custom context values that will be added to each query. return new Map{ 'key1' => 'value1', <1> 'listOfValues' => new List{'listValue1', 'listValue2'} <2> }; } } ``` <1> `key1` is the [context](https://docs.coveo.com/en/1345/) key/value pair to add to each [query](https://docs.coveo.com/en/231/). <2> `listOfValues` is the array of context values to add to each query. **Example** ```apex global class MyCustomContext implements CoveoV2.HostedCustomContextInterface { public Map getCustomContext(Map data) { return new Map{ 'country' => 'Canada', 'role' => 'Admin', 'department' => 'IT', 'interests' => new List{'encryption', 'cloud', 'security'} }; } } ``` . Save the Apex class. ## What's next? Once you've created an Apex class that implements `CoveoV2.HostedCustomContextInterface`, you can select it from the **[Custom Context Provider](https://docs.coveo.com/en/o4b80259#custom-context-provider)** picklist in the **Coveo Console Hosted Search Page** component to augment queries with the additional context returned by your custom Apex class.