Painless by design.

Kodein-DI · v7.33 · MIT Licensed

A multiplatform dependency injection framework for Kotlin. No code generation, no reflection magic, just simple and highly readable code.

Painless Kotlin dependency injection.

kosi-libs/Kodein
Quick start →
Multiplatform

One framework for every Kotlin target, from Android to server and native.

No code generation

Bindings are declared in plain Kotlin. Nothing is generated behind your back.

Modular and open

Organize bindings into modules, free to use anywhere under the MIT license.

Documentation

Everything you need to learn Kodein-DI.

The full documentation, from your first binding to advanced multi-binding patterns and framework integrations.

Part 01 · The library

Core

Bindings, modules and inheritance, injection and retrieval, multi-binding, external sources and advanced usage.

KotlinMultiplatform

8Docs

Read →
Part 02 · Integrations

Frameworks

Integration guides for Android, Compose, Ktor and TornadoFX, written for real applications.

AndroidKtor

4Docs

Read →
Part 03 · Upgrades

Migration

Upgrade guides from version 4 to 5, from 6 to 7, and from JSR-330 to Kodein-DI.

GuidesUpgrades

3Docs

Read →

Kotlin Multiplatform

Built for Kotlin Multiplatform.

Kodein-DI runs wherever Kotlin runs. Write your bindings once in common code and use them on every platform your project targets.

JVM

Desktop and server

Android

Mobile apps

iOS

Apple platforms

JavaScript

Web and Node

Native

Kotlin/Native targets

One framework, every Kotlin target.

Open source

Simple code. No code generation.

Declare your bindings in plain Kotlin, import modules where you need them, and let Kodein-DI wire everything together at runtime.

Kodein on GitHub