CMS
The High Velocity @hv/cms package exposes a vendor-agnostic interface to content.
Integration Functions
The @hv/cms package exposes the Content function for instantiating the CMS integration.
Content
The Content function provides the vendor-agnostic interface to the CMS provider. It is intended to
be used in server components or route handlers.
Example usage:
const { getContent } = Content({
  locale: 'en-US',
});
const aboutUsPage = await getContent('page', {
  handle: '/about-us',
});
Content Functions
| Name | Description | 
|---|---|
getAll | Get all pieces of a content for a particular type. | 
getContent | Get a piece of content by type and context. Allows the CMS to tell you what content should go given a particular handle, locale, etc. | 
getContentById | Fetch a piece of content by ID. | 
getLayoutContent | Get content that is shared by the root layout such as navigation and footer. | 
normalize | Normalize a raw piece of content from the CMS. | 
reflectContent | Resolves a set of vendor-specific raw-request parameters into a structured ContentReflection object. | 
Configuration
Environment Variables
Set these variables in your environment configuration:
CMS_PROVIDER=<vendor name>- Specifies what CMS vendor to use. The supported CMS vendors are:
- Contentful
 - Amplience
 - [Sanity]
 - Hygraph
 - [Builder.io]
 
 
- Specifies what CMS vendor to use. The supported CMS vendors are:
 
Reference
For full documentation on the types exposed by this package, check out the reference section: