---
url: /process-functions/security-currentuserid.md
description: Retrieves the user id of the current user.
---

# security.currentUserId&#x20;

Retrieves the user id of the current user.

::: warning Deprecated
Use [`userSecurity.users.getCurrent().getId()`](/process-functions/userSecurity-user#getid) instead.
:::

```js
security.currentUserId()
```

## Returns

## Examples

```js
const userId = security.currentUserId();
```
