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
clearCache(): voidInvalidate 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
lynkow.tags.clearCache()list
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 |
|---|---|---|
|
| Pagination filters: |
|
| Request options; use |
Returns: Promise<TagsListResponse>
// 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))
}