Skip to content

security.getUserId deprecated ​

Get the id of a user from their email; returns 0 when the user is not found.

js
security.getUserId(email)

Parameters ​

ParameterTypeDescription
emailstringUser's email address.

Returns ​

number

The user's numeric id, or 0 if the user was not found.

Examples ​

js
const userId = security.getUserId("jane.doe@example.com"); // 1234