The latest version of POS-UI-Extension introduced navigating to the POS native screens. I tried following the doc. But getting an error.
Here’s my code:
import { render } from 'preact';
export default function extension() {
render(<SmartGridTile />, document.body);
}
function SmartGridTile() {
const onTileClick = () => {
try {
console.log('tile clicked');
navigation.navigate('shopify:point-of-sale/draft_orders/XYZ');
} catch (error) {
console.error('Error navigating to draft order:', error);
shopify.toast.show('Unable to view draft order.');
}
};
return (
<s-tile
heading="Redirect Example App"
subheading="Redirect to draft order"
onClick={onTileClick}
/>
);
}
Here’s the error I’m getting:
{
“name”: “ReferenceError”,
“message”: “navigation is not defined”
}
I understand that there might be some export of navigation. But couldn’t find any export called navigation. Also tried using shopify.navigation, which doesn’t work either. Every other API is referenced from shopify.xyz, but the navigation api is totally different in the Doc. & that doesn’t work anymore after upgrading to the 2025-10 API version.
Please guide me if I’m doing anything wrong. TIA.