Transformations
Write a little JavaScript, filter out the noise, or map fields to columns with no code. Your destination gets exactly the data it expects, in the format it expects.
// Runs before delivery
function transformHeaders(headers) {
headers['x-source'] = 'proxyhook'
return headers
}
function transformBody(body) {
const invoice = body.data
return {
event: body.type,
amount: invoice.amount / 100,
email: invoice.email.toLowerCase(),
}
}Benefits
Rewrite headers and bodies with plain functions that run before each delivery.
Filter events so destinations only receive the requests you care about.
Map payload fields to destination or warehouse columns from a simple form.
Normalize messy or inconsistent senders once, instead of in every downstream service.
Three ways to transform
Use them alone or together. Each runs before delivery.
A built-in editor with two functions: transformHeaders and transformBody. Both run before delivery, and whatever they return is what the destination receives.
// Runs before delivery
function transformHeaders(headers) {
headers['x-source'] = 'proxyhook'
return headers
}
function transformBody(body) {
const invoice = body.data
return {
event: body.type,
amount: invoice.amount / 100,
email: invoice.email.toLowerCase(),
}
}Decide which requests continue. Stack as many conditions as you need and the request is delivered only when they match.
Point a field in the incoming payload at a column or field on the destination. Ideal for databases and warehouses, and it needs no code.