addEventListener(event_type, callback)

Services events

This method can be used to listen for events related to the Kongregate user.

The addEventListener method takes two arguments, the event type, and a callback function:

event_typeStringType of event to listen for
callbackFunctionFunction to call when the event is triggered

User events

The following event types are currently supported:

loginThe user has converted from a guest to a registered user. User info methods on the services object will return updated information after this event is triggered.

Example: Listen for user login event"login", onKongregateInPageLogin);

function onKongregateInPageLogin() {
  var user_id =;
  var username =;
  var token =;