Class: GlobalPlayerId

Class representing a globally unique player ID. The ID is guaranteed to be unique across different platforms, but not different projects. Microservices that serve multiple projects should use a project-specific ID in addition to the globally unique player ID.

Constructors

constructor

new GlobalPlayerId(str): GlobalPlayerId

Parse a GlobalPlayerId from a serialized string. Will throw an exception if the string contains an invalid platform or player ID.

Parameters

Name Type Description
str string Stringified GlobalPlayerId

Returns

GlobalPlayerId

new GlobalPlayerId(platform, id): GlobalPlayerId

Create a GlobalPlayerId from platform and player ID.

Parameters

Name Type Description
platform "FB" | "VBR" | "VK" | "ZOOM" | "WEB" Platform identifier
id string Player’s unique ID within the platform

Returns

GlobalPlayerId

Properties

id

Readonly id: string


platform

Readonly platform: "FB" | "VBR" | "VK" | "ZOOM" | "WEB"

Methods

toJSON

toJSON(): string

Returns

string


toString

toString(): string

Returns

string