Documentation

LeaderboardsApi

Import

Import

  • const { LeaderboardsApi } = require("@unity-services/leaderboards-2.0");

Constructors

Constructor

Methods

Add Leaderboard Player Score

  • Add score for the specified player to the specified leaderboard.

    summary

    Add Player Score

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project's Project ID

    • leaderboardId: string

      ID of the leaderboard

    • playerId: string

      ID of the player

    • Optional addLeaderboardScore: AddLeaderboardScore
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardEntryWithUpdatedTime, any>>

Get Leaderboard Player Score

  • getLeaderboardPlayerScore(projectId: string, leaderboardId: string, playerId: string, includeMetadata?: boolean, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardEntryWithUpdatedTime, any>>
  • Get score and rank for the specified player in the specified leaderboard.

    summary

    Get Player Score

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • playerId: string

      ID of the player

    • Optional includeMetadata: boolean
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardEntryWithUpdatedTime, any>>

Get Leaderboard Scores

  • getLeaderboardScores(projectId: string, leaderboardId: string, includeMetadata?: boolean, offset?: number, limit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardScoresPage, any>>
  • Get list of scores and ranks for the specified leaderboard, with specified pagination.

    summary

    Get Scores

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • Optional includeMetadata: boolean
    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardScoresPage, any>>

Get Leaderboard Scores By Player Ids

  • Get list of scores and ranks for the specified leaderboard, with specified playerIds.

    summary

    Get Scores By PlayerIds

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • Optional includeMetadata: boolean
    • Optional leaderboardPlayerIds: LeaderboardPlayerIds
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardScoresWithNotFoundPlayerIds, any>>

Get Leaderboard Scores By Player Ids Archive Version

  • getLeaderboardScoresByPlayerIdsArchiveVersion(projectId: string, leaderboardId: string, versionId: string, includeMetadata?: boolean, leaderboardPlayerIds?: LeaderboardPlayerIds, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardVersionScoresByPlayerIds, any>>
  • Get list of scores and ranks for an archived leaderboard, with specified playerIds.

    summary

    Get Scores By PlayerIds for Archived Leaderboard

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • Optional includeMetadata: boolean
    • Optional leaderboardPlayerIds: LeaderboardPlayerIds
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardVersionScoresByPlayerIds, any>>

Get Leaderboard Scores By Tier

  • getLeaderboardScoresByTier(projectId: string, leaderboardId: string, tierId: string, includeMetadata?: boolean, offset?: number, limit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardTierScoresPage, any>>
  • Get list of scores and ranks for the specified leaderboard, within the specified tier, with specified pagination.

    summary

    Get Scores By Tier

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • tierId: string

      ID of the leaderboard tier.

    • Optional includeMetadata: boolean
    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardTierScoresPage, any>>

Get Leaderboard Scores Player Range

  • getLeaderboardScoresPlayerRange(projectId: string, leaderboardId: string, playerId: string, includeMetadata?: boolean, rangeLimit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardScores, any>>
  • Get the list of neighbouring players for the specified player Id.

    summary

    Get Player Range

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • playerId: string

      ID of the player

    • Optional includeMetadata: boolean
    • Optional rangeLimit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardScores, any>>

Get Leaderboard Version Player Score

  • getLeaderboardVersionPlayerScore(projectId: string, leaderboardId: string, versionId: string, playerId: string, includeMetadata?: boolean, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardVersionEntry, any>>
  • Get score and rank for the specified player in the specified archived leaderboard version.

    summary

    Get Archived Version Player Score

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • playerId: string

      ID of the player

    • Optional includeMetadata: boolean
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardVersionEntry, any>>

Get Leaderboard Version Scores

  • getLeaderboardVersionScores(projectId: string, leaderboardId: string, versionId: string, includeMetadata?: boolean, offset?: number, limit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardVersionScoresPage, any>>
  • Get list of scores and ranks for the specified archived leaderboard version, with specified pagination.

    summary

    Get Archived Version Scores

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • Optional includeMetadata: boolean
    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardVersionScoresPage, any>>

Get Leaderboard Version Scores By Tier

  • getLeaderboardVersionScoresByTier(projectId: string, leaderboardId: string, versionId: string, tierId: string, includeMetadata?: boolean, offset?: number, limit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardVersionTierScoresPage, any>>
  • Get list of scores and ranks for the specified archived leaderboard version, within the specified tier, with specified pagination.

    summary

    Get Archived Version Scores By Tier

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • tierId: string

      ID of the leaderboard tier.

    • Optional includeMetadata: boolean
    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardVersionTierScoresPage, any>>

Get Leaderboard Version Scores Player Range

  • getLeaderboardVersionScoresPlayerRange(projectId: string, leaderboardId: string, versionId: string, playerId: string, includeMetadata?: boolean, rangeLimit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardVersionRange, any>>
  • Get the list of neighbouring players for the specified player Id for an archived Leaderboard.

    summary

    Get Player Range for Archived Leaderboard

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • playerId: string

      ID of the player

    • Optional includeMetadata: boolean
    • Optional rangeLimit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardVersionRange, any>>

Get Leaderboard Versions

  • getLeaderboardVersions(projectId: string, leaderboardId: string, limit?: number, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<LeaderboardVersions, any>>
  • Get list of archived leaderboard versions for the specified leaderboard, with specified pagination.

    summary

    Get Archived Versions

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • Optional limit: number
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<LeaderboardVersions, any>>