Global Webhook

This event type uses Global Webhooks to get events.

Since global webhooks are configured on the global level, they are not associated with a specific connection.

Implementation of this event type routes global webhook events to the correct connection and subscription.

Methods

The following functions can be implemented for global webhook events:

Get Event Selector

  • Method key: getEventSelector
  • Supported implementation types: javascript, mapping

This method returns data that will be used to route the event to the correct connection.

Arguments:

  • parameters – object, parameters (matching parametersSchema) of this particular event.

Result:

  • globalWebhookKey – key of the global webhook defined in the connector (see [doc:connector-builder/global-webhooks])
  • globalWebhookEventSelector – string that is used to route the event to the correct subscription. This string typically needs to be generated dynamically based on the event parameters and information we can get from the current connection (using apiClient or credentials).

When a Global Webhook handles a payload and returns events,
it will be routed to a given event subscription if:

  • globalWebhookKey returned from this method matches the key of the global webhook
  • globalWebhookEventSelector returned from this method matches the event selector associated to the event returned by the handle method of the global webhook.