# All variables

> Every Pulse package reads the same 12 variables. Each one also has an option in code, which takes priority over it.

- Section: Packages
- Availability: The same in every package: Node, PHP, Python and Go.
- URL: https://pulse-app.si/en/docs/packages/variables

## The 12 variables

Only `PULSE_KEY` is required. A package reads nothing else under this prefix.

| Variable | Default | Purpose |
| --- | --- | --- |
| `PULSE_KEY` | none, required | The package key: `pk_live_` or `pk_test_`, then at least 20 characters. Missing: a warning. Malformed: an error. Either way, the package doesn’t start. |
| `PULSE_SEND` | `checks,crons,logs,versions` | What’s sent on top of the heartbeat. Empty (`PULSE_SEND=`): the heartbeat alone. An unknown value is ignored. |
| `PULSE_INCLUDE` | empty, so everything | Keeps only these checks and jobs. |
| `PULSE_EXCLUDE` | empty, so nothing | Removes these checks and jobs. Takes priority over `PULSE_INCLUDE`. |
| `PULSE_LOG_LEVEL` | `DEBUG` | Minimum log level: `DEBUG`, `INFO`, `WARN`, `ERROR` or `FATAL`. Any other value falls back to `DEBUG`, with no message. |
| `PULSE_LOGS` | `true` | `false` turns off logs, even if `PULSE_SEND` lists them. |
| `PULSE_PUBLIC_KEY` | none | Turns on encryption: `pulse_pub_` then 43 characters. If malformed, the package doesn’t start. |
| `PULSE_CLEAR` | `status` | What stays in the clear when encryption is on: `status`, `checks`, `crons`, `versions` or `none`. |
| `PULSE_ENDPOINT` | `https://api.pulse-app.si` | The address to send to, for Pulse Relay. `https` required, except for `localhost`, `127.0.0.1` and `::1`. |
| `PULSE_RELAY_FINGERPRINT` | none | The SHA-256 fingerprint of the relay’s certificate, `AA:BB:…`. If it doesn’t match, nothing leaves. |
| `PULSE_APP_VERSION` | depends on the language | Your app’s version, 60 characters at most. A new value records a deployment. |
| `PULSE_DISABLED` | `false` | `true` turns everything off, for tests and CI. |

> Python also accepts `WARNING` for `WARN` in `PULSE_LOG_LEVEL`.

## Choose what is sent

`PULSE_SEND`, `PULSE_INCLUDE` and `PULSE_EXCLUDE` take comma-separated lists. In the last two, `*` is a wildcard and case doesn’t matter.

**.env**

```bash
PULSE_SEND=checks,logs
PULSE_EXCLUDE="File emails,export-*"
PULSE_LOG_LEVEL=WARN
```

| `PULSE_SEND` value | What it sends |
| --- | --- |
| `checks` | The state of dependencies. |
| `crons` | Scheduled jobs and their runs. |
| `logs` | Logs, on Pro and Team. |
| `versions` | The versions of the framework and your app, and the start date. |

## Default app version

| Package | Without `PULSE_APP_VERSION` |
| --- | --- |
| Node (NestJS, Next.js) | `npm_package_version`, present only if the app is started by an npm, pnpm or yarn script. |
| Laravel, Symfony | No version. |
| Python | No version. |
| Go | The main module’s version in the build info. |

## Options in code

Each variable has its option, and the option takes priority over the variable.

| Package | Where | Names |
| --- | --- | --- |
| NestJS | `PulseModule.forRoot({…})` | `key`, `send`, `include`, `exclude`, `logLevel`, `logs`, `publicKey`, `clear`, `endpoint`, `relayFingerprint`, `appVersion`, `disabled` |
| Next.js | `startPulse({…})` | The same |
| Laravel | `config/pulse-app.php` | `key`, `send`, `include`, `exclude`, `log_level`, `logs`, `public_key`, `clear`, `endpoint`, `relay_fingerprint`, `app_version`, `disabled` |
| Symfony | `config/packages/pulse.yaml` | The same |
| Python | `PULSE = {…}` for Django, otherwise `start_pulse(…)` | The same |
| Go | `pulse.Options{…}` | `Key`, `Send`, `Include`, `Exclude`, `LogLevel`, `Logs`, `PublicKey`, `Clear`, `Endpoint`, `RelayFingerprint`, `AppVersion`, `Disabled` |

> **Laravel and config:cache**
>
> Laravel reads these variables through its configuration. After a change with `config:cache`, rebuild the cache or run `php artisan config:clear`.

## Going through Pulse Relay

On the Team plan in VPS mode, data goes through [your own relay](https://pulse-app.si/en/docs/team/relay). Only the address’s origin is kept.

**.env**

```bash
PULSE_ENDPOINT=https://relay.orbit.example
PULSE_RELAY_FINGERPRINT=AA:BB:CC:…
```

## Secure mode

`PULSE_PUBLIC_KEY` encrypts reports and logs on your server. `PULSE_CLEAR` chooses what Pulse keeps in the clear so it can alert you. PHP needs `sodium` and `openssl`, Python needs `pip install "pulse-python[secure]"`. Without them, the package refuses to start, so nothing is sent in the clear by mistake.

> **Coming soon**
>
> The packages and the API can encrypt, but the iPhone, iPad, Mac and Android apps don’t have the screen that creates the key pair and turns on the mode yet. Until then, leave `PULSE_PUBLIC_KEY` empty, because the API refuses encrypted reports (`Secure mode is off for this app`, meaning secure mode is off for this app).

Once the mode is on, `Secure mode is on for this app` means the key is missing and the package stops. `PULSE_PUBLIC_KEY no longer matches` means it was replaced in the app. Encryption is reserved for Pro and Team.

## Other variables read

The package also reads a few variables the platform sets itself. You don’t need to set them: `npm_package_version`, `NEXT_RUNTIME` for Next.js, `RUN_MAIN` for Django, `FLASK_RUN_FROM_CLI`, `FLASK_DEBUG` and `WERKZEUG_RUN_MAIN` for Flask. [Pulse Agent](https://pulse-app.si/en/docs/servers/agent) has its own variables.

- [Exactly what is sent](https://pulse-app.si/en/docs/packages/payload): The precise format of reports and logs.
- [Secure mode](https://pulse-app.si/en/docs/apps/secure-mode): What encryption changes for you.
- [npx @pulse-si/init](https://pulse-app.si/en/docs/packages/init): The command that writes these variables for you.
