docs: function($socket, args) {
            if (!args || typeof args != 'object' || !args.events || !Array.isArray(args.events)) {
              return;
            }
  
            $socket.realTimeEvents = [];
  
            args.events.forEach(function(event) {
              if (!event || typeof event != 'string') {
                return;
              }
  
              event = _formatEventFromString(event);
  
              if (!event.origin || !_events[event.origin]) {
                return;
              }
  
              var permissions = _events[event.origin].permissions ?
                _events[event.origin].permissions.map(function(permission) {
                  if (!event.args || !event.args.length) {
                    return permission;
                  }
  
                  event.args.forEach(function(arg, index) {
                    permission = permission.replace('{{args' + index + '}}', arg);
                  });
  
                  return permission;
                }) : null;
  
              $socket.realTimeEvents.push({
                origin: event.origin,
                name: event.name,
                args: event.args,
                permissions: permissions,
                hasPermission: true
              });
            });
  
            _this.hooks.fire('updateEvents', {
              socket: $socket
            }, function() {
              $socket.emit('read(real-time/events)', {
                success: true
              });
  
              if (args.directCalls) {
                _callEvents($socket, args.directCalls);
              }
            });
          }