fetchTags
The fetchPages function is useful when you want to retrieve all your tags from outside the React context (where you could use the useTagsPublic hook instead).
In particular, this comes in handy to retrieve all the tags during the build process of a static website.
Signature
Section titled “Signature”const fetchTags = async ( apiKey: string, page: number = 1, pageSize: number = 100): Promise<{ items: string[] pagination: { page: number pageSize: number totalItems: number totalPages: number }}>Usage example
Section titled “Usage example”import { fetchTags } from 'react-bricks/frontend'import config from '../react-bricks/config'
const paginatedTags = await fetchTags(config.apiKey)