Standard storefront events and actions
Standard storefront events and actions are the interface that themes use to communicate with apps and agents on the storefront. Themes dispatch events when commerce interactions occur, and apps trigger theme behaviors by calling actions. Both work across all themes that support them, so apps integrate without parsing theme DOM structure or intercepting window.fetch.
Anchor to Standard storefront eventsStandard storefront events
Themes dispatch standard storefront events when commerce interactions occur on the storefront, such as product views, cart updates, and collection filter changes. Apps listen for these events with addEventListener to drive personalization, integrations, or custom UI updates.
Events dispatch from theme code at the point where the interaction occurs.
Anchor to Standard storefront actionsStandard storefront actions
Standard storefront actions are async functions on Shopify.actions that apps and agents call to request a theme behavior, such as adding to cart, opening the cart drawer, or fetching the current cart. The theme decides how to handle each call.
Shopify provides a default implementation for every action. updateCart writes to the Storefront API and refreshes the cart in place when possible, falling back to a page reload. openCart opens a cart drawer if one exists, and otherwise redirects to /cart. getCart reads the current cart from the Storefront API. Themes override the defaults to replace those behaviors with custom UI updates, such as opening a drawer or updating a counter in place.
When a configured action succeeds, the action runtime auto-emits the matching standard events. An app that calls updateCart doesn't need to also dispatch shopify:cart:lines-update.
Anchor to Developer toolsDeveloper tools
Anchor to CLI dev bundleCLI dev bundle
During local development with shopify theme dev, the CLI loads a dev build of the standard events runtime instead of the production build. This build validates event payloads and logs warnings when fields are malformed or missing. These checks are stripped in production.
Anchor to Events and actions inspectorEvents and actions inspector
Pass the --standard-events-inspector flag to shopify theme dev to inject a floating debug UI into local dev pages. The inspector has two tabs:
- Events shows every emitted standard event in real time with full payloads.
- Actions lets you dispatch actions and inspect their results.