Skip to content

User API

User API queries users and session state on the platform. Information about the current user is reached not via ins.* but through the user global in the script context.

Returns a collection of every username in the system (Collection<String>).

var users = ins.getAllUsernames();
users.forEach(function(u) {
ins.consoleLog(u);
});

Returns the collection of users with an active session.

var online = ins.getLoggedInUsers();
ins.consoleLog("Active users: " + online.size());

Returns recent authentication attempts (AuthAttemptDto) — both successful and failed.

var attempts = ins.getLastAuthAttempts();
attempts.forEach(function(a) {
ins.consoleLog(a.username + " @ " + a.remoteAddress + "" + (a.success ? "OK" : "FAIL"));
});

Typical AuthAttemptDto fields: username, remoteAddress, success, createdAt.