SAP Engagement Cloud SDK
The SAP Engagement Cloud SDK is the next-generation SDK for SAP Engagement Cloud, providing a unified API for managing events, push notifications, in-app messaging, and more across Android, iOS, and Web. Designed for integration consistency and ease of use, it enables straightforward onboarding and fast time-to-value across all platforms.
The SAP Engagement Cloud SDK is currently available in a pilot release for a select group of clients. To participate, contact your client success manager. See Joining the Pilot Program for next steps.
Quick Start
- Join the pilot program and complete the onboarding steps.
- Install dependencies (Gradle / SPM / NPM / script).
- Initialize the SDK (automatic on all platforms).
- Enable tracking after the user has given consent.
- Identify the contact (optional, upon login).
- Register push token (automatic on most platforms).
- Start tracking events.
Feature Matrix
| Feature | Android | iOS | Web |
|---|---|---|---|
| Custom Events | ✅ | ✅ | ✅ |
| Push Notifications | ✅ (FCM/HMS) | ✅ (APNs) | ✅ (Service Worker) |
| In-App Messaging | ✅ | ✅ | N/A |
| Deep Link Tracking | ✅ | ✅ | ✅ |
| OpenID Auth Contact | ✅ | ✅ | ✅ |
| Notification Channels | ✅ | N/A | N/A |
| Embedded Messaging | ✅ | ✅ | ✅ |
Architecture Overview
Public API -> Domain Modules -> Orchestration/State -> Networking -> Database -> Platform Adapters
See Architecture Overview for details.
Migration Guide
If you're migrating from the SAP Emarsys SDK, see the Migration Overview and API Mapping.
Common Code Examples
- Android
- Kotlin Multiplatform
- iOS
- Web
Enable the SDK and send a custom event:
EngagementCloud.setup.enable(
config = AndroidEngagementCloudSDKConfig("APP_CODE", launchActivityClass = MainActivity::class.java),
onContactLinkingFailed = {
// Example: Prompt user to log in and retrieve their contact identifier
val loggedInUser = showLoginDialogAndAwaitResult()
loggedInUser?.let { LinkContactData(contactFieldValue = it.userId) }
}
)
EngagementCloud.event.track(CustomEvent("screen_view", mapOf("screen" to "home")))
Enable the SDK and send a custom event:
EngagementCloud.setup.enable(
config = SdkConfig("APP_CODE"),
onContactLinkingFailed = {
// Example: Prompt user to log in and retrieve their contact identifier
val loggedInUser = showLoginDialogAndAwaitResult()
loggedInUser?.let { LinkContactData(contactFieldValue = it.userId) }
}
)
EngagementCloud.event.track(CustomEvent("screen_view", mapOf("screen" to "home")))
Enable the SDK and send a custom event:
try? await EngagementCloud.shared.setup.enable(
config: EngagementCloudConfig(applicationCode: "APP_CODE"),
onContactLinkingFailed: { onSuccess, onError in
Task {
guard let loggedInUser = await showLoginDialogAndAwaitResult() else { return }
onSuccess(LinkContactDataContactFieldValueData(contactFieldValue: loggedInUser.userId))
}
}
)
Enable the SDK and send a custom event:
await window.EngagementCloud.setup.enable(
{ applicationCode: "APP_CODE" },
async () => {
// Example: Prompt user to log in and retrieve their contact identifier
const loggedInUser = await showLoginDialogAndAwaitResult();
if (!loggedInUser) return null;
return { contactFieldValue: loggedInUser.userId };
}
);
Getting Help
See the FAQ or Troubleshooting.