npm.io
1.3.0 • Published 3 months ago

@cms-lab/contentful

Licence
MIT
Version
1.3.0
Deps
1
Size
8 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

@cms-lab/contentful

Contentful adapter for cms-lab.

cms: {
  provider: "contentful",
  spaceId: "my-space",
  environment: "master",
  accessToken: process.env.CONTENTFUL_DELIVERY_TOKEN!,
  contentTypes: [
    {
      type: "page",
      contentType: "page",
      uidField: "routing.slug",
      urlField: "routing.url",
    },
  ],
}

The adapter reads Contentful Content Delivery API entries, paginates with limit and skip, and normalizes them into cms-lab CMSDocument objects. Top-level localized fields are flattened to the default locale when possible so route mappings can use common fields such as doc.uid or doc.data.slug.

Use uidField or urlField when your project stores route values in custom fields. Both options read dotted paths from normalized document.data.

See the public adapter maturity matrix for current test coverage and known limits.

Release History

See the repository changelog and GitHub Releases for version-by-version notes.

Open Source

MIT licensed. See the repository license, contributing guide, and support guide.

Keywords