Organizing your app

As the app developer, you can organize your app into routes and associate each route with an extension point. This lets you control which part of your app appears in which area of the SitecoreAI user interface.

A route is a URL path in your app, such as /home or /fullscreen-analytics, and it corresponds to one part of your app, such as a component or an entire page. By associating a route with an extension point, you ensure that the extension point displays that specific part of your app to the Sitecore product user.

For example, you could associate your app's /fullscreen-analytics route with the SitecoreAI full screen extension point. This way, when the Sitecore product user opens your app in the SitecoreAI full screen extension point, they see the contents of your app's /fullscreen-analytics route.

Note the following about routes and extension points:

  • You can enable one or more extension points for your app. Each enabled extension point is associated with an app route.

  • Typically, a single extension point is associated with a single route.

    The dashboard widget extension point is an exception because a single app can have multiple widgets. If you set up multiple widgets, you map each widget to a unique route.

Tip

Routing also lets you implement separation of concerns and code splitting. This helps keep your app organized and results in smaller app bundle sizes.

Configuring routing

When you enable an extension point for your custom or public app, a route URL is automatically assigned to it. You can customize the URLs to your needs. Then, in your app, you must associate the same route URLs with components of your app using React Router or any other routing tool of your choice.

Important

If you need to change a route URL, make sure to update it both on the app configuration page and in your app's source code.

Consider the example of a web analytics app configured with the following extension points and route URLs:

Extension point

Route URL

Standalone

/home

SitecoreAI full screen

/fullscreen-analytics

SitecoreAI dashboard widget

/dashboard-analytics

SitecoreAI dashboard widget

/dashboard-reports

Do you have some feedback for us?

If you have suggestions for improving this article,