Show examples in:
    Create build trigger

    Body Parameters

    name  Required  string  Example: "Production"

    Name of the environment

    adapter  Required  string  Example: "netlify"

    The deploy adapter

    indexing_enabled  Required  boolean  Example: true

    Enable scraper on the site

    frontend_url  Required  string, null  Example: "https://www.mywebsite.com/"

    Public url of the site

    adapter_settings  Required  object  Example: {"trigger_url":"https://api.netlify.com/build_hooks/XXX","site_id":"XXX","branch":"master"}

    Additional configuration for deploy

    autotrigger_on_scheduled_publications  Required  boolean  Example: true

    Deploy on scheduled publication

    webhook_token  Optional  string  Example: "xA1239ajsk123"

    Unique token of the webhook

    Returns

    Returns a build_trigger resource object.

    Examples

    Example Basic example
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const buildTrigger = await client.buildTriggers.create({
    name: 'Production',
    adapter: 'netlify',
    indexing_enabled: true,
    frontend_url: 'https://www.mywebsite.com/',
    adapter_settings: {
    trigger_url: 'https://api.netlify.com/build_hooks/XXX',
    site_id: 'XXX',
    branch: 'master'
    },
    autotrigger_on_scheduled_publications: true
    });
    console.log(buildTrigger);
    }
    run();