Skip to main content

Identifying Users

AirSnap allows you to identify the user by getting setting a custom ID. In addition, you're also able to retrieve the sessionId and userId via our SDK.

getSessionId

Returns the current session ID

const sessionId = await AirSnap.getSessionId()

getUserId

Returns the user ID that is used to distinguish users. This can be a custom identifier that you set, otherwise it will use the IDFV Device ID by default.

const userId = await AirSnap.getUserId()

setUserId

Sets the user ID that is used to distinguish users. This can be the internal identifier for your application. If param is an empty string or null, it will reset the identifier back to the Device ID.

AirSnap.setUserId('john.doe@airsnap.io')

// Resets user id to device id. Ex: logging out
AirSnap.setUserId('')
AirSnap.setUserId()