Tournament Headless Functions

Lucra Headless setup

Use these headless APIs to list, fetch, and join tournaments without showing Lucra UI. Requires LucraSDK.init and a configured user.

const tournaments = await LucraSDK.getRecomendedTournaments({
  includeClosed: true,
  limit: 50,
});

Example response:

[
  {
    "id": "tournament-1",
    "title": "Weekend Pool",
    "type": "POOL",
    "fee": 5,
    "buyInAmount": 5,
    "description": "Win by placing in the top 10",
    "participants": [
      { "id": "user-1", "username": "alice", "place": 1, "rewardValue": 20 },
      { "id": "user-2", "username": "bob", "place": 2, "rewardValue": 10 }
    ],
    "status": "OPEN",
    "metadata": null,
    "iconUrl": "https://...",
    "expiresAt": "2024-01-01T00:00:00Z",
    "potTotal": 100
  }
]

Parameters:

  • includeClosed (boolean): Include completed tournaments.

  • limit (number): Max number of tournaments.

Returns: Promise<PoolTournament[]>

Errors that can be thrown:

  • apiError — Network/server failure.

  • locationError — Geo restriction or location permission issue.

  • insufficientFunds — User balance too low for entry fees.

  • notAllowed — User not permitted (suspended/restricted).

  • notInitialized — SDK/user session not ready.

  • unverified — Identity verification required.

  • missingDemographicInformation — Required profile fields missing.

  • unknown / unknownError — Unclassified native SDK failure.

Get Tournament Matchup

Parameters:

  • tournamentId (string): Tournament ID to fetch.

Returns: Promise<PoolTournament>

Errors that can be thrown:

  • apiError

  • locationError

  • insufficientFunds

  • notAllowed

  • notInitialized

  • unverified

  • missingDemographicInformation

  • unknown / unknownError

Example response:

Join Tournament

Parameters:

  • tournamentId (string): Tournament ID to join.

Returns: Promise<void>

Error handling example

Types

Event: Tournament Joined

Usage examples

Join with demographic prompt fallback

Launch demographic form directly

Check user demographics before calling join

Last updated