---
url: /process-functions/userSecurity-users.md
description: Looks up user accounts.
---

# &#x20;Users&#x20;

Looks up user accounts.

```js
const user = userSecurity.users.getFromEmail("john.doe@example.com");
console.log(user.getName());
```

## Constructor

Reached through the [userSecurity.users](/process-functions/userSecurity#properties) property. It can't be created directly.

## Methods

### get `get(userId)`  {#get}

Returns a [User](/process-functions/userSecurity-user) by id, or `null` when there's no such user.

| Parameter | Type | Description |
|---|---|---|
| `userId` | `number \| string` | The user's numeric id. |

### getFromEmail `getFromEmail(email)`  {#getfromemail}

Returns a [User](/process-functions/userSecurity-user) by email address, or `null` when there's no such user.

| Parameter | Type | Description |
|---|---|---|
| `email` | `string` | The user's email address. |

### getCurrent `getCurrent()`  {#getcurrent}

Returns the [User](/process-functions/userSecurity-user) running the process.

## Examples

```js
// Retrieve a user by email
const userByEmail = userSecurity.users.getFromEmail("john.doe@example.com");
console.log("User Retrieved: " + userByEmail.getName());

// Retrieve a user by id
const userById = userSecurity.users.get(123);
console.log("User Retrieved: " + userById.getName());

// Retrieve the user running the process
const currentUser = userSecurity.users.getCurrent();
console.log("Current User: " + currentUser.getName());
```

## Related

* [User](/process-functions/userSecurity-user): the user these methods return.
