0.12.8 • Published 11 months ago

@thehive/cms-content-api v0.12.8

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

The Hive CMS: Content API

.github/workflows/tests.yml npm NPM npm

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.12.7

12 months ago

0.12.8

11 months ago

0.12.0

1 year ago

0.12.1

1 year ago

0.12.2

1 year ago

0.12.3

1 year ago

0.12.4

1 year ago

0.12.5

1 year ago

0.12.6

1 year ago

0.11.0

1 year ago

0.11.1

1 year ago

0.11.2

1 year ago

0.11.3

1 year ago

0.11.4

1 year ago

0.10.0

1 year ago

0.9.1

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.7.0

1 year ago

0.6.11

1 year ago

0.5.11

1 year ago

0.5.10

1 year ago

0.5.9

1 year ago

0.5.8

1 year ago

0.5.7

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago