Guides & Tutorials
Integrating Contentful with your Netlify site is now easier than ever
Contentful is one of the most popular services for decoupled content management. You’ll find examples of combining their managed content APIs with various different tools to populate sites and applications all over the web, including here on the Netlify blog.
At Netlify, we provide the ability to initiate a fresh deploy with what we call a build hook. Build hooks are incoming webhooks, and thanks to them, anything that can make an HTTP POST request to one of these unique unguessable URLs can trigger a deploy to publish freshly sourced content. Contentful is one such service.
Contentful can fire off webhook requests for you, and gives you control over what events in their system (such as saving, or publishing) will trigger those webhook requests.
Recently, Contentful made some great improvements to make it even easier to create and mange your webhooks. Let’s take a look.
Triggering Netlify deploys from Contentful
Contentful Apps provide integrations with many different tools and services. The Netlify app creates and configure webhooks for us, and provide a handy Deploy site button right in the Contentful authoring experience.
You can find and install the Netlify app from Contentful’s app directory.
You can review what the Netlify app can do, and then install it for your Contentful account with a couple of clicks.
Once installed, you can configure the Netlify app for your Contentful project to enable continuous deployment (by automatically creating the build hooks) for any of your Netlify sites, and decide what content types in your Contentful project you’d like to have trigger builds.
You can also configure if content, or asset changes should trigger a build when they are published and unpublished.
Not only does this create the automation for, but it also introduces a rather satisfying and helpful “Build website” button in the sidebar of your Contentful editor pages. Deploy at will!
With webhooks, events, and content available via APIs, we can combine all sorts of tools and services to create our web sites, stores and apps.