Skip to main content

Customization

Beta

The Storefront SDK is in beta. Content in this section may be updated as the SDK evolves.

The Storefront SDK is designed to be customized. Components expose callbacks and pass-through properties that let you add custom behavior without forking the component source.

Component callbacks

Components expose callbacks that fire before, during or after key actions. You provide your own function and the component calls it at the right moment.

Common callback patterns:

CallbackFires whenReturns
onCartCreatedA new cart is createdThe new cart object
afterRegisterA new user registersThe user object

Use callbacks to inject custom business logic. For example, after user registration you might need to add the new contact to an order list or set a specific attribute value. Override the afterRegister callback to add that logic while still using the default registration component.

Pass-through properties

When components are nested (like AddToCart inside ProductCard), the parent exposes pass-through properties for the child. This means you provide child component properties directly on the parent, and the parent forwards them.

For example, ProductCard accepts all AddToCart properties (cartId, createCart, onCartCreated) in addition to its own properties. The component documentation for each parent lists which properties are its own and which are forwarded.

This pattern means you do not need to access child components directly. You configure everything from the outermost component.

Overriding default behavior

Components that require API access handle it by default. If you need different behavior, you can use before/after actions (hooks that fire before or after a default action) and override the default callback to inject custom logic.

Theming

Theming and visual customization details will be added once the approach is finalized.

See also

  • UI Components for the component inventory, callback pattern and required properties
  • Accelerator for how components, pages and the SDK layer relate
  • CMS Integration for customizing CMS block rendering