Skip to content
Custom element allows to subscribe for Gatsby preview functionality
JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Kentico Kontent Gatsby Preview Custom Element

Gatsby preview custom element is watching content changes. When the change is performed it sends the notification to the GatsbyJs and notify editor that the preview environment is ready to be previewed.

Gatsby preview custom element


If you want to use the Gatsby preview custom element in your project in Kentico Kontent, follow these steps:

  • In Kentico Kontent open Content types tab
  • Open / create a content model to which you want to add the Gatsby preview custom element
  • Add Custom element content element
  • Open configuration of the content element
  • Use following URL as Hosted code URL (HTTPS):
  • Provide the following JSON parameters for the custom element to connect it to the appropriate elements
    "previewApiKey": "<YOUR PREVIEW API KEY>",
    "previewUrlPattern": "https://gatby-test-kc-preview/{lang}/{urlslug}",
    "urlSlugElement": "url_pattern",
    "gatsbyWebHookUrl": "<GUID>"


Gatsby preview custom element is in repository:

If you want to adjust the implementation, first download Kentico Kontent Custom Elements Devkit. This repository should be positioned within /client/custom-elements folder. For further instructions on devkit implementation, please refer to Custom Element Devkit README.

Get started

You could use following commands to set up the development environment


  • Node.js
  • git
git clone
cd custom-element-devkit
git clone ./client/custom-elements/gatsby-preview-custom-element
npm install --save lodash.debounce
npm start -- -hw

Browse: https://localhost:3000/custom-elements/gatsby-preview-custom-element


Thanks to Martin Hejtmánek and his Preview availability custom element

You can’t perform that action at this time.