You can use this in the php code if you have already determined the userid in your script which only returns a username.
Code:
vB_Api_User::fetchUserName($userid)
Or, you can use if you don't which returns a fairly large array with tons of user info.
Code:
vB_Api_User::fetchCurrentUserinfo()
Either of these can also be called via AJAX in javascript so it can also it can be implemented on cloud also.

[forum root]/ajax/api/user/fetchUserName?userid=3 using pageData['userid'] to get the userid
[forum root]/ajax/api/user/fetchUserinfo if you want more data than just a user name.