< Previous Article Next Article >


pjs.getUser() returns the currently authenticated user.

If deployed directly on profoundjs.com, the returned value is a Profound.js Spaces user id. When your application is deployed on another system, such as IBM i, the API will return the current user for that system.

If the user has not authenticated, the API returns null.

// Require user to be logged in
let user = pjs.getUser();
if (!user) {


Have questions about this topic? Ask for help on our Profound.js Spaces Discussion Forum.

< Previous Article Next Article >