Breaking change
WebhookEventData values now use unknown instead of string so webhook payloads can contain structured data such as customVariables.
Migrating from v2
Webhook values must now be narrowed or cast before use:
const webhookEvent = client.webhook.constructEvent(rawBody, signature);
const actionCode =
typeof webhookEvent.data.actionCode === "string"
? webhookEvent.data.actionCode
: undefined;
const customVariables = webhookEvent.data.customVariables as
| Record<string, unknown>
| undefined;
const journeyType =
typeof customVariables?.action_journeyType === "string"
? customVariables.action_journeyType
: undefined;Applications remaining on v2 are unaffected.
New features
- Support structured webhook values, including objects, arrays, numbers and booleans.
- Support
customVariablesin webhook events. - Add
constructLogEventBatchfor batched log events.
Bug fixes
- Improve invalid webhook payload handling and validation.
- Prevent batched log events from being parsed as single webhook events.
Full Changelog: v2.21.0...v3.0.0