Transformations

Shape every payload before it is delivered

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.

Transformation / transform.js
// 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(),
  }
}
Runs on every requestTest passed

Benefits

Why teams use it

Full control with JavaScript

Rewrite headers and bodies with plain functions that run before each delivery.

Send only what matters

Filter events so destinations only receive the requests you care about.

No code when you want none

Map payload fields to destination or warehouse columns from a simple form.

Fix it at the edge

Normalize messy or inconsistent senders once, instead of in every downstream service.

Three ways to transform

Pick the tool that fits the job

Use them alone or together. Each runs before delivery.

JavaScript

A built-in editor with two functions: transformHeaders and transformBody. Both run before delivery, and whatever they return is what the destination receives.

  • transformHeaders(headers) adds, removes, or rewrites headers
  • transformBody(body) reshapes the payload
  • Test against a sample payload before you save
Transformation / transform.js
// 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(),
  }
}
Runs on every requestTest passed

Filters

Decide which requests continue. Stack as many conditions as you need and the request is delivered only when they match.

  • Equals and not equal
  • Contains and does not contain
  • Greater than and less than
  • Stacked conditions for finer control
Filter / stacked conditions
Whenbody.typeequalsinvoice.paid
Andbody.amountgreater than1000
Andbody.emaildoes not contain@example.test
equalsnot equalcontainsdoes not containgreater thanless than

Field mapping

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.

  • Map nested payload fields to flat columns
  • Rename fields to match your schema
  • Works alongside filters and JavaScript
Field mapping / warehouse columns
Payload fieldColumn
data.idinvoice_id
data.amountamount_cents
data.emailcustomer_email
createdreceived_at

Ready to dive in?
Create your free account today.