---
title: "Open a different page"
slug: "open-a-different-page"
abstract: "How to programmatically open a different page in the SitecoreAI Page Builder so users can start working with it."
---
# Open a different page

*Required extension points: any SitecoreAI Page Builder extension point*

*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)").

You can programmatically navigate from the currently open page to a different one so the SitecoreAI user can immediately start working with it, with no manual action required. This is useful to perform in response to some other action. For example, when you create a new page from the Marketplace app using the Authoring and Management GraphQL API, and then decide to redirect the user to the new page.

To open a different page:

1. In the SDK initialization code where you run the `useMarketplaceClient` hook, after the Effect Hook, create a new mutation function:

    ```typescript
    const navigateToPage = () => {
      // Create a new page using the GraphQL API...

      // Navigate the user to the new page using the `itemId`:
      client?.mutate("pages.context", {
        params: {
          itemId: "<ID_OF_NEW_PAGE>",
        },
      });
    };
    ```

    Replace the placeholder with the ID of a page.

2. In the `return` statement, create a button that runs the mutation function, then save your changes:

    ```typescript
    <button onClick={navigateToPage}>Open another page</button>
    ```

3. In the SitecoreAI Page Builder, refresh the page, then open your Marketplace app.
4. In the Marketplace app, click **Open another page**.