KTokenStore
Abstraction over token persistence.
Kindling provides three built-in implementations:
KSharedPrefsTokenStore — plain SharedPreferences (default, not encrypted)
KEncryptedTokenStore — EncryptedSharedPreferences (recommended for production)
KDataStoreTokenStore — Jetpack DataStore
KInMemoryTokenStore — in-memory only (tests / mock)
Implement this interface to plug in any other storage backend (Room, SQLCipher, system Keychain, etc.).
All methods are suspend — implementations may perform I/O safely.
Usage with KSessionManager:
val session = KSessionManager(
store = KEncryptedTokenStore(context) // swap freely
)Content copied to clipboard