Connecting users to your game
In order to use the Player API, you need to connect your users to your game. This is done by creating a new user in the Player Service. The user will be created with a unique identifier, which can be used to reference the user in future API calls. Similarly to Automation Service, you will refer to this user through an EntityId
. This can be any identifier you want, as long as it’s unique within your game registration. You can assign users multiple entityIds
and in some cases, the user will be automatically assigned an entityId
that is his Externally Owned Account address.
In order to connect a user to your game, you can either start the Connection flow using one of our Platform clients or the Player API directly.
Connecting users using the Connect To Game flow
When using our Platform clients it’s fairly easy to connect users.
In case of the Unity client, all you need to do is to call an awaitable method called ConnectUserToGame
. This method will take care of opening the browser for you on most platforms. You can read more about this in BuildOnBeam/beam-sdk-unity.
var result = await beamClient.ConnectUserToGameAsyncV2("EntityId"); // will also work without entityId
if (result.Status == BeamResultType.Success)
{
var user = await beamClient.UsersApi.GetUserAsync(result.Result.EntityId);
// you can now perform Operations with this User
}
After opening resulting url
, user needs to sign in using one of the supported Social Login options and will see this screen:

Afterward you can initialize Operations and send assets to your user, using his EntityId
. If you decide to not use EntityId
, users EOA address will be assigned automatically instead and returned in the result.
Connecting users using first Session signing
To make things even more frictionless for players, we also connect them to your game when you initiate Session signing flow. This reduces amount of interruptions from the game to an absolute minimum.
var activeSessionResult = await beamClient.CreateSessionAsync(EntityId);
if (activeSessionResult.Status == BeamResultType.Success)
{
var session = activeSessionResult.Result;
// you can now sign Operations without leaving the game
}
Connection webhooks
You can get notified if a Game Connection was made by a User. For this, we have introduced User connection webhook.