Like Jitsu? Give us a star on ⭐ GitHub!

πŸ“œ Configuration

Configuration UI

πŸ‘©β€πŸ”¬ Extending Jitsu

Overview
Destination Extensions
Source Extensions
API Specs

Jitsu Internals

WebHook

Jitsu supports any HTTP destinations. WebHook destination can send configurable HTTP requests based on input JS/API event objects. For instance WebHook destination can send notifications about important conversion events to Slack or another notification channel. URL and Body might be configured JavaScript functions. It allows enriching HTTP request with data from JS/API events.

WebHook destination supports only stream mode.

Filtering events

For filtering events stream to prevent sending all events to WebHook table_name_template is used. For more information see Table Names and Filters.

Configuration

WebHook destination config consists of the following schema:

destinations:
  my_webhook:
    type: webhook
    mode: stream
    webhook:
      url: https://my_domain.com/notification #or `https://my_domain.com/${_.event_type}/notification`
      method: POST
      body: |-
             {
               "user": _.user?.email,
               "time": _._timestamp,
               "conversion_id": _.conversion.id
             }
      headers:
        authorization: <my_authorization_token>
        content-type: application/json
    data_layout:
      table_name_template: '$.event_type' #Optional. It is used for filtering events.

WebHook Configuration Parameters

ParameterDescription
url (required)HTTP URL. Can be a string constant or JavaScript function
methodHTTP method. Optional. Default value is: GET
bodyHTTP request JSON body. Can be a JSON constant or JavaScript function returning Object
headersHTTP headers Map. All HTTP requests will be enriched with configured HTTP headers.

Slack Example

WebHook destination will send only conversion events with constructed body to Slack:

destinations:
  slack_conversion_webhook:
    type: webhook
    mode: stream
    webhook:
      url: https://hooks.slack.com/services/T1DBYWPEWA/A2184KHBDSA/d2ONDSao431bF
      method: POST
      body: |-
        {
          "blocks": [
            {
              "type": "section",
              "text": {
                "type": "mrkdwn",
                "text": `User ${_.user?.email} has created order #${_.conversion.order_id}: ${_.conversion.price} ${_.conversion.currency}!`
              }
            }
          ]
        }
      headers:
        content-type: application/json
    data_layout:
      table_name_template: '_.event_type == "conversion" && _.event_type' #Consumes only conversions