All notable changes to this project are documented below.
The format is based on keep a changelog and this project uses semantic versioning.
- Update dependencies across all packages.
- Nakama: Fixed JWT decoding.
- Satori: Fixed JWT decoding.
- Nakama: Added ability to invoke
listFriendsOfFriends
on the client which returns a list of friends of the user's friends. - Nakama: Added a
rank_count
toLeaderboardRecordList
. - Nakama: Added ability to invoke
listSubscriptions
on the client which lists all the user's validated subscriptions. - Nakama: Added ability to invoke
getSubscription
on the client which gets a subscription by product ID. - Nakama: Added ability to invoke
deleteAccount
on the client which deletes the user's account. - Nakama: Added ability to invoke
validatePurchaseFacebookInstant
on the client which validates a FB Instant IAP receipt. - Nakama: Added ability to invoke
deleteTournamentRecord
on the client which deletes a tournament record. - Nakama: Added ability to invoke
validateSubscriptionApple
andvalidateSubscriptionGoogle
on the client which validates Apple and Google subscription receipts. - Nakama: Added
cursor
parameter tolistTournamentRecordsAroundOwner
andlistLeaderboardRecordsAroundOwner
. - Nakama: Added
authoritative
field toTournament
. - Nakama: Added ability to specify whether to
persist
purchases and subscriptions when validating their receipts. - Nakama: Added
create_time
andupdate_time
toApiStorageObjectAck
. - Nakama: Added
refund_time
,update_time
anduser_id
toApiValidatedPurchase
.
- Nakama: Changed
StreamId.descriptor
toStreamId.subcontext
.
- Satori: Added ability to schedule, update and delete outgoing messages for Live Events.
- Satori: Added ability to add custom and default properties for a user at the point of authentication.
- Satori: Add 'recompute' param to Satori's update-properties.
- Satori: Added ability to delete identity.
- Nakama: Added ability to create match by name.
- Nakama: Improves how outgoing messages are logged in verbose mode.
- Nakama: Updated signature for Authenticate Game Center.
- Nakama: Fixed typings distribution location for protobuf-js.
- Nakama: Fixed how newer bundlers (such as those used by ViteJs) discover Nakama's type definitions.
- Satori: Return live event ID when getting all live events.
- You can now pass a
onheartbeattimeout
to the socket which will be called directly when a heartbeat timeout occurs. It will also still callondisconnect
once the socket is closed (which can take a few seconds for some browsers).
- Fixed a NodeJS compatibility issue by no longer depending on
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 withsetHeartbeatTimeoutMs(ms : number) : void
. -
You can now pass a
connectTimeoutMs
to the socketconnect
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.
- Fixed dispatching of
onpartyclose
.
- Nakama and Satori ESM module files now correctly end in the
.mjs
extension.
- Added Satori client package (
satori-js
)
- Remove Yarn in favour of NPM and updates dependencies to support Node 18 LTS
- This release is a republish of 2.4.0 but with the
cjs
distribution provided.
- Added more details comments and documentation on objects and methods.
- Changed data structure used to pass session variables to authentication methods. The old structure used was a
Map<string, string>
. We now use theRecord<string, string>
for serialization support. - Changed
StreamData.stream_presence
toStreamData.sender
. This field should be populated correctly now. - Changed
MatchData.presences
to a singularMatchData.presence
. This presence represents the sender. This field should be populated correctly now. - Match and party data payloads are now serialized as protobuf when using the protobuf adapter.
- Because of this change,
sendMatchState
andsendPartyData
can now receive bytes as input. If bytes are sent using the default text adapter, they are base64 encoded to a string.- These functions can no longer receive data payloads of type
any
. Any object previously passed in must be serialized to a string or bytes. This change is enforced at compile time.
- These functions can no longer receive data payloads of type
- Also due to this change,
MatchData
andPartyData
have theirdata
fields typed as aUint8Array
. This breaks backwards compatibility. Users who send a string as their match or party data will need to use a utility such asTextDecoder
to deserialize the string. This change is enforced at compile time.
- Because of this change,
- Fixed an issue with our base64 dependency in React Native.
- Fixed 401 Unauthorized Responses from the server in response to
rpcHttpKey
.
-
Changed parameter list optionals and sequencing in
rpcHttpKey
.- The signature is now listed as follows:
rpcHttpKey(httpKey: string, id: string, input?: object);
- The signature is now listed as follows:
-
Renamed
ApiOverrideOperator
toApiOperator
. -
Query params are now formatted with snake case rather than camel case internally by client.
- Added purchase validation for Apple, Google and Huawei.
- Added an
ApiOverrideOperator
to leaderboard writes. - Added ability to logout of a session with
sessionLogout
. - Added realtime party support.
- Added ability to import steam friends through
importSteamFriends
.
- Removes the deprecated generalist
socket.Send
function for sending data. Use the other exported Socket methods such assocket.addMatchmaker
for better type checking. - Changed the return type from
socket.addMatchmaker
to aMatchmakerTicket
rather than aMatchmakerMatched
. - Changed signature of
authenticateSteam
andlinkSteam
to allow for async
option. - Upgraded ts-proto dependency and shipped type definitions with the protobuf adapter.
- Sessions that are close to expiration will now be automatically refreshed. You can configure this behavior
via the
autoRefreshSession
parameter in theClient
constructor and theexpiredTimespanMs
expiration buffer value on the client. - Removed
session
parameter fromrpcGet
and renamed it torpcHttpKey
. This function should be used with an http key rather than a session.
- 401 Unauthorized errors while renewing sessions.
- Fixed cacheable cursor parsing in
ChannelMessageList
.
- Added a cachable cursor to
ChannelMessageList
.
- Fixed issue where rollup.js was not bundling in js-base64 library to UMD distribution.
- Added React Native integration example to packages/ folder. The example builds for iOS and Android.
- More tests for group chat, social profile ids.
- Fixed base64 imports for React Native
- Rollup not finding tslib due to Yarn workspace inconsistency.
- Authenticate methods now properly accept "create" and "username" parameters for email, Gamecenter, device, and Steam methods.
- Base64 library to base64-js (for Typescript support.)
- Added Webpack and Create React App integration examples to packages/ folder.
- Canonical import examples no longer reference a single exported object.
- Moved tests to their own workspace and upgraded Jest dependencies.
- Fixed browser imports by removing the browser IIFE distribution entry in package.json. The IIFE distribution is still available in the repository but is no longer chosen as an option by bundlers following conventional package.json load entries.
- Paths to distribution files in package.json
- Support for Session Vars.
- Added interface for Session object.
- Support for Tournaments.
- Support for events.
- Update to support features through Nakama 2.14.0
- Implemented base64 encoder and decoder for unicode characters
- Added support for protocol buffer payloads via Web Sockets.
- Added support for Facebook Instant Game Authentication.
- Added support for Apple authentication.
- Simplified the way callback IDs are generated. (Thanks @dimon4eg).
- Small improvements to TypeScript typings. (Thanks @Blaizer).
- Updated minimum TypeScript language to 3.5 version. (Thanks @Blaizer).
- Migrated test suite to Typescript
- Migrated build system to esbuild
- Update rollup.js which is still used for Cocos support.
- Updated Yarn version to 2.0
- Signatures for all Client.ts methods have been flattened to take primitives rather than composite objects.
- Typo fix in Match interface to use Presences.
- Add missing MatchmakerUser typescript interface definition.
- Authentication functions no longer check for session tokens.
- Fix for Cocos Creator support that allows the setting of XmlHttpRequest.withCredentials to be bypassed if the property does not have a setter.
- Internal type-checking for the generated client methods.
- Authenticate functions for Steam and Game Center.
- Usernames can be passed into account create with register.
- New browser headless test suite with Puppeteer.
- All source code now written in TypeScript.
- Rewrite client and socket model for Nakama 2.0.
- Re-structure project for wider browser compatibility.
- Use a polyfill for window.fetch support.
- Fix bug in MatchDataSendRequest message.
- Add support for Leaderboards.
- Matchmaking and multiplayer support.
- Build system now bundles a Base64 codec.
- Use Base64 library to enhance React Native compatibility.
- Initial public release.