Reads the flat labels attached to blog articles, available as lynkow.tags.
With cache: true, responses are cached for 5 minutes.
Access via: lynkow.tags
Methods
2 methods
clearCache
clearCache(): voidClears every cached tag response held by the client. Call it when a tag.* webhook arrives
so the next read fetches fresh data.
Returns: void
lynkow.tags.clearCache()list
list(filters?: TagsListFilters, options?: BaseRequestOptions): Promise<TagsListResponse>Fetches a page of the site's tags, sorted by name. Defaults to 20 per page, at most 100.
Without a locale, tags of every language are listed. With one, each translation group
appears once and a missing translation is served from the fallback locale
(fallback: false in options drops those). With cache: true, cached for 5 minutes. Resolves to { data, meta }.
Parameter | Type | Description |
|---|---|---|
|
|
|
|
| Request options. |
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))
}