Cloudflare Workers
As part of Webhooks, it is possible to integrate with various systems.
Cloudflare Workers allow you to make use of Cloudflare’s Edge Network to distribute your normal JavaScript-based functions.
Rule fields
Copied!
- URL
- The URL of your Cloudflare Worker
- Custom headers
- Optionally allows you to provide a set of headers that will be included in all HTTP POST requests. You must use format
"XCustom-Header-1:value1"
for each header you add - Source
- Choose which of
channel.message
,channel.presence
,channel.lifecycle
, orchannel.occupancy
events on channels should activate this event rule. - Request Mode
- This will either be in
Single Request
mode orBatch Request
mode. Single Request will send each event separately to the endpoint specified by the rule. Batch Request will send events triggered concurrently in the same request - Channel filter
- An optional filter on channel name, to restrict the channels the rule applies to. Use a regular expression to match multiple channels.
- Encoding
- The encoding to be used by this rule. This can be either JSON or MsgPack
If the rule is in the Single Request mode, it will also have the following options:
- Enveloped
- If the rule has the Enveloped option set, then data delivered by this rule will be wrapped in an Ably envelope. Otherwise, the rule will send the raw payload
If the rule is in the Batch Request mode, it will have the following additional options:
- Sign with key
- Ably will optionally sign the data with the specified private key. This will be included as an HTTP header
X-Ably-Signature
in every HTTP post request issued to your server. See webhook security for more details.