How to run Gatsby preview feature with Kentico Kontent - makma/gatsby-starter-kontent GitHub Wiki

  1. Fork gatsby-starter-kontent repository and switch to "preview-functionality" branch.
  2. Create a new project in https://app.kontent.ai/.
  3. Go to Kontent Template Manager and import our sample project 479c94ca-8760-00f5-6b07-15d19b791204 into your project. This project contains a registered Gatsby preview functionality on Speaking engagement content type.
  4. Get projectId and preview Delviery API key of this project and us it in gatsby-config.js in deliveryClientConfig section in format like:
deliveryClientConfig: {
  projectId: '<Project Id>',
  globalQueryConfig: {
    usePreviewMode: true,
  },
  previewApiKey: '<Preview Api Key>',
  typeResolvers: []
},
  1. Go to https://www.gatsbyjs.com/dashboard/sites, create a new site, click I already have a Gatsby site, Add a new organization - select your organization and newly created repository, switch to preview-functionality branch, Install Gatsby Cloud, copy POST endpoint URL and save changes. Create site.

  2. Go to Kontent to your project to Content Types > Speaking engagement and edit Gatsby preview custom element. Use your preview API key and copied gatsby webhook URL. Save changes.

⚠️ **GitHub.com Fallback** ⚠️