Skip to main content

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

NameDescription
getAllGet all pieces of a content for a particular type.
getContentGet a piece of content by type and context. Allows the CMS to tell you what content should go given a particular handle, locale, etc.
getContentByIdFetch a piece of content by ID.
getLayoutContentGet content that is shared by the root layout such as navigation and footer.
normalizeNormalize a raw piece of content from the CMS.

Configuration

Environment Variables

Set these variables in your environment configuration:

  • CMS_PROVIDER=<vendor name>