Custom Function Creation Methods

This guide walks through several ways to create custom functions.

You will need:

  • Access to Custom Functions in the Admin Dashboard
  • A single-tenant Sombra gateway
  • Credentials for anything your function calls, ready to paste in as environment variables

There are three ways to add a new custom function: from the Integrations UI (recommended for DSR functions), the Custom Functions UI, and remotely from your repo.


From Integrations

Note: This path is for creating DSR custom functions. If you are creating a non-DSR related custom function, syncing inbound to preference store, for example, use the instructions for creating from Custom Functions UI or remote.

  • Navigate to Add Integrations
  • Search for "Custom Function" integration, and select.
Custom Functions - Add from Integrations
  • On the modal, select a title, owner, and Sombra. Note: Custom Functions are only available for customers with Single Tenant Sombra and click Add
Custom Function - Add from Integrations - Modal
  • On the Integration you have created, click "Create custom function". This will open the Custom Function Editor.
Custom Function - create from Integration Detail Page
  • Write your function, including a name and description, test it, then select Publish to make the version active. To keep working without going live, select Save draft.
  • In the Admin Dashboard, go to Custom Functions and select New function.
  • In Create a custom function, choose General or DSR, then continue. DSR functions have dedicated tests for pre-flight enrichers and processing. General functions can be used for other purposes, such as custom inbound Preference Store syncs.
  • For a DSR function, use Connect a system to add the data system in Integrations. The function is saved as a draft first; you can return and link the system from the System field.
  • In the editor, fill in Details (name, description, owners) and write your code. Environment variables and secrets are set in Environment Variables. Run a successful test, then select Publish to make the version active. To keep working without going live, select Save draft.

Write your custom functions in your own environment for the best experience.

  • Under Developer Settings > API Keys, Generate an API key and add the scope "Manage Custom Functions". You do not need to generate an API key for different integrations.
  • Add the CLI to your repo or CI - see GitHub repo for detailed instructions.
Custom Functions - Create API Key with Custom Function Scopes