Skip to main content
The swish.events API lets you subscribe to events emitted by the SDK. Use it to react to changes in saved items, lists, cart state, and notifications.

subscribe(type, callback)

Subscribe to one or more events. Returns an unsubscribe function.
Pass an array to subscribe to multiple events at once:

unsubscribe(type, callback)

Remove a specific event listener. Equivalent to calling the function returned by subscribe().

Event reference

Item events

List events

Cart events

Notification events

Auth events

Examples

Update a cart count badge

Track saves for analytics

Refresh UI after list changes