Sports You Watch Headless Functions

Headless function setuparrow-up-right


Fetch a Sports You Watch matchup

getMatchup(matchupId, onResult)

Retrieve the current details for a Lucra matchup id (sports or games).

  • Parameters

    • matchupId: Lucra matchup identifier.

    • onResult: callback receiving a GetMatchupResult.

  • Results

    • GetMatchupResult.Success — includes the full matchup payload (participants, stakes, current status).

    • GetMatchupResult.Failure — wraps a GameInteractions.FailedRetrieveMatchup detailing whether the error was location related or a general API issue.

  • Usage

LucraClient().getMatchup(matchupId = "syw-2024-001") { result ->
    when (result) {
        is GetMatchupResult.Success -> {
            Log.d("Lucra SDK", "Fetched matchup: ${result.matchup.id}")
        }
        is GetMatchupResult.Failure -> {
            Log.w("Lucra SDK", "Failed to load matchup: ${result.failure}")
        }
    }
}

Handle both branches to gracefully surface errors (for example, blocked locations) to your users.

Last updated