Vous pouvez utiliser :
const user = api.getCurrentUser() if(user) { return user.username; }
Plus d’informations ici :