---
title: "Configuration"
description: "Set the deploy hook URL and the request options your server sends with it."
canonical_url: "https://kirby.tools/docs/deploy-trigger/configuration"
---

# Configuration

> Set the deploy hook URL and the request options your server sends with it.

## Plugin Options

Both options live under `johannschopplich.deploy-trigger` in `config.php`.

### `deployUrl` <u-badge className="align-middle,ml-2,rounded-full!" label="String" variant="subtle"></u-badge>

The URL of the deploy hook. Every click sends a `POST` request to it. Required – there is no default.

```php [site/config/config.php]
return [
    'johannschopplich.deploy-trigger' => [
        'deployUrl' => 'https://api.netlify.com/build_hooks/<hook-id>'
    ]
];
```

### `requestOptions` <u-badge className="align-middle,ml-2,rounded-full!" label="Array" variant="subtle"></u-badge>

Options for Kirby's [`Remote`](https://getkirby.com/docs/reference/objects/http/remote) class. Defaults to `[]`, a `POST` without a body. The ones a deploy hook asks for most:

<table>
<thead>
  <tr>
    <th>
      Option
    </th>
    
    <th>
      Sets
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        headers
      </code>
    </td>
    
    <td>
      Request headers, such as <code>
        Authorization
      </code>
      
      , as an array of names and values
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data
      </code>
    </td>
    
    <td>
      The request body – an array is sent as form fields, a string as it is
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        agent
      </code>
    </td>
    
    <td>
      The <code>
        User-Agent
      </code>
      
       header
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        basicAuth
      </code>
    </td>
    
    <td>
      HTTP basic authentication, as <code>
        user:password
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        method
      </code>
    </td>
    
    <td>
      The HTTP method, for a hook that doesn't take <code>
        POST
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        timeout
      </code>
    </td>
    
    <td>
      Seconds to wait for the hook's response
    </td>
  </tr>
</tbody>
</table>

A hook that expects JSON gets the body through `json_encode()` and a matching `Content-Type`:

```php [site/config/config.php]
return [
    'johannschopplich.deploy-trigger' => [
        'deployUrl' => 'https://example.com/hooks/deploy',
        'requestOptions' => [
            'headers' => [
                'Authorization' => 'Bearer <token>',
                'Content-Type' => 'application/json'
            ],
            'data' => json_encode(['branch' => 'main']),
            'timeout' => 30
        ]
    ]
];
```

<callout color="info" icon="i-ri-arrow-right-line" to="/docs/helpers/environment-variables">

To keep the token out of version control as well, read it from a `.env` file in `config.php` – see **Environment Variables** in Kirby Helpers.

</callout>

---

Every page of this site as Markdown: <https://kirby.tools/sitemap.md>
