Skip to main content

Navigation
API

The API provided to extensions to navigate to extensions or host page.

Navigation API for all extensions. Refer to supported protocols

(type: "currententrychange", cb: (event: ) => void) => void
required
required

The currentEntry read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now.

required

The navigate() method navigates to a specific URL, updating any provided state in the history entries list.

(type: "currententrychange", cb: (event: ) => void) => void
required
(options: ) => void
required

The updateCurrentEntry() method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload.

Was this section helpful?

Navigation example

Preact

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default async () => {
render(<Extension />, document.body);
};

function Extension() {
return (
<s-button
onClick={() => {
navigation.navigate('extension://orders');
}}
>
Navigate to orders path
</s-button>
);
}