-
Notifications
You must be signed in to change notification settings - Fork 2
firebase analytics README
Firebase Analytics for Kotlin Multiplatform — true 21/21 KMP target coverage. GitLive Firebase native SDK on the 11 platforms it ships; Firebase Measurement Protocol over HTTP on the remaining 10. Single Maven coordinate, single helper interface.
- SETUP.md — Manual integration guide (per-platform setup + MP wiring + DI examples)
-
CLAUDE_AI_SETUP.md — AI-assisted setup via
/sync-firebase-analytics
// 1. Add to gradle/libs.versions.toml
[versions]
cmp-firebase-analytics = "1.0.0"
[libraries]
cmp-firebase-analytics = { module = "io.github.mobilebytelabs:cmp-firebase-analytics", version.ref = "cmp-firebase-analytics" }
// 2. Add to commonMain in build.gradle.kts
commonMain.dependencies {
implementation(libs.cmp.firebase.analytics)
}// 3. Wire in your Koin module (Firebase tier — Android/iOS/macOS/tvOS/JVM/JS)
import io.github.mobilebytelabs.kmptoolkit.analytics.AnalyticsHelper
import io.github.mobilebytelabs.kmptoolkit.analytics.di.AnalyticsModule
val analyticsModule = module {
single<AnalyticsHelper> {
AnalyticsModule.analyticsHelper(
if (BuildConfig.DEBUG) AnalyticsModule.Mode.Stub
else AnalyticsModule.Mode.Firebase
)
}
}
// 4. Use anywhere
class SettingsViewModel(private val analytics: AnalyticsHelper) {
fun onSaveClick() {
analytics.logButtonClick("save", screenName = "settings")
}
}| Module | Purpose | Targets |
|---|---|---|
cmp-firebase-analytics |
Single module — interface + Stub/NoOp/Test + GitLive Firebase impl + MP HTTP impl | 21 (full KMP) |
| Tier | Targets | Count | Backend |
|---|---|---|---|
| firebaseMain | Android · JVM · iOS (×3) · macOS (×2) · tvOS (×3) · JS | 11 | GitLive Firebase Kotlin SDK (full native: DebugView, automatic events, A/B Testing, demographics, ATT) |
| nonFirebaseMain | watchOS (×4) · Linux (×2) · mingwX64 · wasmJs · wasmWasi | 10 | Firebase Measurement Protocol via HTTP (events land in same Firebase property + same BigQuery dataset) |
Trade-offs vs native SDK on the 10 MP-only platforms documented in SETUP.md §Non-Firebase platforms.
The library bakes in no Firebase keys, no MP secrets, no project IDs. Every consuming app supplies its own:
-
google-services.json(Android) — from your Firebase Console -
GoogleService-Info.plist(iOS / macOS / tvOS) — from your Firebase Console - Firebase config object (JS) — from your Firebase Console
- MP API secret (only if targeting non-Firebase platforms) — generated at Firebase Console → GA4 → Data Streams → Measurement Protocol API secrets
Secrets stay in your app's secrets store (release-layer/.env, encrypted prefs, keychain) — never committed.
For framework users (claude-product-cycle):
/sync-firebase-analytics # Verify-gated sync into the active project
/sync-firebase-analytics --check # Dry run — show status, no writesSee CLAUDE_AI_SETUP.md for the full Gate breakdown.
** Partials**
App Intents
Bubble
Clipboard
Cookbook
- Clipboard Copy Text
- Clipboard Read Text
- Consumer Anon Key Setup
- Crashlytics Attribution Per Library
- Ifonline Block
- Index
- Index
- Index
- Index
- Open Url Compose
- Pick And Share Image
- React To Offline
- Register Firebase Hooks
- Share Pdf Android
- Share Text
- Wifi Vs Cellular
Firebase Analytics
In App Update
Intent Launcher
Inter App Comms
Modules
- Cmp App Intents
- Cmp App Intents Compose
- Cmp Bubble
- Cmp Clipboard
- Cmp Deep Link
- Cmp Firebase Analytics
- Cmp In App Update
- Cmp Intent Launcher
- Cmp Intent Launcher Compose
- Cmp Library
- Cmp Network Monitor
- Cmp Network Monitor Compose
- Cmp Observe
- Cmp Observe Koin
- Cmp Open Url
- Cmp Pdf Generator
- Cmp Product Tickets
- Cmp Remote Config
- Cmp Share
- Cmp Share Compose
- Cmp Toast
Network Monitor
Open Url
Pdf Generator
Remote Config
Share
Toast
User Tickets
General