
Modern preferences layer built on AndroidX DataStore, enabling minimal boilerplate, type-safe autogenerated preference accessors from serializable models, reactive flows, and single-file configuration.
Prefero is a modern, type-safe preferences library for Kotlin Multiplatform, built on top of AndroidX DataStore.
// build.gradle.kts
dependencies {
implementation("dev.teogor.prefero:prefero-core:1.0.0-alpha02")
ksp("dev.teogor.prefero:prefero-processor:1.0.0-alpha02")
}Simply annotate your @Serializable data class. Prefero handles the rest.
@PreferoSchema
@Serializable
data class AppSettings(
val theme: String = "light",
@Encrypted val apiToken: String = ""
)Prefero generates type-safe accessors, mapping your data class to DataStore keys automatically.
// Generated accessors
val settings = AppSettingsStore(dataStore)
// Reactive read
val currentTheme = settings.themeFlow.first()
// Type-safe write
settings.setTheme("dark")@Encrypted support using AES-GCM (Tink on Android, CryptoKit on iOS).Preferences.Key and Flow mapping logic for you.CompositionLocal and preview-friendly fakes.Explore our structured guides for production setups:
@Encrypted, @Clamp, @Debounce, etc.Prefero is released under the MIT License.
Made with ♥ by @teogor
Prefero is a modern, type-safe preferences library for Kotlin Multiplatform, built on top of AndroidX DataStore.
// build.gradle.kts
dependencies {
implementation("dev.teogor.prefero:prefero-core:1.0.0-alpha02")
ksp("dev.teogor.prefero:prefero-processor:1.0.0-alpha02")
}Simply annotate your @Serializable data class. Prefero handles the rest.
@PreferoSchema
@Serializable
data class AppSettings(
val theme: String = "light",
@Encrypted val apiToken: String = ""
)Prefero generates type-safe accessors, mapping your data class to DataStore keys automatically.
// Generated accessors
val settings = AppSettingsStore(dataStore)
// Reactive read
val currentTheme = settings.themeFlow.first()
// Type-safe write
settings.setTheme("dark")@Encrypted support using AES-GCM (Tink on Android, CryptoKit on iOS).Preferences.Key and Flow mapping logic for you.CompositionLocal and preview-friendly fakes.Explore our structured guides for production setups:
@Encrypted, @Clamp, @Debounce, etc.Prefero is released under the MIT License.
Made with ♥ by @teogor