Skip to main content

Identifying a player

Aliases

Players within your Talo account can have multiple aliases. For example, a player could have Steam and Epic Games login credentials but both would be tied to them, allowing the player to use either to log in.

You should identify a player after they have authenticated and before you attempt to track any events, add leaderboard entries or do anything related directly to the player.

Identifying

You can identify a player using Talo.players.identify(). The code sample below shows you how you could identify a player using a UI element (this example is also available in the Playground scene):

identify_button.gd
extends Button

@export var service: String
@export var identifier: String

func _on_pressed():
Talo.players.identify(service, identifier)
caution

You cannot use "Talo" for the service parameter as this is reserved for Talo Player Authentication.

If you are using Talo Player Authentication, Talo.players.identify() will be invoked automatically and the Talo.players.identified signal will also emit as normal.

Visit the Player authentication docs to learn more about identifying players with authentication enabled.

Generating a mostly-unique identifier

You can easily create an identifier with Talo.players.generate_identifier(). This is useful for temporarily identifying players before you know who they are, and then merging them with an identified player later on.

The "identified" signal

After a successful identification, the Talo.players.identified signal will emit, returning the identified player. This allows you to, for example, put the player's name on a label:

player_name.gd
extends Label

func _ready() -> void:
Talo.players.identified.connect(_on_identified)

func _on_identified(player: TaloPlayer) -> void:
text = player.get_prop("display_name")

The "identification_started" and "identification_failed" signals

When Talo.players.identify() is called, the Talo.players.identification_started signal is emitted.

If identification fails, the Talo.players.identification_failed signal is emitted.

func _ready() -> void:
Talo.players.identification_started.connect(func (): go_to_loading())
Talo.players.identification_failed.connect(func (): go_to_login())

Checking identification

Sometimes you might need to check if a player has been identified before. You can use Talo.identity_check() to verify this - it throws an error if a player hasn't been identified yet:

func do_stuff_if_authenticated() -> void:
if Talo.identity_check() != OK:
return

# do stuff

Clearing the identified player

You can clear the current player using Talo.players.clear_identity(). This will set Talo.current_alias and Talo.current_player to null. It will also clear any cached or pending data that identifies the player like the offline alias cache, pending events and continuity requests. For players using Talo authentication, it will also clear session data.

Once all the relevant data has been cleared, the Talo.players.identity_cleared signal will be emitted.

Merging players

Sometimes you might start tracking a player's actions before you know their true identity. For example, you could be tracking events with an "anonymous" identifier and then later on the same player chooses their username before submitting a leaderboard entry. Since both of these players need to be identified, two players will be created.

You can merge players using Talo.players.merge() by providing the IDs of both players. The merge process takes all the props, aliases, and associated data (events, leaderboard entries, saves, etc.) from Player 2 and merges them into Player 1. This means that duplicate props in Player 1 will be replaced by the ones from Player 2.

caution

Merging players has one major limitation: you cannot merge two players that have overlapping alias services. For example, if both players have an alias with the service "username", the merging process will fail.

You can provide the post_merge_identity_service option to automatically re-identify the player once merging is complete:

await Talo.players.identify("anonymous", Talo.players.generate_identifier())
var player1_id = Talo.current_player.id
await Talo.players.identify("username", "guyman")
var player2_id = Talo.current_player.id

print(Talo.current_alias.service) # "username"

var mergeOpts := Talo.players.MergeOptions.new()
mergeOpts.post_merge_identity_service = "anonymous" # go back to the anonymous alias
var merged_player := await Talo.players.merge(player1_id, player2_id, mergeOpts)

print(Talo.current_alias.service) # "anonymous"

In the example above, the two players created with Talo.players.identify() are merged. Before merging, the current alias service was "username" (because that was the most recently identified player). Setting the post_merge_identity_service option will invoke Talo.players.identify() with the "anonymous" alias.

Steamworks integration

tip

You can enable this integration on the integrations page.

If you have the Steamworks integration enabled, Talo can sync a Steam player using the Steam User Auth API (as described here). You can do this via the Talo.players.identify_steam function. Here's an example using GodotSteam:

extends Node

var identity = "talo"

func _ready() -> void:
Steam.steamInitEx()
Steam.get_ticket_for_web_api.connect(_on_get_ticket_for_web_api)
Steam.getAuthTicketForWebApi(identity)

func _on_get_ticket_for_web_api(_auth_ticket: int, _result: int, _ticket_size: int, ticket_buffer: Array) -> void:
Talo.players.identify_steam(PackedByteArray(ticket_buffer).hex_encode(), identity)

func _process(_delta: float) -> void:
Steam.run_callbacks()

The identity parameter is optional but strongly recommended as it ensures proper identification of the service verifying the ticket. It can be anything you like but must be the same as the identity passed to Steam when fetching the ticket.

Steamworks player props

After successfully authenticating the player, several props will automatically be created for them:

  • META_STEAMWORKS_VAC_BANNED - "true" or "false"
  • META_STEAMWORKS_PUBLISHER_BANNED - "true" or "false"
  • META_STEAMWORKS_OWNS_APP - "true" or "false"
  • META_STEAMWORKS_OWNS_APP_PERMANENTLY - "true" or "false"
  • META_STEAMWORKS_OWNS_APP_FROM_DATE - ISO date e.g. "2025-11-08T17:30:00Z"
  • META_STEAMWORKS_PERSONA_NAME - the player's current display name
  • META_STEAMWORKS_AVATAR_HASH - e.g. "5bfdbd8cd4407d6cd37dfba06851b62a4856bb2d"

You can build an avatar URL by replacing [AVATAR_HASH] with the META_STEAMWORKS_AVATAR_HASH prop value in the following URL: https://avatars.steamstatic.com/[AVATAR_HASH]_full.jpg.

These props will be updated each time the player is identified using Talo.players.identify_steam().

Offline player cache

If the cache_player_on_identify setting is enabled (default true), Talo will store player data locally. If a player tries to identify while offline, Talo will try and use local data if it exists.

Searching for players

You can use Talo.players.search() to query players. This function accepts a single query parameter that will search your playerbase for matching player IDs, alias identifiers or prop values. You can use this function to find players by their username, their ID or if they have a prop with a specific value.

var search_page := await Talo.players.search("bob")
if search_page.count == 0:
print("No players found")
return

var identifiers = []
for player in search_page.players:
identifiers.append(player.get_alias().identifier)

print("Found %s results: %s" % [search_page.count, ", ".join(identifiers)])