SYW Headless Functions

Lucra Headless setup

Use the generic matchup fetcher to retrieve Sports matchups without displaying UI.

Get Matchup

const matchup = await LucraSDK.getMatchup('MATCHUP_ID');

Parameters:

  • matchupId (string): Lucra matchup identifier.

Returns: MatchupInfo

Example response:

{
  "id": "matchup-id",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z",
  "creatorId": "user-123",
  "status": "OPEN",
  "subtype": "SPORTS",
  "type": "SPORTS",
  "isPublic": true,
  "winningGroupId": null,
  "creator": {
    "id": "user-123",
    "username": "alice",
    "avatarUrl": null,
    "socialConnectionId": null,
    "loyaltyPoints": 0
  },
  "participantGroups": [
    {
      "id": "team-a",
      "createdAt": "2024-01-01T00:00:00Z",
      "outcome": "UNKNOWN",
      "participants": [
        {
          "wager": 5,
          "user": {
            "id": "user-123",
            "username": "alice",
            "avatarUrl": null,
            "socialConnectionId": null,
            "loyaltyPoints": 0
          },
          "reward": null,
          "tournamentLeaderboard": null
        }
      ],
      "professionalPlayerStatDetails": null,
      "professionalTeamStatDetails": null,
      "recreationalGameStatDetails": null
    }
  ]
}

Last updated