API Module

The API layer will require the Frontend SDK as well as likely integrating several API calls on your backend to set and fetch data to and from the Lucra system at appropriate times. View the API Integration document for more information.

initialize(options)

Bootstraps the Lucra native SDK with the host app’s keys, environment flags, and configuration metadata.

Parameters

  • options: object – SDK configuration payload (keys, environment, feature flags, etc.).

Returns

  • Promise<void>

await NativeLucraClient.initialize({
  sdkKey: '...',
  environment: '...',
  enableDebugLogs: true,
});

present(params)

Presents the Lucra UI flow (screen, experience, or modal) defined by the supplied params.

Parameters

  • params: object – Describes the Lucra flow to show (flow identifiers, initial state, etc.).

Returns

  • Promise<void>

closeFullScreenLucraFlows()

Requests native to dismiss any active full-screen Lucra experiences.

Parameters

  • None.

Returns

  • Promise<void>

configureUser(user)

Stores the Lucra user’s profile plus auth tokens on the native side so subsequent calls run as that user.

Parameters

  • user: object – Lucra user metadata (identifiers, profile fields, auth tokens, etc.).

Returns

  • Promise<void>

logout()

Clears native user state and removes associated credentials.

Parameters

  • None.

Returns

  • Promise<void>

getUser()

Retrieves the currently configured Lucra user payload, if available.

Parameters

  • None.

Returns

  • Promise<object> – Resolves with the user payload or null.

getMatchup(matchupId)

Fetches matchup details from Lucra APIs by ID.

Parameters

  • matchupId: string – Identifier of the matchup to load.

Returns

  • Promise<object>

createRecreationalGame(gameTypeId, atStake, playStyle)

Creates a recreational game for the given type, stake, and play style, returning the new matchup ID.

Parameters

  • gameTypeId: string – Game type identifier.

  • atStake: object – Wager descriptor (currency, amount, etc.).

  • playStyle: string – Play style such as versus or freeForAll.

Returns

  • Promise<{ matchupId: string }>

acceptVersusRecreationalGame(matchupId, teamId)

Accepts a versus-style recreational matchup on behalf of a specific team.

Parameters

  • matchupId: string

  • teamId: string

Returns

  • Promise<void>

acceptFreeForAllRecreationalGame(matchupId)

Accepts an invitation to a free-for-all recreational game.

Parameters

  • matchupId: string

Returns

  • Promise<void>

cancelGamesMatchup(matchupId)

Cancels an in-progress games matchup.

Parameters

  • matchupId: string

Returns

  • Promise<void>

getRecommendedTournaments(params)

Returns recommended pool tournaments based on the provided filter params.

Parameters

  • params: object – Filter and sorting metadata per Lucra pool tournament schema.

Returns

  • Promise<object[]>

tournamentMatchup(tournamentId)

Loads summary data for a specific tournament matchup.

Parameters

  • tournamentId: string

Returns

  • Promise<object>

joinTournament(tournamentId)

Enrolls the current user in the specified tournament.

Parameters

  • tournamentId: string

Returns

  • Promise<void>

addListener(eventType)

Registers a native-to-JS bridge listener for the specified event type.

Parameters

  • eventType: string

Returns

  • void

removeListeners(count)

Removes the given number of previously registered listeners.

Parameters

  • count: number

Returns

  • void

Sends a deep link string to native so it can attempt to handle the link.

Parameters

  • deepLink: string

Returns

  • void

emitCreditConversion(creditConversion)

Pushes a credit conversion payload down to native logic.

Parameters

  • creditConversion: object – Conversion payload details.

Returns

  • void

Asks native if it can handle a Lucra link; resolves to true if consumed.

Parameters

  • link: string

Returns

  • Promise<boolean>

registerDeviceTokenHex(token)

Registers a push notification device token encoded as hex.

Parameters

  • token: string

Returns

  • Promise<void>

registerDeviceTokenBase64(token)

Registers a base64-encoded push device token.

Parameters

  • token: string

Returns

  • Promise<void>

registerConvertToCreditProvider()

Notifies native that JS will supply convert-to-credit actions/results.

Parameters

  • None.

Returns

  • void

registerRewardProvider()

Notifies native that JS will handle reward retrieval flows.

Parameters

  • None.

Returns

  • void

emitAvailableRewards(rewards)

Sends the current list of rewards back to native consumers.

Parameters

  • rewards: object[] – Array of reward descriptors.

Returns

  • void

Last updated