Skip to main content
The REST and SignalR APIs documented here are more complex than the client SDKs. Consider using the Lobby C++ SDK or Matchmaking C++ SDK instead, unless those SDKs don’t meet your needs.
The real-time messages feature for Lobby and Matchmaking services works through a SignalR service, which exposes a SignalR Hub. This SignalR Hub can be used by game clients to receive messages about resources they subscribed to.

Connecting to the SignalR Hub

The first step in receiving real-time messages is to create a SignalR client. The client can create a connection to the SignalR Hub by instantiating a HubConnection with the following API: SignalR Negotiate REST API. This API implements the Negotiate API described in the SignalR documentation.
Using MessagePack (MsgPack) encoding when connecting to the SignalR Hub is strongly recommended, and will be enforced as the only supported encoding in the future.
The client must set KeepAliveInterval to 5 seconds when building the HubConnection. The backend service will time out and close connections that do not receive a keep-alive ping within 10 seconds. The default SignalR KeepAliveInterval of 15 seconds is too slow and will cause disconnections. csharp var connection = new HubConnectionBuilder() .WithUrl(hubUrl, options => { /* auth headers */ }) .WithKeepAliveInterval(TimeSpan.FromSeconds(5)) .Build(); For more details on SignalR client configuration, see the SignalR configuration documentation.
  1. SignalR client implementations expect the URL to omit the /negotiate portion of this path (for example, HubConnection should be created to a URL that ends in ...playfabapi.com/pubsub). 1. The auth headers required to call this API can be passed to the SignalR client via HttpConnectionOptions as seen on this method.

Implementing client methods to receive messages

See the SignalR Client documentation about implementing client methods that will be invoked to receive messages. Clients should implement all of the methods listed in Client methods below.

Starting and ending a session by calling server methods

See the SignalR Client documentation about calling server methods to manage your session. For example, once connected to the hub, you must call StartOrRecoverSession to receive a connection handle that you can use to subscribe to resources. Similarly, once you’re done with the session, call EndSession.

Subscribing to resources

Once a session has been started with StartOrRecoverSession, you can use the connection handle returned to start subscribing to resources and receiving messages.

APIs

Client methods

Server methods

Shared session methods

See also

Last modified on August 4, 2026