@colossal-sh/storefront-sdk provides React hooks and components for building storefronts. It wraps the Colossal Storefront GraphQL API.
For a reference implementation, see the Storefront Starter Template.
Installation
Setup
Initialize the client and wrap your app in the required providers:Store
Fetch project details by UID or for the current context.| Name | Type | Purpose |
|---|---|---|
useStore({ uid }) | Hook | Fetch store details by UID |
useCurrentStore() | Hook | Fetch the current store |
fetchStore({ uid }) | Method | Server-side store fetch |
fetchCurrentStore() | Method | Server-side current store fetch |
Explore main parts of Colossal SDK
Products
Fetch and display products with simplified or full data hooks.
Cart
Manage shopping carts with add, update, and remove operations.
Checkout
Create checkout sessions and redirect to hosted checkout.