📄️ Installation Setup
This page walks you through adding Anchor DI to your Kotlin Multiplatform project step by step. Whether you're starting a new project or adding to an existing one, follow these steps to get Anchor DI running.
📄️ KMP + Compose Multiplatform
Use Anchor DI in a Kotlin Multiplatform project with Compose Multiplatform (CMP) for UI. This page covers dependencies, initialization, and usage in Composables. If you're building UI with Compose on Android, iOS, Desktop, or Web, this setup is for you.
📄️ KMP Without Compose
Use Anchor DI in a Kotlin Multiplatform project that does not use Compose for UI — for example, SwiftUI on iOS, Views on Android, or shared logic only. This page explains what works, what's different, and what to add. You don't need anchor-di-compose; you'll use Anchor.inject() and manual scope management instead of anchorInject() and viewModelAnchor().
📄️ Multi-Module Setup
When your KMP project has multiple modules that each contribute DI bindings (e.g. feature modules, data module, domain module), you need to configure KSP so each module generates its own contributor and aggregate them at the app level. This page explains how.
📄️ Platform-Specific Setup
Anchor DI runs on Android, iOS, Desktop (JVM), and Web (Wasm). Each platform has specific setup requirements — especially iOS, where KSP generates code into target-specific directories. This page covers platform-specific configuration and where to initialize Anchor DI.