sdk.products namespace provides both direct methods and a chainable query builder for retrieving products. All product listing methods are public and do not require authentication.
Query Builder
The SDK provides a Firebase/Supabase-style query builder for intuitive product filtering:where fields and operators:
| Field | Operators | Example |
|---|---|---|
featured | = | .where('featured', '=', true) |
category | = | .where('category', '=', 'electronics') |
price | >=, <= | .where('price', '>=', 100) |
| Method | Description |
|---|---|
.where(field, operator, value) | Add a filter condition |
.orderBy(field, direction) | Sort results ('asc' or 'desc') |
.limit(count) | Limit the number of results |
.get() | Execute the query and return Product[] |
Direct Methods
products.getAll(params?)
Get a paginated list of products with optional filtering.
| Field | Type | Description |
|---|---|---|
page | number | Page number (default: 1) |
per_page | number | Items per page (default: 12) |
search | string | Search query |
category | string | Filter by category slug |
sort | string | Sort order (e.g., price_asc, price_desc, created_at_desc) |
{ data: Product[]; pagination?: Pagination }
products.getBySlug(slug)
Get a single product by its URL slug.
Product
products.getById(id)
Get a single product by its numeric ID.
Product
products.search(query, options?)
Search products by keyword with optional filters.
| Field | Type | Description |
|---|---|---|
query | string | Search keyword |
category | string | Filter by category slug |
price_min | number | Minimum price filter |
price_max | number | Maximum price filter |
per_page | number | Results per page |
{ data: Product[]; pagination?: Pagination }
products.getFeatured(limit?)
Get featured products.
| Field | Type | Default | Description |
|---|---|---|---|
limit | number | 8 | Maximum number of products to return |
Product[]
products.getRelated(productId, limit?)
Get products related to a specific product.
Product[]
products.getReviews(productId, params?)
Get reviews for a specific product.
{ data: Review[]; pagination?: Pagination }
Categories
Thesdk.categories namespace provides methods for browsing categories and their products:

