TentoCMS
Classes

Class: PagesResource

Pages resource for interacting with the TentoCMS Pages API

Pages resource for interacting with the TentoCMS Pages API

Methods

getBySlug()

Call Signature

getBySlug<TContent>(slug, options?): Promise<Page<TContent>>;

Get a single page by its slug

Type Parameters
Type ParameterDefault type
TContentRecord<string, unknown>
Parameters
ParameterTypeDescription
slugstringThe page slug
options?PageGetOptions & objectOptional query options (e.g., pageType to disambiguate shared slugs)
Returns

Promise<Page<TContent>>

The page object

Throws

If the page is not found

Example
const page = await client.pages.getBySlug('home')

// Disambiguate when multiple page types share the same slug
const landing = await client.pages.getBySlug('about', { pageType: 'landing-page' })

Call Signature

getBySlug<TContent>(slug, options): Promise<PageWithRedirect<TContent>>;

Get a single page by its slug

Type Parameters
Type ParameterDefault type
TContentRecord<string, unknown>
Parameters
ParameterTypeDescription
slugstringThe page slug
optionsPageGetOptions & objectOptional query options (e.g., pageType to disambiguate shared slugs)
Returns

Promise<PageWithRedirect<TContent>>

The page object

Throws

If the page is not found

Example
const page = await client.pages.getBySlug('home')

// Disambiguate when multiple page types share the same slug
const landing = await client.pages.getBySlug('about', { pageType: 'landing-page' })

list()

list<TContent>(options?): Promise<ListResponse<Page<TContent>>>;

List all published pages

Type Parameters

Type ParameterDefault type
TContentRecord<string, unknown>

Parameters

ParameterTypeDescription
options?PageListOptionsQuery options for filtering, pagination, and sorting

Returns

Promise<ListResponse<Page<TContent>>>

Paginated list of pages

Example

// Basic list
const result = await client.pages.list({ page: 1, limit: 10 })

// With filters
const filtered = await client.pages.list({
  page: 1,
  filters: [
    { field: 'slug', operator: 'eq', value: 'home' }
  ]
})
Copyright © 2026