Start using the Theme SDK

@upstorr/theme-sdk/v1 is the only Upstorr package a theme may import. It supplies stable presentation data, route builders, browser events and approved commerce actions.

Import from the public entry

import {
  buildThemeProductUrl,
  formatThemeMoney,
  themeRuntimeProps,
} from '@upstorr/theme-sdk/v1';

Never import an SDK source file such as @upstorr/theme-sdk/src/.... Only the versioned public entry is part of the theme contract.

Use autocomplete first

theme init installs generated declaration files under .upstorr-theme/sdk/. Your editor reads these files so it can suggest current names, arguments and return types. Do not edit them; reinstalling or updating the CLI replaces generated support.

The online API reference is generated from the same public entry and is split into feature groups. Use the human guide to understand a job, autocomplete while coding and the reference page for an exact signature.

What the SDK owns

  • safe navigation and URL construction;
  • prepared product, listing, cart, checkout and account views;
  • commerce mutations with platform-owned authentication;
  • editor attributes and stable browser events;
  • money, media, market and presentation helpers.

What it does not own

The SDK contains no Casa design. It does not calculate merchant GST, inventory reservations, discounts, shipping totals, payment truth or order truth in the browser. Those remain platform responsibilities.

If a public action is missing, request a shared SDK addition. Do not call a private endpoint from one theme.