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
| Concept | Meaning |
|---|---|
| App | Your game or product. Each app has its own appId, settings and limits. |
| appId | The identifier your game connects with. It is not a secret. |
| Player | A connection with a playerId (an id you choose) and a display name. |
| Room | A named group of players, created when the first player joins and removed when the last one leaves. |
| Master | The player who controls the room. The creator starts as master, and the role passes on if they leave. |
| Properties | Free-form JSON stored on a room or a player and shared with everyone in the room. |
Getting started
- Create an app in your dashboard and copy its
appId. - Install the Unity SDK and enter your
appIdand the server URLwss://ws.riffserver.com. - Connect, then join a room with
JoinRoomAsync. - 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
playerIdcan be trusted. Use this for ranked play or anything involving purchases. See Connecting.
Limits
| Limit | Value |
|---|---|
| Players per room | up to 50 |
| Messages per connection | 30 per second |
| Concurrent connections | depends on your plan |
Next
Connecting · Lobby and rooms · Messaging and events · Gameplay · Random seed · Unity SDK · Reference