@heroiclabs/nakama-js
Advanced tools
Changelog
[2.8.0]
listFriendsOfFriends
on the client which returns a list of friends of the user's friends.rank_count
to LeaderboardRecordList
.listSubscriptions
on the client which lists all the user's validated subscriptions.getSubscription
on the client which gets a subscription by product ID.deleteAccount
on the client which deletes the user's account.validatePurchaseFacebookInstant
on the client which validates a FB Instant IAP receipt.deleteTournamentRecord
on the client which deletes a tournament record.validateSubscriptionApple
and validateSubscriptionGoogle
on the client which validates Apple and Google subscription receipts.cursor
parameter to listTournamentRecordsAroundOwner
and listLeaderboardRecordsAroundOwner
.authoritative
field to Tournament
.persist
purchases and subscriptions when validating their receipts.create_time
and update_time
to ApiStorageObjectAck
.refund_time
, update_time
and user_id
to ApiValidatedPurchase
.StreamId.descriptor
to StreamId.subcontext
.Changelog
[2.7.0]
Changelog
[2.6.1]
onheartbeattimeout
to the socket which will be called directly when a heartbeat timeout occurs. It will also still call ondisconnect
once the socket is closed (which can take a few seconds for some browsers).XMLHttpRequest
.Changelog
[2.6.0]
The socket will now automatically heartbeat with the server from within nakama-js
. If the server doesn't reply after a heartbeat timeout has elapsed, ondisconnect
will be called. This should resolve issues with the socket detecting lack of internet connectivity in Chrome. You can configure the heartbeat tiemout with setHeartbeatTimeoutMs(ms : number) : void
.
You can now pass a connectTimeoutMs
to the socket connect
call in order to set a connect timeout.
You can now pass a sendTimeoutMs
to the socket constructor to detect timeouts for socket calls that expect a response.
The connect, send, and heartbeat timeouts are set to sensible default values.
onpartyclose
.Changelog
[2.5.3]
.mjs
extension.Changelog
[2.4.1]
cjs
distribution provided.Changelog
[2.4.0]
Map<string, string>
. We now use the Record<string, string>
for serialization support.StreamData.stream_presence
to StreamData.sender
. This field should be populated correctly now.MatchData.presences
to a singular MatchData.presence
. This presence represents the sender. This field should be populated correctly now.sendMatchState
and sendPartyData
can now receive bytes as input. If bytes are sent using the default text adapter, they are base64 encoded to a string.
any
. Any object previously passed in must be serialized to a string or bytes. This change is enforced at compile time.MatchData
and PartyData
have their data
fields typed as a Uint8Array
. This breaks
backwards compatibility. Users who send a string as their match or party data will need to use a utility such as TextDecoder
to deserialize the string. This change is enforced at compile time.