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.

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: 14 Jul 2020


Get started with Segment

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