Options
All
  • Public
  • Public/Protected
  • All
Menu

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 (see rivet.api.identity#PrepareGameLink).

Storing Token

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.

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);
see

SetupIdentityCommandInput for command's input shape.

see

SetupIdentityCommandOutput for command's response shape.

see

config for IdentityServiceClient's config shape.

Hierarchy

Implements

Index

Constructors

Properties

Constructors

constructor

Properties

Readonly input

Readonly middlewareStack

middlewareStack: IMiddlewareStack<SetupIdentityCommandInput, SetupIdentityCommandOutput>