---
url: /process-functions/security-getsecret.md
description: Retrieves a secret value from the server's secret manager by key.
---

# security.getSecret

Retrieves a secret value from the server's secret manager by key.

```js
security.getSecret(key)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `key` | `string` | The key of the secret to retrieve. |

## Returns

The secret's value as a string.

## Examples

```js
const apiKey = security.getSecret("secret_name");
```
