Until the identity is linked with the Rivet Hub (see
rivet.api.identity#PrepareGameLink), this identity will be temporary but
still behave like all other identities.
This is intended to allow users to play the game without signing up while
still having the benefits of having an account. When they are ready to save
their account, they should be instructed to link their account (see
rivet.api.identity#PrepareGameLink).
identity_token should be stored in some form of persistent storage. The
token should be read from storage and passed to
rivet.api.identity#SetupIdentity every time the client starts.
example
Use a bare-bones client and the command you need to make an API call.
Gets or creates an identity. Passing an existing identity token in the body refreshes the token.
Temporary Accounts
Until the identity is linked with the Rivet Hub (see
rivet.api.identity#PrepareGameLink), this identity will be temporary but still behave like all other identities. This is intended to allow users to play the game without signing up while still having the benefits of having an account. When they are ready to save their account, they should be instructed to link their account (seerivet.api.identity#PrepareGameLink).Storing Token
identity_tokenshould be stored in some form of persistent storage. The token should be read from storage and passed torivet.api.identity#SetupIdentityevery time the client starts.Use a bare-bones client and the command you need to make an API call.
import { IdentityServiceClient, SetupIdentityCommand } from "@rivet-gg/identity"; // ES Modules import // const { IdentityServiceClient, SetupIdentityCommand } = require("@rivet-gg/identity"); // CommonJS import const client = new IdentityServiceClient(config); const command = new SetupIdentityCommand(input); const response = await client.send(command);SetupIdentityCommandInput for command's
inputshape.SetupIdentityCommandOutput for command's
responseshape.config for IdentityServiceClient's
configshape.