---
title: "Profile Provider"
canonical_url: "https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/profile"
markdown_url: "https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/profile.md"
last_updated: "2026-04-16T10:19:11Z"
---

# Profile Provider

The `ProfileProvider` is a service component responsible for managing and providing user profile-related data within the Virtual Stadium Data SDK.

***

## Overview

The `ProfileProvider` handles all user profile operations and exposes profile data through observable state flows.

### Primary Functions

**Fetching User Data**

Retrieves detailed information about a user, such as their profile details, based on a user ID.

**Providing User Avatar URL**

Supplies the URL of the user's avatar image for display purposes.

**Fetching Shared Bets**

Retrieves the bets shared by a specific user with pagination support.

***

## Profile Implementation

Access profile data through the `ProfileProvider` by injecting it via dependency injection.

The `profileState` flow exposes current profile data and updates automatically.

### Available Methods

- **getUserAvatarUrl()** - Get avatar URL for a user
- **getUserData()** - Fetch detailed user profile
- **getUsersSharedBets()** - Get user's shared bets (first page)
- **getPreviousUsersSharedBets()** - Load additional shared bets (pagination)

**Android**

```kotlin
import ag.sportradar.virtualstadium.datasdk.services.ProfileProvider
import androidx.lifecycle.ViewModel
import org.koin.core.component.KoinComponent
import org.koin.core.component.get

class ProfileViewModel :
    ViewModel(),
    KoinComponent {

    private val profileProvider: ProfileProvider
        get() = get()

    val profileState = profileProvider.profileState

    fun getUserAvatar(userId: String): String = 
        profileProvider.getUserAvatarUrl(userId)

    fun getUserData(userId: String) {
        profileProvider.getUserData(userId)
    }

    fun getSharedBets(userId: String) {
        profileProvider.getUsersSharedBets(userId)
    }

    fun getPreviousSharedBets(userId: String) {
        profileProvider.getPreviousUsersSharedBets(userId)
    }
}
```

**iOS**

```swift
import VirtualStadiumDataSDK

class ExampleProfileViewModel: ObservableObject {

    private var profileProvider = KoinHelper().getProfileProvider()
    @Published var profileState: ProfileState?

    init() {
        subscribeToProfileState()
    }

    private func subscribeToProfileState() {
        profileProvider.profileState.subscribe { [weak self] profileState in
            self?.profileState = profileState
        }
    }

    func getUserAvatar(userId: String) -> String {
        profileProvider.getUserAvatarUrl(userId: userId)
    }

    func getUserData(userId: String) {
        profileProvider.getUserData(userId: userId)
    }

    func getUserSharedBets(userId: String) {
        profileProvider.getUsersSharedBets(userId: userId, pageSize: nil)
    }

    func getPreviousUserSharedBets(userId: String) {
        profileProvider.getPreviousUsersSharedBets(userId: userId, pageSize: nil)
    }
}
```
