---
title: "Query the site context"
slug: "query-the-site-context"
abstract: "How to retrieve details about the current site in the SitecoreAI dashboard widget extension point."
---
# Query the site context

*Required extension points: SitecoreAI dashboard widget*

*Required SDK packages: client*

*Required API access: none*

> [!note]
> **Before you begin**
> -   Complete the [SDK quick start](https://doc.sitecore.com/mp/en/developers/sdk/0/sitecore-marketplace-sdk/quick-start--manual-.html "Quick start (manual)"). In the quick start, you make your first query by running `client.query("application.context")`.

In the SitecoreAI dashboard widget extension point, you can query the site context to retrieve details about the current site.

To query the site context:

1. In the SDK initialization code where you run the `useMarketplaceClient` hook, in the Effect Hook, after the `"application.context"` query, create a new query, then save your changes:

    ```typescript
    // Make a query to retrieve the site context
    client.query("site.context")
      .then((res) => {
        console.log("Success retrieving site.context:", res.data);
      })
      .catch((error) => {
        console.error("Error retrieving site.context:", error);
      });
    ```

2. In a SitecoreAI site dashboard, open your web browser's console, refresh the page, then open your Marketplace app.
3. In the console, find the log for `Success retrieving site.context` and inspect the object. The object contains all the details about the current site.