---
title: "Epsilon DataStore"
canonical_url: "https://apidocs.sportradar.com/resources/epsilon-sdk/docs/modules/datastore"
markdown_url: "https://apidocs.sportradar.com/resources/epsilon-sdk/docs/modules/datastore.md"
last_updated: "2026-06-15T10:09:12Z"
---

# Epsilon DataStore

The `epsilon-datastore` module provides a multiplatform persistent key-value storage solution built on top of [Jetpack DataStore](https://developer.android.com/topic/libraries/architecture/datastore).

> **Note**
>
> This module is useful when shared code needs a consistent persistence abstraction across supported platforms.

## Features

- **Multiplatform Persistence**: Store data consistently across Android, iOS, and JVM.
- **Type-Safe Storage**: Use `StoreKey` to define keys and expected value types.
- **Coroutine-Based API**: Asynchronous data access using Kotlin Coroutines and Flow.
- **Cache Provider**: High-level abstraction for caching data with expiration.

## Supported Platforms

- Android
- iOS
- JVM

## Key Components

### DataStoreProvider

The main class for interacting with the underlying DataStore. It allows you to save, retrieve, and delete values.

**Example usage**

```kotlin
val dataStoreProvider = DataStoreProvider(
    fileName = "my_datastore",
    context = ...,
)
enum class MyStoreKey: StoreKey {
    USER_NAME,
}
dataStoreProvider.putString(MyStoreKey.USER_NAME, "John Doe")
val name: String? = dataStoreProvider.getString(MyStoreKey.USER_NAME)
```

### CacheProvider

A specialized provider that handles data caching, including logic for checking if cached data is still valid or has expired.

## Usage

Add the dependency to your `commonMain`:

```kotlin
dependencies {
    implementation("ag.sportradar.mobile.epsilon:epsilon-datastore:<version>")
}
```

### Platform Setup

Each platform requires a specific way to initialize the DataStore.
Epsilon wraps this into the DataStoreProvider constructor and presents a unified way of instantiating the DataStore.
