URL Functions

appSectionRelativeUrl()

Retrieves the URL of an app page, relative to the site root URL.

Use it to link to a page that an installed app adds to the site, such as the Bookings checkout, without hardcoding a path that a Wix user can change.

A returned URL doesn't confirm that the app page exists, because:

  • When the app has no page with sectionId as its app page ID, this method returns the URL of another page of the same app.
  • This method searches only the pages the host supplies, and the host leaves out popups. So an app page that opens as a popup gets the same result as a missing one.

For a router page, the URL is the router prefix followed by the page's own path, such as /category/category-page, not the path of one of the router's items. To link to an item, specify true for discardRouterPageSuffix to retrieve only the prefix, then append the item's path from your own data for the item, such as a category's slug.

Prepend siteUrl to build an absolute URL.

Method Declaration

Copy

Method Parameters

appIdstringRequired

ID of the app that owns the page. This is the app's appDefinitionId. Case-sensitive, and must match exactly.

For apps made by Wix, see Apps Created by Wix. For your own app, find it in your app's dashboard.


sectionIdstringRequired

App page ID of the page. Case-sensitive, and must match exactly.

To find it, read the page's appPageId in the pages map of @wix/site-service-pages on a site where the app is installed.


discardRouterPageSuffixboolean

Whether to return only the router prefix, such as /category, instead of the prefix followed by the page's own path.

On a page that isn't a router page, the result is the page's path whichever value you specify.

Default: false

Returns

Return Type:string | undefined

Relative URL of the page, such as /booking-checkout.

undefined when no page on the site belongs to the app. For example, when the app isn't installed.

Examples

Last updated: 21 October 2026

Did this help?