Skip to main content
These are the callback contracts used by native app extensions. Export the function or handler required by the selected extension page; the type definitions below describe the values passed to it and the mutations it may return. Async callbacks share the host’s extension timeout. Keep work bounded and return within the documented three-second budget. A timed-out or rejected promise is treated as a failed callback and native behavior continues according to the extension contract.

Product listing formatter

The editor is mutable for the duration of the callback. Make formatting idempotent because the same listing can be formatted more than once.

Collection filters

trigger is either "Initial" or "UserFiltersChanged". The callback can change the editor before the product query runs. Boolean mutators return false when the requested filter or value does not exist.

Product detail handler

Callbacks that support cancellation suppress the native action when they return false. There is no preventDefault() method on the event object. onAddedToCart and onProductSelected receive { product, productVariant }; onBeforeProductAddToCart is the callback whose payload uses { product, variant, quantity }.

PDP formatting and media tags

Media is native-owned: handlers can inspect the gallery and manage tags, but cannot reorder or add media. A tag with the same ID on one media item is replaced. A tag must provide text, an icon, or both.

Cart operations

Use the returned operations from the cart extension. Operations are applied by the native runner; do not mutate a CartOperation after returning it.

Cart line-item formatter

The formatter may change presentation and checkout availability. The line item’s product and variant references can be null when the underlying catalog object no longer exists.

Product-card bridge

Product-card modules receive their products through ComponentContext.cards.
The bridge invokes the subscriber immediately and keeps only the latest subscriber. Render one root child per slot, with real products first and loading placeholders last.