Skip to main content

Overview

The OneSignal + Apache Kafka integration enables automatic syncing of custom events from your Kafka topics directly to OneSignal’s Custom Events API. This allows you to trigger automated Journeys and personalized messaging campaigns based on real-time user behavior streaming through your Kafka infrastructure. You can sync events like purchases, product views, subscription changes, or any custom user actions to automatically trigger onboarding sequences, re-engagement campaigns, transactional messages, and targeted promotions across push notifications, email, in-app messages, and SMS.

Requirements

Apache Kafka

  • Kafka Cluster (Apache Kafka, Confluent, or cloud-managed)
  • Topics containing event data
  • Authentication credentials (SASL/SCRAM, SSL, or API keys)
  • Network access to Kafka brokers
  • Event data in JSON format

Setup

Configure Kafka permissions

OneSignal needs to consume events from your Kafka topics. The exact setup depends on your Kafka configuration:
1

Gather connection details

Collect the following information about your Kafka cluster:
  • Bootstrap Servers: Kafka broker endpoints
  • Security Protocol: PLAINTEXT, SASL_PLAINTEXT, SASL_SSL, or SSL
  • Authentication: Username/password, certificates, or API keys
  • Topic Names: List of topics containing event data
2

Create consumer credentials

Create credentials for OneSignal to access your Kafka topics:For SASL/SCRAM authentication:
For ACL-based authorization:
3

Verify topic access

Test that OneSignal can access your event topics:

Configure OneSignal Kafka connection

1

Navigate to integrations

In OneSignal, go to Data > Integrations and click Add Integration.
2

Select Apache Kafka

Choose Apache Kafka from the list of available integrations.
3

Enter connection details

Provide your Kafka connection information:
  • Bootstrap Servers: Comma-separated broker endpoints
  • Security Protocol: Your cluster’s security configuration
  • Username/Password: SASL credentials (if applicable)
  • Topic Names: Topics containing your event data
  • Consumer Group: Unique group ID for OneSignal
4

Test the connection

Click Test Connection to verify OneSignal can connect to your Kafka cluster and consume events.

Event data mapping

Map your to OneSignal’s custom events format:

Event Data Schema

Your Kafka event messages should be in JSON format and include fields that map to OneSignal custom event structure: