Skip to content

AppOutlet/umami-kotlin

banner

Umami Kotlin

Maven Central Version Maintainability Code Coverage

An unofficial, open-source Kotlin Multiplatform library for seamless interaction with the Umami web analytics REST API.

This SDK offers a type-safe, asynchronous wrapper, enabling you to integrate Umami's privacy-centric analytics into your Kotlin applications (Android, iOS, JVM, etc.) with minimal effort.

What is Umami?

Umami is a simple, fast, and privacy-focused alternative to Google Analytics. It grants you powerful web analytics while respecting user privacy by not collecting any personal information.

✨ Key Features

  • Kotlin Multiplatform: Write your analytics logic once and deploy it across Android, iOS, JVM, and other platforms.
  • Asynchronous by Design: Built with Kotlin Coroutines for efficient, non-blocking API communication.
  • Type-Safe: Minimizes errors and ensures correctness when interacting with the Umami API.
  • Lightweight and Simple: Features a clean, intuitive API that is easy to integrate and use.

🚀 Modular Architecture

umami-kotlin is designed to be lightweight by splitting the library into two modules:

  • :umami: The core module for event tracking and client configuration. If you only need to track page views and custom events, this is the only module you need.
  • :umami-api: An optional module that provides access to the rest of the Umami API, including Authentication, Users, and Websites.

This modular approach ensures your application remains lean.

  • For event tracking only, use dev.appoutlet:umami.
  • To also use Authentication or manage Users and Websites, add a dependency on dev.appoutlet:umami-api.

📚 Documentation

This README provides a high-level overview. For a comprehensive guide, including installation instructions, detailed usage examples, and the full API reference, please visit our official documentation website.

Basic usage

// Add the dependency in your commonMain build.gradle.kts file
commonMain.dependencies {
    implementation("dev.appoutlet:umami:LATEST_VERSION")
}

// Initialize the Umami instance with your website ID
val umami = Umami("your-website-id")

// Track a custom event
fun whenSomethingHappens() {
    umami.event(url = "/screen/main", name = "app-launch")
}

🙌 How to Contribute

Contributions are highly welcome! If you have an idea for a new feature or want to help improve the SDK, please open an issue for discussion or submit a pull request on GitHub.

This library is proudly developed and maintained by AppOutlet.

📜 License

This project is licensed under the MIT License.


A Project by AppOutlet

umami-kotlin is a library developed and maintained by AppOutlet. You can explore our other projects on our website.