Name of the environment
The deploy adapter
Enable scraper on the site
Public url of the site
Additional configuration for deploy
Deploy on scheduled publication
Unique token of the webhook
const { SiteClient } = require('datocms-client');async function run() {const client = new SiteClient('YOUR-API-TOKEN');const buildTrigger = await client.buildTrigger.create({name: 'Production',webhookToken: 'xA1239ajsk123',adapter: 'netlify',indexingEnabled: true,frontendUrl: 'https://www.mywebsite.com/',autotriggerOnScheduledPublications: true,adapterSettings: {triggerUrl: 'https://api.netlify.com/build_hooks/XXX',siteId: 'XXX',branch: 'master'}});console.log(buildTrigger);}run();
> node example.js{"id": "1822","name": "Production","adapter": "netlify","adapterSettings": {"triggerUrl": "https://api.netlify.com/build_hooks/XXX","siteId": "XXX","branch": "master"},"lastBuildCompletedAt": "2017-03-30T09:29:14.872Z","buildStatus": "success","webhookToken": "xA1239ajsk123","webhookUrl": "https://webhooks.datocoms.com/xA1239ajsk123/deploy-results","indexingStatus": "success","frontendUrl": "https://www.mywebsite.com/","autotriggerOnScheduledPublications": true,"indexingEnabled": true}