0.10.0 • Published 5 days ago
@thehive/cms-content-api v0.10.0
The Hive CMS: Content API
First, install the package:
npm install @thehive/cms-content-api
Create an instance:
import { CmsContentApi } from '@thehive/cms-content-api'
const contentApi = new CmsContentApi({
apiKey: process.env.THE_HIVE_CMS_API_KEY,
organization: 'my-org',
space: 'my-space',
environment: 'main'
})
Use the client to request content:
// Content
contentApi.content.getPage<MyContentResult>(
'type',
{ pageNumber: 0, pageSize: 10 }
)
contentApi.content.getById<MyContentResult>('type', entryId)
contentApi.content.getByUniqueField<MyContentResult>('type', 'field', value)
// Posts
contentApi.posts.getPage({
pageNumber: 1, pageSize: 10, postType: 'news'
})
contentApi.posts.getById(postId)
contentApi.posts.getBySlug(slug)
contentApi.posts.view(postId)
// Tags
contentApi.tags.getPage(pagination)
contentApi.tags.getBySlug('tag')
0.10.0
5 days ago
0.9.1
6 days ago
0.9.0
12 days ago
0.8.0
14 days ago
0.7.0
30 days ago
0.6.11
2 months ago
0.5.11
2 months ago
0.5.10
3 months ago
0.5.9
3 months ago
0.5.8
3 months ago
0.5.7
3 months ago
0.5.6
3 months ago
0.5.5
4 months ago
0.5.4
4 months ago
0.5.3
4 months ago
0.5.0
4 months ago
0.5.2
4 months ago
0.5.1
4 months ago
0.4.2
4 months ago
0.4.1
5 months ago
0.4.0
5 months ago
0.3.0
5 months ago
0.2.0
5 months ago
0.1.1
5 months ago
0.1.0
5 months ago