Content Sources

Technical reference for working with one or more content sources.

Content sources are configured through the contentSources property.

Defining Content Sources

All content sources are now configured using the contentSourcesproperties.

When possible, Netlify Create infers the content schema from the source through each source's module. That schema can then be extended using the modelExtensions property.

The exception to this is Git CMS, which requires that you define the content schema when configuring the source.

contentSources

Define one or more content sources that your project is using.

Required
Yes
Allowed Values
An array of instantiated JavaScript classes. See below for details.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
import { ContentfulContentSource } from '@stackbit/cms-contentful'

export default {
  contentSources: [
    new ContentfulContentSource({
      spaceId: process.env.CONTENTFUL_SPACE_ID,
      environment: process.env.CONTENTFUL_ENVIRONMENT,
      previewToken: process.env.CONTENTFUL_PREVIEW_TOKEN,
      accessToken: process.env.CONTENTFUL_MANAGEMENT_TOKEN,
    }),
  ],
  modelExtensions: {
    // page definitions, field extensions, etc ...
  },
}
  • Each content source has its own module with a unique set of properties. See the following integration guides for more information about working with that source:
  • For most sources, this property must be paired with the modelExtensions property to tell Netlify Create which models represent your pages.