JS SDK v1.136.0

➕

Added

Profile: getStats() now includes voting, the profile's Player of the Match and poll voting stats. It works for your own profile and for getById().

const { voting } = await sdk.profile.getById("PROFILE_ID").getStats();

console.log(voting.potm.total); // 40, points from Player of the Match votes
console.log(voting.poll.voteCount); // 35
console.log(voting.poll.points); // 80

voting.poll.breakdown.forEach((entity) => {
  console.log(entity.entityId, entity.voteCount, entity.points, entity.model?.name);
});
  • voting.potm.total is the points earned from Player of the Match votes. The stats have no Player of the Match vote count.
  • voting.poll has the poll points, the voteCount and a breakdown by the entities the polls were tagged with. Each breakdown entry has entityId, entityType, entitySource, voteCount, points and model.
  • For football competitions, teams and players, entityId follows your idSchema and model is the competition, team or player. Other tags keep their id and have a null model.
  • The breakdown may cover fewer votes than voteCount, and can be empty.
  • voting is null when the API returns no voting stats for the profile.
  • New models: VotingStats, PotmVotingStats, PollVotingStats and PollVotingBreakdown.

A competition or team that appears in the success rates, the predictions breakdown and the poll breakdown is requested from the Football API only once.

Fixed

Football models: When the Football API did not return one of the requested competitions, teams, players or matches, the SDK could attach models to the wrong entities. Models are now matched by id. An entity the API does not return has no model and keeps its native id, and the rest get their own. This affects every method that adds football models, such as getStats(), showFullInterests(), voting, predictions, mini-games and loyalty badges.

  • Profile: getStats() no longer fails when the Football API request for the success rates and predictions models fails. Those entities keep their native ids and have no model.
  • Loading match models now takes one request to the Football API instead of two when a match is missing.