Preflight Check: Custom Function
Custom Functions can be used to set up Identity Enrichment for DSRs.
Before getting started, you'll need to setup a Custom Function integration. Follow the steps described in our Creating a Custom Function guide.
Once your Custom Function is set up, add a function called enricher
to the Custom Function. The parameters available to the enricher
function are identical to the standard default function
, except for the payload
which will have the same shape as the Request Body sent during preflight check webhooks.
export async function enricher({ environment, payload, sdk, }: CustomFunction.Argument): Promise<void> { console.log('Hello world!'); // Respond to Transcend with enriched identifiers. await sdk.fetch('/v1/enrich-identifiers', { method: 'POST', headers: { Authorization: `Bearer ${environment.TRANSCEND_PLATFORM_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ enrichedIdentifiers: { googleAnalyticsInternalId: [ { value: 'SOME-GOOGLE-ANALYTICS-ID', }, ], gpadvid: [ { value: 'b20f48d8-9f50-447a-a446-1d398a9f9b1b', }, ], }, }), }); }
You will need to issue an API key to use as a Bearer token with your Custom Function similar to one you would use to respond a preflight check if you were deploying your own server webhook. This API key must have the Manage Request Identity Verification
scope, or greater.
The same Custom Function instance can be used to run both preflight checks, and DSR workflows. The enricher
function is called during preflight checks, and the default function
during a DSR workflow. If your Custom Function is configured to only respond to preflight checks, you may omit the default function
and vice versa.
The "Testing" tab for Custom Functions does not yet support testing preflight checks at this time.
Finally, to complete setup of the Custom Function Enricher, navigate to the Identifiers page in the Admin Dashboard, and scroll down to "Preflight & Identity Enrichment". Select the "+" button to create a new preflight check.

Select the "Run a Custom Function" type. You'll be prompted to select a Custom Function integration - please ensure that the Custom Function integration is connected before this stage, to proceed with the identifier mapping. From here you can configure the input identifiers provided to your function for enrichment, and the output identifiers to expect from your function. You can optionally specific data subjects, or dependencies for your new enricher.
