If you click Connect you'll get a popup where you can connect do DatoCMS:
If it's a project starter you'll be all set by Gatsby Cloud. Otherwise you'll need to pick a project from DatoCMS, then it will set up all the necessary webhooks and confirm:
And now you are good to go, whenever you'll create/update/delete a record a preview build will be triggered. Otherwise when you publish/unpublish a record a live build will be triggered.
The hooks will be triggered also on assets upload and model changes.
If you go for the manual integration, you only need to create two webhooks, one for previews and one for full builds.
Start by collecting the webhook URLs from the site settings of your Gatsby cloud project:
Create a webhook in DatoCMS using the preview URL and you should add three triggers:
on record create/update/delete
on asset create/update/delete
on model create/update/delete
As a custom payload you should add this:
{"event_type": "{{event_type}}","entity_id": "{{#entity}}{{id}}{{/entity}}","entity_type": "{{entity_type}}"}
Create a webhook in DatoCMS using the build URL and you should add three triggers:
on record publish/unpublish
on asset create/update/delete
on model create/update/delete
As a custom payload you should add this:
{"event_type": "{{event_type}}","entity_id": "{{#entity}}{{id}}{{/entity}}","entity_type": "{{entity_type}}"}