Retrieve the current user’s ID. This API is read-only and is primarily used to QA events With Live data feed.
If you’re unsure which version of Heap you’re using, see Identifying your Heap version.
Current version (heap.js 5)
heap.getUserId()
Classic heap.js
var userId = heap.userId;
var identity = heap.identity;
const userId = heap.userId;
const identity = heap.identity;
NSString *userId = [Heap userId];
NSString *identity = [Heap identity];
let userId = Heap.userId
let identity = Heap.identity
String userId = Heap.getUserId();
String identity = Heap.getIdentity();
val userId = Heap.getUserId()
val identity = Heap.getIdentity()