Service for retrieving content tags.

Accessible via lynkow.tags. Tags are lightweight labels attached to blog articles for cross-cutting classification (unlike categories which are hierarchical). Responses are cached for 5 minutes (SHORT TTL).

Access via: lynkow.tags

Methods

2 methods

clearCache

TypeScript
clearCache(): void

Invalidate every cached tag response (lists, tag-filtered contents). Call after an admin mutation or on receipt of a tag.* webhook so the next public request bypasses the SWR cache.

Returns: void

TypeScript
lynkow.tags.clearCache()

list

TypeScript
list(filters?: TagsListFilters, options?: BaseRequestOptions): Promise<TagsListResponse>

Retrieves a paginated list of tags available on the site.

Cached for 5 minutes per (locale + pagination) combination. The cache key splits on page and limit so adjacent pages do not collide.

Parameter

Type

Description

filters

TagsListFilters

Pagination filters: page (1-based), limit (1-100), perPage (deprecated alias)

options

BaseRequestOptions

Request options; use locale to fetch localized tag names

Returns: Promise<TagsListResponse>

TypeScript
// Default: first 20 tags.
const { data, meta } = await lynkow.tags.list()

// Page through everything.
for (let page = 1; page <= meta.lastPage; page++) {
  const { data } = await lynkow.tags.list({ page, limit: 50 })
  data.forEach(t => console.log(t.name))
}