Skip to main content
Voyager ships a small public JavaScript API designed for advanced merchants and app developers. Every entry point is either a global function on window, a custom event dispatched on a known element, or a data-* attribute that triggers behavior when added to any element. The theme is deliberately framework-free — vanilla JS, no build step — so you can call into it from any inline script, any Shopify app, or any custom snippet you add via the Custom Liquid block.

Global functions

window.voyageToast(message, type?)

Display a toast notification at the bottom of the viewport for ~2.2 seconds.
  • message — the string to display. Required.
  • type — optional. Reserved for future variants (success / error styling). Currently any value falls back to the default visual treatment.
A toast element is lazily created on first call and reused for subsequent calls. Calls within the 2.2s display window reset the timer rather than queuing — only the most recent message is shown. Defined in: assets/theme.js.

window.refreshCart()

Re-fetch the cart drawer and update the item count badge. Returns a promise that resolves once the DOM has been updated.
The function uses Shopify’s Section Rendering API (/?sections=cart-drawer) to fetch fresh server-rendered markup for the drawer, then replaces the drawer’s contents. It also fetches /cart.js and updates every [data-cart-count] element on the page, animating any badge whose count increased. Call this whenever you’ve mutated the cart from custom JavaScript — adding a line item, applying a discount, removing an item via the AJAX API. Defined in: assets/theme.js.

Custom events

Voyager’s JavaScript is bound primarily through DOM event delegation rather than CustomEvent dispatch — most behavior is keyed off click events on elements with specific data-* attributes. The one notable dispatched event: For most custom integrations, the better pattern is to call window.refreshCart() after a cart mutation rather than listening for a dispatched event.

Data-attribute hooks

Voyager uses data-* attributes extensively to bind behavior to markup. Adding any of these attributes to your own markup (in a Custom Liquid block, in a section template, or via an app) wires the element into Voyager’s JavaScript automatically.

Cart drawer

Quick-view modal

Magnetic buttons

Custom cursor

Scroll reveals

Filters and grid

Chip nav

PDP

Quantity steppers

Misc

Files

The full implementation lives in two files:

What’s next

CSS tokens

The design tokens consumed by every component.

Customization recipes

Examples of using these hooks in custom integrations.