Skip to main content

ByteSellSDK

Served by the platform at ${ platform.sdk }. Calls are relative to the page, so a custom domain requires no configuration. An expired session is refreshed once and the request replayed. A refusal from bot protection is not retried, and a request carrying a single-use verification token is never replayed.
A contact form must use support.openTicket. Posting elsewhere bypasses the merchant’s ticket inbox and creates a second one they do not monitor.

The cart

The cart is a shared Alpine store rather than a global object:
add() dispatches a cart-updated window event. State persists in localStorage. preview is display only. The server re-derives every total at order creation, so browser-side edits cannot affect the amount charged. Checkout is platform-owned. The theme’s Checkout button stashes the cart and navigates to the hosted pay page.

Money helpers

These are defined by the theme, not the platform. The two first-party themes define them differently.
The two-argument form is for values that already carry a currency: store credit, gift cards, affiliate payouts, and the frozen total of a settled order. The one-argument form converts an already-converted number. Nothing throws and the displayed figure is wrong.
Prices arrive as strings. .toFixed() on one throws.

Multi-currency

Presentment currency is optional. A theme that does not implement it displays all prices in the store’s own currency. A theme that implements it owns the entire surface: the picker, the cookie, the conversion helpers, and window.__bsPresentmentRates derived from storefront.presentment_rates_json.
A merchant switching from a theme that supports presentment to one that does not loses buyer-currency display without warning. State support in the theme listing.

Icons

The icon runtime is served by the platform. Mark an element with a kebab-case icon name and call the runtime:
Icons are fetched individually and asynchronously. Each replacement is marked, so a theme’s own MutationObserver must skip already-marked elements to avoid re-triggering itself.
Platform scripts are deferred and run after inline end-of-body scripts. Call lucide.createIcons() from DOMContentLoaded, or guard for the runtime being present.