When an identity is created via rivet.api.identity#SetupIdentity, the identity is temporary
and is not shared with other games the user plays.
In order to make the identity permanent and synchronize the identity with
other games, the identity must be linked with the hub.
The linking process works by opening identity_link_url in a browser then polling
rivet.api.identity#GetGameLink to wait for it to complete.
This is designed to be as flexible as possible so identity_link_url can be opened
on any device. For example, when playing a console game, the user can scan a
QR code for identity_link_url to authenticate on their phone.
example
Use a bare-bones client and the command you need to make an API call.
Begins the process for linking an identity with the Rivet Hub.
Importance of Linking Identities
When an identity is created via
rivet.api.identity#SetupIdentity, the identity is temporary and is not shared with other games the user plays. In order to make the identity permanent and synchronize the identity with other games, the identity must be linked with the hub.Linking Process
The linking process works by opening
identity_link_urlin a browser then pollingrivet.api.identity#GetGameLinkto wait for it to complete. This is designed to be as flexible as possible soidentity_link_urlcan be opened on any device. For example, when playing a console game, the user can scan a QR code foridentity_link_urlto authenticate on their phone.Use a bare-bones client and the command you need to make an API call.
import { IdentityServiceClient, PrepareGameLinkCommand } from "@rivet-gg/identity"; // ES Modules import // const { IdentityServiceClient, PrepareGameLinkCommand } = require("@rivet-gg/identity"); // CommonJS import const client = new IdentityServiceClient(config); const command = new PrepareGameLinkCommand(input); const response = await client.send(command);PrepareGameLinkCommandInput for command's
inputshape.PrepareGameLinkCommandOutput for command's
responseshape.config for IdentityServiceClient's
configshape.