Actions

Shopify App Bridge introduces a new concept of actions. An action provides a way for applications and hosts to trigger events with a payload.

The code examples in this section all assume you’re using modular JavaScript patterns. If you are instead using the CDN-hosted version of Shopify App Bridge, you can achieve the same results by replacing imports with objects on the window['app-bridge'] global.

Instead of:

Use:

All other example code should function as-is.

Simple actions

Simple actions can be dispatched by both hosts (e.g. the Shopify admin or Shopify POS) and apps. Here is an example of a simple action in an app:

Action sets

Action sets are grouped simple actions created and used by apps. They are generated with a unique ID and provide the additional capability for apps to subscribe directly to them. They can be thought of as a persisted set of actions that can be dispatched/subscribed to at any time. Here is an example of a Toast action set: