Skip to main content

App background

The app background target is for work that should happen while POS is open, but doesn't need a screen. Unlike render targets, it doesn't mount UI or update what merchants see in POS.

  • Transaction sync: Listen for completed sale, return, or exchange transactions and send data to your app backend.
  • Cash tracking workflows: Respond when cash tracking sessions start or complete.
  • Session-level state: Keep extension state updated while POS is open.

Anchor to App background targetApp background target

pos.app.ready.data

Runs once when POS is ready. Register event listeners in the entry function with shopify.addEventListener(). POS keeps the target active until the session ends.

Support
Components (0)
APIs (7)

Anchor to Event listener methodsEvent listener methods

The app background target adds these methods to the shopify global.

Anchor to addEventListener
addEventListener
<K extends keyof >(type: K, listener: (event: [K]) => void) => void
required

Register a listener for a POS host event. Listeners are fire-and-forget: their return values are ignored, and their errors are caught without affecting the host or other listeners.

Anchor to removeEventListener
removeEventListener
<K extends keyof >(type: K, listener: (event: [K]) => void) => void
required

Remove a listener previously registered with addEventListener. The listener reference must match the one used to register.


  • Use it for session-level work: Choose this target for logic that should run while POS is open and doesn't need a visible surface.
  • Use render targets for UI: If merchants need to see, confirm, or act on information, use a render target instead.
  • Initialize predictably: The app background target starts with each POS session, so setup code should be safe to run more than once.
  • Store only what you need: Keep local storage writes small and limited to data you need across POS sessions.

  • App background extensions are currently observation-only and can't mutate POS state with the available APIs.

Was this page helpful?