The id.net SDK will dispatch events to alart an application about changes. It’s also possible for applications to use this to make custom events.

  • id.init - Triggered when the SDK is ready to be used.
  • auth.authResponseChange - Triggered when a user logs in or register
<script type="text/javascript">
window.idAsyncInit = function() {
  ID.Event.subscribe('auth.authResponseChange', function(auth) {
    console.log(auth);
  });
  ID.Event.subscribe('id.init', function() {
    alert('ID.net SDK initialized!');
  });
  ID.init({
      // Initialization options
  });
}
</script>

Custom Events

var eventCb = function(value) {
  // Do something when the event is fired
}

ID.Event.subscribe('awesome.game.custom.event', eventCb);

var score = 500;
ID.Event.fire('awesome.game.custom.event', score)