---
title: "Context"
slug: "context"
abstract: "Understand how to use context to personalize search results."
---
# Context

When creating a widget request, you can configure it by specifying the search context using the [`Context`](https://doc.sitecore.com/sdk/en/developers/005/cloud-sdk/cloud-sdk-reference/cloud-sdk-search/cloud-sdk-search-browser/classes/cloud-sdk-search-context.html "Context") class. Search context is a set of contextual information about a site visitor's search request, such as locale, location, device, and web browser. Sitecore Search uses this data for personalizing search results.

For example, you can configure the search request to contain results relevant to audiences who browse the English version of your site in the United States:

```typescript
import { SearchWidgetItem, Context } from "@sitecore-cloudsdk/search/browser";

// Configure the search request:
const widgetRequest = new SearchWidgetItem("product", "rfkid_7"); // Create a new widget request for the "Product" entity
widgetRequest.content = {}; // Request all attributes for the entity
widgetRequest.limit = 10; // Limit the number of results to 10

// Add context:
const context = new Context({
  locale: { language: "en", country: "us" }
});

// Call the `getWidgetData` function to request the data for the specified search context:
const response = await getWidgetData(
  new WidgetRequestData([widgetRequest], context),
);
```