Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tybritelabs.com/llms.txt

Use this file to discover all available pages before exploring further.

The CmsService class (accessed via client.cms) provides access to content-driven features like blog posts and lookbooks, allowing you to build rich discovery experiences and content-led commerce.

Blog Posts

listPosts

Retrieve a paginated list of blog posts. This is ideal for building a “News” or “Magazine” section on your storefront.
const { posts, pagination } = await client.cms.listPosts({
  status: 'published',
  category: 'summer-trends',
  limit: 10,
  fields: 'id,title,slug,excerpt,featured_image'
});

posts.forEach(post => {
  console.log(`${post.title} - Published on ${post.published_at}`);
});
Post Metadata: The listing response includes light metadata like excerpt, featured_image, and slug. For the full content, use getPost.

getPost

Retrieve the full content and tags for a specific blog post.
const post = await client.cms.getPost({
  slug: 'sustainable-fashion-trends',
  fields: 'title,content,author_name,published_at' // Optional
});

// Accessing localized HTML content
console.log(post.content); 

Lookbooks

Lookbooks are curated collections of lifestyle images linked to specific products, perfect for “Shop the Look” features.

listLookbooks

Retrieve a list of available lookbooks.
const { lookbooks, pagination } = await client.cms.listLookbooks({
  status: 'published',
  limit: 12,
  fields: 'id,title,slug,featured_image'
});

getLookbook

Retrieve the full details of a lookbook, including its image gallery and linked products.
const lookbook = await client.cms.getLookbook({
  slug: 'autumn-collection-2025',
  fields: 'title,description,images,collection_id' // Optional
});

// The 'products' array contains full Product models,
// making it easy to render "Shop the Look" cards immediately.
lookbook.products.forEach(product => {
  console.log(`Includes: ${product.name}`);
});

Pro Discovery Tip: Use Lookbooks to increase Average Order Value (AOV) by encouraging customers to buy entire outfits or coordinated room sets featured in lifestyle photography.

Response Codes

All CMS endpoints are GET and accept both publishable and secret keys. Slug validation is enforced — empty or whitespace-only slugs return 400 without hitting the database.
CodeMeaning
200Success.
400Empty slug, invalid slug format, or malformed query parameters.
401Invalid or missing API key.
404Post or lookbook not found.
429Rate limit exceeded.
500Internal server error.