Environment variables are only supported in a [declarative config](/docs/configuration/declarative-config) and cannot be used in the web UI.
1. Add the `token` property to your connection config:
```json
{
"type": "bitbucket",
"token": {
// note: this env var can be named anything. It
// doesn't need to be `BITBUCKET_TOKEN`.
"env": "BITBUCKET_TOKEN"
}
// .. rest of config ..
}
```
2. Pass this environment variable each time you run Sourcebot:
```bash
docker run \
-e BITBUCKET_TOKEN= \
/* additional args */ \
ghcr.io/sourcebot-dev/sourcebot:latest
```
Secrets are only supported when [authentication](/docs/configuration/auth/overview) is enabled.
1. Navigate to **Secrets** in settings and create a new secret with your PAT:

2. Add the `token` property to your connection config:
```json
{
"type": "bitbucket",
"token": {
"secret": "mysecret"
}
// .. rest of config ..
}
```