TrackingSDKs
Java and Android SDKs
com.iforevents:iforevents for the JVM and com.iforevents:iforevents-android for apps
Java (servers, desktop)
<dependency>
<groupId>com.iforevents</groupId>
<artifactId>iforevents</artifactId>
<version>0.1.0</version>
</dependency>import com.iforevents.*;
IForeventsAPIIntegration api = new IForeventsAPIIntegration(APIConfig.builder(System.getenv("IFOREVENTS_PROJECT_KEY")).build());
Iforevents iforevents = Iforevents.builder().integration(api).build();
iforevents.init();
iforevents.identify("user_123", Map.of("email", "[email protected]", "plan", "pro"));
iforevents.track("invoice_paid", Map.of("amount", 120, "currency", "USD"));
iforevents.shutdown(); // also runs from a JVM shutdown hookJava 8, no runtime dependencies. Adapters: iforevents-mixpanel, iforevents-amplitude, iforevents-segment, iforevents-posthog (same group id).
Android (Kotlin)
implementation("com.iforevents:iforevents-android:0.1.0")
implementation("com.iforevents:iforevents-android-firebase:0.1.0") // optional
implementation("com.iforevents:iforevents-android-mixpanel:0.1.0") // optionalclass App : Application() {
override fun onCreate() {
super.onCreate()
IforeventsAndroid.init(this, "pk_...") {
integration(FirebaseIntegration(this@App))
configure = { batchSize(20) }
}
}
}
IforeventsAndroid.identify("user_123", mapOf("plan" to "pro"))
IforeventsAndroid.track("purchase_completed", mapOf("total" to 9.99))Every call runs on the SDK's worker thread. Screen views come from the activity lifecycle, the queue lives in SharedPreferences, and the app going to the background triggers a flush. The project key is safe to ship in the APK; there is no secret in the SDK.
Sources: iforevents-sdks/java, iforevents-sdks/android.