Options
All
  • Public
  • Public/Protected
  • All
Menu

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_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.

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

PrepareGameLinkCommandInput for command's input shape.

see

PrepareGameLinkCommandOutput 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<PrepareGameLinkCommandInput, PrepareGameLinkCommandOutput>