Installing Dependencies
- Android
- Kotlin Multiplatform
- iOS
- Web
The SDK is available on Maven Central. Add the following dependency to your build.gradle.kts file:
dependencies {
implementation("com.sap.engagement-cloud:engagement-cloud-sdk-android:<latest-version>")
}
Add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
The minimum supported SDK level is API level 28 (Android 9.0 Pie). The SDK supports the single-activity architecture recommended by Android. For correct in-app behavior, MainActivity should extend FragmentActivity or AppCompatActivity.
The SDK ships with consumer ProGuard rules bundled in the AAR. When you enable minification (isMinifyEnabled = true) in your release build, the necessary keep rules apply automatically.
Additional steps needed for push integration
If you want to use the SDK's push notification features, add the selected provider's dependencies as well:
dependencies {
implementation("com.sap.engagement-cloud:engagement-cloud-sdk-android-fcm:<latest-version>")
implementation("com.sap.engagement-cloud:engagement-cloud-sdk-android-hms:<latest-version>")
}
And add the following permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
The KMP SDK is available on Maven Central. Add the following dependency to your build.gradle.kts file:
dependencies {
implementation("com.sap.engagement-cloud:engagement-cloud-sdk:<latest-version>")
}
The KMP artifact does not have the -android suffix. Use engagement-cloud-sdk for multiplatform projects and engagement-cloud-sdk-android for Android-only projects.
The KMP SDK ships with consumer ProGuard rules bundled in the AAR. No manual ProGuard configuration is required for Android targets.
Add the SDK using Swift Package Manager (SPM). In your Package.swift:
dependencies: [
.package(url: "https://github.com/emartech/engagement-cloud-sdk.git", from: "4.0.0")
]
Then, import the SDK in your Swift code:
import EngagementCloudSDK
The SAP Engagement Cloud SDK supports the last 2 major versions of iOS.
Script
The SDK scripts are hosted at:
https://emartech.github.io/engagement-cloud-sdk/<latest-version>/engagement-cloud-sdk-loader.js
https://emartech.github.io/engagement-cloud-sdk/<latest-version>/ec-service-worker.js
Replace <latest-version> with an exact version like 4.0.0 or latest.
- engagement-cloud-sdk-loader.js — Downloads and initializes the SDK. Any API calls or tracked events like push clicks that occur during initialization are queued and processed once the SDK is ready.
- ec-service-worker.js (optional) — Service worker required for web push.
Download the scripts and serve them from your own domain for first-party tracking.
<script src="<path>/engagement-cloud-sdk-loader.js"></script>
Replace <path> with your local directory path for the downloaded script.
The loader registers window.EngagementCloud, making the API available globally.
NPM
The SDK is available on NPM:
npm install @sap/engagement-cloud-sdk
Then import the SDK:
import { EngagementCloud } from "@sap/engagement-cloud-sdk";
The package also exports data classes for type safety. Import them alongside the SDK.