Documentation Index
Fetch the complete documentation index at: https://docs.colossal.sh/llms.txt
Use this file to discover all available pages before exploring further.
Simplified hooks
Return SimpleProduct objects with pre-computed prices and images.
| Name | Type | Purpose |
|---|
useProducts(storeUid, currency) | Hook | Fetch all products for a store |
useProduct(productUid) | Hook | Fetch a single product by UID |
fetchProducts(storeUid, currency) | Method | Server-side fetch of all products |
fetchProduct(productUid) | Method | Server-side fetch of a single product |
import { useProducts, useProduct } from "@colossal-sh/storefront-sdk";
// All products
const { products, isLoading } = useProducts(storeUid, "USD");
// Single product (currency resolved automatically)
const { product } = useProduct("product-uid-here");
Full data hooks
Return the full StoreProduct shape from the GraphQL API, including all variant, pricing, media, and deliverable data.
| Name | Type | Purpose |
|---|
useStoreProducts(storeUid) | Hook | Fetch all products for a store |
useStoreProduct(productUid) | Hook | Fetch a single product by UID |
fetchStoreProducts(storeUid) | Method | Server-side fetch of all products |
fetchStoreProduct(productUid) | Method | Server-side fetch of a single product |
import { useStoreProducts, useStoreProduct } from "@colossal-sh/storefront-sdk";
// All products
const { data } = useStoreProducts(storeUid);
const products = data?.productsByStoreUid ?? [];
// Single product
const { data } = useStoreProduct("product-uid-here");
const product = data?.product;
Types
SimpleProduct
Returned by useProducts, useProduct, fetchProducts, and fetchProduct.
Resolved price from the default variant.
Formatted price with currency symbol (e.g. "$19.99" or "$9.99/month").
All media URLs from the default variant.
Subscription interval (e.g. "month", "year").
What the customer receives after purchase.
Unique deliverable identifier.
file_download, api_key, discord_access, shippable, or custom.
Type-specific configuration.
StoreProduct
Returned by useStoreProducts, useStoreProduct, fetchStoreProducts, and fetchStoreProduct. The full product shape from the GraphQL API.
Unique product identifier.
Full product description.
Structured content blocks.
The default variant for this product.
Unique variant identifier.
List of prices for this variant.
Three-letter ISO currency code (e.g. USD).
Whether this is the default price for the variant.
Subscription interval: month or year. Absent for one-time purchases.
Trial period (e.g. one_week, one_month).
price
LinearPrice | VolumePrice
required
Pricing configuration. Linear has a flat unitPrice. Volume has tiers with firstUnit, lastUnit, and unitPrice.
Images and videos attached to this variant.
What the customer receives after purchase.
Unique deliverable identifier.
file_download, api_key, discord_access, shippable, or custom.
Type-specific configuration.
Next steps
- Cart. Add products to the cart and manage line items
- Products concepts. Understand the product data model and pricing