JS SDK v1.136.0
1 day ago by Viktor Yordanov
AddedProfile:
getStats()now includesvoting, the profile's Player of the Match and poll voting stats. It works for your own profile and forgetById().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.totalis the points earned from Player of the Match votes. The stats have no Player of the Match vote count.voting.pollhas the pollpoints, thevoteCountand abreakdownby the entities the polls were tagged with. Each breakdown entry hasentityId,entityType,entitySource,voteCount,pointsandmodel.- For football competitions, teams and players,
entityIdfollows youridSchemaandmodelis the competition, team or player. Other tags keep their id and have anullmodel.- The breakdown may cover fewer votes than
voteCount, and can be empty.votingisnullwhen the API returns no voting stats for the profile.- New models:
VotingStats,PotmVotingStats,PollVotingStatsandPollVotingBreakdown.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.
FixedFootball 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.
