Riff

Riff overview

Riff is a realtime multiplayer service for games. Your game connects over a WebSocket, joins a room, and sends messages to the other players in it. There are no servers for you to run or scale.

Concepts

ConceptMeaning
AppYour game or product. Each app has its own appId, settings and limits.
appIdThe identifier your game connects with. It is not a secret.
PlayerA connection with a playerId (an id you choose) and a display name.
RoomA named group of players, created when the first player joins and removed when the last one leaves.
MasterThe player who controls the room. The creator starts as master, and the role passes on if they leave.
PropertiesFree-form JSON stored on a room or a player and shared with everyone in the room.

Getting started

  1. Create an app in your dashboard and copy its appId.
  2. Install the Unity SDK and enter your appId and the server URL wss://ws.riffserver.com.
  3. Connect, then join a room with JoinRoomAsync.
  4. Send messages to the room, to one player, or to the master.

Connect modes

  • appId only (default): players connect with just your appId.
  • Signed tokens (optional): your game backend signs a short-lived token for each player, so playerId can be trusted. Use this for ranked play or anything involving purchases. See Connecting.

Limits

LimitValue
Players per roomup to 50
Messages per connection30 per second
Concurrent connectionsdepends on your plan

Next

Connecting · Lobby and rooms · Messaging and events · Gameplay · Random seed · Unity SDK · Reference