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(options?: BaseRequestOptions): Promise<TagsListResponse>

Retrieves the complete list of tags available on the site. Returns all tags (no pagination). Cached for 5 minutes per locale.

Parameter

Type

Description

options

BaseRequestOptions

Request options; use locale to fetch localized tag names

Returns: Promise<TagsListResponse>

TypeScript
const { data } = await lynkow.tags.list()
data.forEach(tag => console.log(tag.name)) // "Featured", "Tutorial", etc.