diff --git a/packages/gatsby-source-contentful/README.md b/packages/gatsby-source-contentful/README.md index 5f9b085b78e79..f8f7042795dd2 100644 --- a/packages/gatsby-source-contentful/README.md +++ b/packages/gatsby-source-contentful/README.md @@ -392,5 +392,31 @@ documentToReactComponents(node.bodyRichText.json, options) Check out the examples at [@contentful/rich-text-react-renderer](https://github.com/contentful/rich-text/tree/master/packages/rich-text-react-renderer). +## Sourcing From Multiple Contentful Spaces + +To source from multiple Contentful environments/spaces, add another configuration for `gatsby-source-contentful` in `gatsby-config.js`: + +``` +// In your gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-source-contentful`, + options: { + spaceId: `your_space_id`, + accessToken: process.env.CONTENTFUL_ACCESS_TOKEN, + }, + }, + { + resolve: `gatsby-source-contentful`, + options: { + spaceId: `your_second_space_id`, + accessToken: process.env.SECONDARY_CONTENTFUL_ACCESS_TOKEN, + }, + } + ], +} +``` + [dotenv]: https://github.com/motdotla/dotenv [envvars]: https://gatsby.dev/env-vars