Get the user ID of the current user
getUserId()

Getting the player's Kongregate user id

You can use the getUserId function to retrieve the unique user ID of the current player. It will return 0 if the user is not signed in.

Please note that to securely authenticate a player, you should use the server-side authentication API.

Name

Type

Description

Return value

Integer

The user ID of the current user.

var userId:Number = kongregate.services.getUserId();
var userId = kongregate.services.getUserId();