security.getUserId deprecated
Get the id of a user from their email; returns 0 when the user is not found.
Deprecated
Use userSecurity.users.getFromEmail(email).getId() instead.
js
security.getUserId(email)Parameters
| Parameter | Type | Description |
|---|---|---|
email | string | User's email address. |
Returns
numberThe user's numeric id, or 0 if the user was not found.
Examples
js
const userId = security.getUserId("jane.doe@example.com"); // 1234