Overview
Comprehensive documentation for the @tentocms/client TypeScript SDK.
Documentation Structure
Main Documentation
- Generated API Reference - Canonical, always-in-sync API surface (every class, method, option & type). Generated from the SDK source with TypeDoc and kept fresh by CI — start here for exact signatures and return types.
- Public Documentation Hub - Top-level index for the REST API reference, admin guides, and framework integration docs.
Framework-Specific Guides
- Nuxt 3/4 Integration - Complete guide for Nuxt applications
- Next.js Integration - App Router and Pages Router guides
- Astro Integration - Static and SSR implementation guides
Type Generation Guides
Type generation is a separate package, @tentocms/typegen, documented under
Typegen — it generates the interfaces this client consumes.
What's Included
Framework Guides
Nuxt Integration (nuxt.md)
- Server-side-only setup (
server/utils/tento.ts) — deliberately not a universal plugin, since one would run client-side and crash on the private API key - Server-side data fetching with
useFetch/useAsyncDataagainst thinserver/api/cms/*routes - Preview mode implementation
- Reusable composables (
useTentoPage,useTentoCollection,useTentoPagePreview) - Type-safe content patterns
- Error handling and SSG configuration
- Best practices and caching strategies
Next.js Integration (nextjs.md)
- App Router implementation (recommended)
- Pages Router implementation (legacy)
- Static page generation with
generateStaticParams - Preview mode with Draft Mode API
- Dynamic routes and collections
- Time-based and on-demand revalidation
- TypeScript patterns
- ISR (Incremental Static Regeneration)
- Error handling with typed errors
Astro Integration (astro.md)
- Static site generation
- Dynamic routes with
getStaticPaths - Preview mode with on-demand (server) rendering
- Blog posts with categories and tags
- Component-based architecture
- Image optimization with Astro Image
- Pagination implementation
- SSR mode configuration
- Content Collections integration
Preview Mode Documentation
All framework guides include complete preview mode implementation:
Key Concepts Covered
- Getting Preview Keys - Admin UI walkthrough
- Configuration - Environment variables and client setup
- Preview Routes - Dedicated routes for draft content
- Security - Secret validation and cookie handling
- Visual Indicators - Preview banners and exit buttons
- Best Practices - Protecting routes, environment separation
Preview Mode Behavior
- Pages: Returns
draft_content(orpublished_contentfallback) - Collections: Returns
draft_content(orpublished_contentfallback) - Blog Posts: Includes all statuses (draft + published)
Documentation Tests
The @tentocms/client SDK examples (quick start, preview mode, collections/blog/media, error handling, pagination/filtering) are validated by an automated test suite so they compile against the current SDK surface. The framework-integration guides (Nuxt/Next.js/Astro) and typegen guides are verified by hand against the current APIs, not by that suite.
Test File: tests/docs-examples.test.ts (25 tests) — SDK-client examples only
Coverage Includes:
- ✅ Quick start examples
- ✅ Preview mode patterns
- ✅ TypeScript usage
- ✅ Error handling
- ✅ Collections API
- ✅ Blog API
- ✅ Media transformations
- ✅ Advanced usage (custom fetch, timeouts, base URL)
- ✅ Pagination patterns
- ✅ Filtering examples
Run Tests:
pnpm test docs-examples
Documentation Format
All documentation is written in Markdown format, making it:
- ✅ Ready for nuxt/content integration
- ✅ Easy to version control
- ✅ Simple to read on GitHub
- ✅ Compatible with static site generators
- ✅ Searchable and accessible
Contributing to Docs
When updating documentation:
- Update Code Examples - Ensure all examples are current
- Run Tests - Verify examples compile:
pnpm test docs-examples - Update Multiple Locations - Keep framework guides in sync with SDK reference
- Add Tests - Add tests for new examples in
tests/docs-examples.test.ts - Check Links - Verify all internal links work
- Review Formatting - Ensure consistent markdown formatting
Resources
- Generated API Reference:
./reference/README.md - SDK Package:
@tentocms/client(published on npm —pnpm add @tentocms/client; see the framework guides)
License
MIT

