JavaScript client for Nakama server written in TypeScript.
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
.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
.satori-js
)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.Changed parameter list optionals and sequencing in rpcHttpKey
.
rpcHttpKey(httpKey: string, id: string, input?: object);
Renamed ApiOverrideOperator
to ApiOperator
.
Query params are now formatted with snake case rather than camel case internally by client.
rpcHttpKey
.