Skip to main content
This functionality is only available in Flipt v2 Pro. Learn more about our commercial license or purchase a monthly or annual license.
This guide connects your Git provider to Flipt’s incoming webhook endpoint. After setup, a push or merge to a tracked branch triggers a Git fetch without waiting for the next poll.

Prerequisites

  • A running Flipt v2 server with an active Pro or trial license and webhook support.
  • An environment configured with Git sync and SCM integration.
  • Permission to manage webhooks or service hooks for your Git repository.
  • An HTTPS URL for Flipt that your Git provider can reach.

1. Create a webhook secret

Generate a random secret with OpenSSL:
Store the result securely. Set FLIPT_WEBHOOK_SECRET to this value in the environment of the Flipt server process. You also need this value when you configure your Git provider. Use a separate value from the access token that Flipt uses to read and write your repository.

2. Configure Flipt

Add the webhook block to your existing environment’s scm configuration. This example uses the production environment and GitHub:
Keep your existing storage identifier and SCM credentials. For another provider, use its SCM type. You can also use a secret reference instead of an environment variable. Restart your Flipt server with the updated configuration. Make sure that FLIPT_WEBHOOK_SECRET is available to the server process. Flipt refuses to start if the webhook secret resolves to an empty value. The webhook endpoint for this example is https://flipt.example.com/api/v2/webhooks/production. Replace flipt.example.com with your Flipt host. The final path segment must match the environment’s configured name, which defaults to its YAML key. If your existing environment sets name: Production, use /api/v2/webhooks/Production, with the same capitalization.

3. Configure your Git provider

Use the endpoint URL from the previous step and the same secret that you configured in Flipt. Keep TLS certificate verification enabled.
  1. Open your repository’s Settings > Webhooks and select Add webhook.
  2. Set Payload URL to your Flipt webhook endpoint.
  3. Set Content type to application/json.
  4. Set Secret to your webhook secret.
  5. Select Just the push event and keep Active selected.
  6. Select Add webhook.
GitHub sends a ping event after creation. Flipt returns 200 OK for an authenticated ping without fetching the repository.See GitHub’s webhook documentation for details.

4. Test synchronization

Make a flag change in your Git repository and push it to the branch that Flipt tracks. You can also merge a pull request or merge request that changes a flag on that branch. Open your provider’s webhook delivery history and inspect the push delivery. A matching push returns 202 Accepted. Make sure that the changed flag state appears in Flipt. A 200 OK response means that Flipt authenticated the delivery but did not schedule a fetch. Provider test buttons can send pings, unrelated events, or a branch that Flipt does not track. Use a real push to test synchronization.
Keep poll_interval configured as a fallback. In a deployment with multiple replicas, a webhook updates the instance that receives it. Deliver to each replica for prompt updates across the deployment. A load balancer that sends each request to one replica does not broadcast the update to the others.

Troubleshooting

For payload limits, authentication headers, and all response codes, see the webhook reference.