---
url: /process-functions/script-getusername.md
description: Returns the username of the calling user.
---

# script.getUserName

Returns the username of the calling user.

```js
script.getUserName(user_id)
```

#### Parameters

* `user_id` - Optional. If specified, it retrieves the username of that user.

#### Example

```js
let userName = script.getUserName();
```
