Join codes
Learn how to create and use join codes to connect players to a game session.
Read time 2 minutesLast updated 14 hours ago
Join codes are player-shared codes that allow players to group together into a logical game session. Players can share these codes anyway they want, such as through a Lobby, in-game chat, or an outside method such as chat service. The join codes are case insensitive, simple, and short. This makes them easy to share, such as in situations where copy and pasting isn't available. After a host player creates a game session, they then request a join code from the Allocations service to send to their friends. Their friends can then use the join code to join the host player's game session with their game client. The Relay service handles the networking and authentication behind the scenes. Allocations and join codes are valid for as long as the host player is connected to the Relay server. If the host player disconnects from the Relay server, or if the connection times out, the allocation and join code become invalid. There is no way to explicitly invalidate a join code. Join codes are scoped to the Unity project ID of the player who created it. This player is typically the host player. Because join codes are designed for players to share them out-of-band, any player with the join code can join the game, even if they're anonymous.