Functions Overview

Functions let you create your own sources and destinations directly within your workspace to bring new types of data into Segment and send data to new tools with just a few lines of JavaScript - no additional infrastructure required.

Functions is available to all customer plan types with a free allotment of usage hours. Read more about Functions usage limits, or see your workspace’s Functions usage stats.

An image illustrating source functions and destination functions in a Segment workspace

What can you do with Functions?

Functions can help you bring external data into Segment (Source functions) and send data in Segment out to external destinations (Destination functions). Functions are scoped to your specific workspace. If you’re a technology partner and want to build a new integration and publish it in Segment’s catalog, see the Developer Center documentation.

Source functions

Source functions receive external data from a webhook and can create Segment events, objects, or both. Source functions have access to the full power of JavaScript so you can validate and transform the incoming data and even make external API requests to annotate your data.

Use cases:

  • Ingest data into Segment from a source that’s unavailable in the catalog
  • Transform or reject data before it’s received by Segment
  • Enrich incoming data using external APIs

Learn more about source functions.

Destination functions

Destination functions can take events from a Segment source, transform the events, and deliver them to external APIs. Destination functions can make arbitrary requests to annotate data, as well.

Use cases:

  • Send data from Segment to a service that’s unavailable in the catalog
  • Transform data before sending it downstream
  • Enrich outgoing data using external APIs

Learn more about destination functions.

This page was last modified: 12 Oct 2022

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
Create free account