Skip to main content

Global SDK Webhooks

note

Global SDK Webhooks are only available for self-hosted GrowthBook installations.

Global SDK Webhooks are just like SDK Webhooks, but configured via environment variables instead of the GrowthBook UI.

When any SDK Connection payloads changes in any organization, all of your Global SDK Webhooks will be triggered.

Setup

Define a WEBHOOKS environment variable as a JSON string of an array of global webhook objects.

The only required field for a global webhook is url. Here's a minimal example:

[{"url":"https://example.com"}]

There are additional fields you can specify:

  • signingKey (string) - Will be used to add a signature header that enables you to verify the webhook origin
  • method (string) - One of GET, PUT, POST, PURGE, PATCH, or DELETE. Defaults to POST if omitted
  • headers (object) - Additional headers to add to the webhook request. Useful for adding auth headers for example. Default {}.
  • payloadFormat (string) - How to format the body (ignored when method = "GET"). One of standard, standard-no-payload, sdkPayload, edgeConfig or none. Defaults to standard. Read more about the different formats in the SDK Webhooks Payload Format docs.
  • payloadKey (string) - Only used when payloadFormat is set to edgeConfig. The key in Vercel Edge Config you want to update.

Deprecated:

  • sendPayload (boolean) - Whether or not to include the full SDK Payload in the body. true maps to payloadFormat = standard; false maps to payloadFormat = standard-no-payload.

Here's a full example using all of the fields:

[{"url":"https://example.com","signingKey":"abc123","method":"PUT","headers":{"X-Custom-Header":"foo"},"payloadFormat":"sdkPayload"}]

Verify Signatures

If you define a signingKey, you can use it to verify that webhooks are coming from GrowthBook.

See: SDK Webhooks - Verify Signatures

Errors and Retries

Unlike normal SDK Webhooks, Global SDK Webhooks are NOT retried on error.

On failure, they will output container logs as well as save them to the Mongo sdkwebhooklogs collection.