Integrate Segment with Novu
Learn how to set up Segment as a data source for Novu using Destination Functions. Send user events from Segment to trigger notifications in Novu.
This guide demonstrates how to use Segment's Destination Functions to send user events and traits to Novu. You'll learn how to:
- Create a custom Segment destination for Novu
- Map Segment identify calls to Novu subscribers
- Trigger notification workflows from Segment track events
- Handle errors and retry logic for reliable delivery
By the end, you'll have a working integration that creates subscribers and triggers notification workflows in Novu based on Segment events.
Prerequisites
Before you start, ensure you have:
- A Segment account with access to Functions (check your workspace permissions)
- A Novu account with an API key (find this in your Novu dashboard under Settings > API Keys)
Create a Destination Function in Segment
- Log in to your Segment account
- Navigate to Connections > Functions in the left sidebar
- Click New Function and select Destination
- Name your function (e.g., Novu Destination) and click Create Function
Configure the Destination Function
The Destination Function will handle two key Segment event types:
- identify: Creates or updates a subscriber in Novu
- track: Triggers a notification workflow in Novu
Paste the following complete code into the Segment Function editor:
Customize the Mapping: Update EVENT_TO_WORKFLOW_MAPPINGS
with your Segment event names and corresponding Novu workflow names.
Deploy the Function
- Click Save in the Function editor
- Enable the function by toggling it to Active
Connect the Function to a Source
- Go to Connections > Select your Source (e.g., website, app)
- In the Destinations tab, click Add Destination
- Choose your Novu Destination Function from the list
- Click Connect. When prompted, enter your Novu API key in the apiKey field
- Save the configuration
Testing the Integration
Verify everything works:
Use Segment's Debugger to monitor function calls and catch any errors.
With this setup, your Segment events will seamlessly flow into Novu, enabling powerful notification workflows tailored to your users' actions.
Stripe
This guide walks you through integrating Stripe webhooks with Novu notifications in a Next.js application.
Trigger.dev
Learn how to integrate Novu with Trigger.dev to send notifications from background jobs. This guide covers setting up both services, managing subscribers, triggering notifications, and includes practical examples for AI content generation and video processing workflows.