Skip to content

Commit 8cab73f

Browse files
committed
add deploy with api key section
1 parent 040c71c commit 8cab73f

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

docs/apikeys.mdx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,31 @@ Access presets define what a key can do. Some presets require a paid plan. The d
8989
| **Task operator** | Trigger all or selected tasks and inspect or operate on their runs |
9090
| **Observer** | Read runs, tasks, batches, logs, traces, and queues |
9191
| **Operator** | Observe and operate on runs and queues, and trigger tasks |
92-
| **Deploy only** | Deploy new versions, read deployment status, and read environment variables |
92+
| **Deploy only** | Deploy versions, sync environment variables, and manage Preview branches |
9393
| **Variables only** | Read and write environment variables in this environment |
9494
| **No restrictions** | Full access to the environment |
9595

9696
**Trigger only** and **Task operator** can be restricted to selected tasks. Task restrictions use task identifiers, such as `send-email`. A request involving multiple tasks — such as a batch trigger — succeeds only when the key can access every task in the request, so a task-restricted key can batch-trigger only its selected tasks.
9797

98+
## Deploy with an API key
99+
100+
Set a key in `TRIGGER_ACCESS_TOKEN` to authenticate `trigger deploy` without logging in.
101+
102+
<CodeGroup>
103+
104+
```bash npm
105+
TRIGGER_ACCESS_TOKEN="tr_prod_sk_…" npx trigger.dev@latest deploy
106+
```
107+
</CodeGroup>
108+
109+
The key must belong to the target environment. Use a Production key for the default deployment, a Staging key with `--env staging`, or a key from the Preview environment with `--env preview`. A Preview deployment key can create and archive Preview branches and sync their environment variables.
110+
111+
<Note>
112+
The deploy CLI reads environment API keys from `TRIGGER_ACCESS_TOKEN`, not
113+
`TRIGGER_SECRET_KEY`. Setting an API key in `TRIGGER_ACCESS_TOKEN` takes precedence over a saved
114+
CLI login.
115+
</Note>
116+
98117
## Expire and revoke keys
99118

100119
Set an expiration date when creating a key if the integration only needs temporary access. An expired key stops authenticating automatically.
@@ -115,7 +134,7 @@ Public access tokens signed with the previous root key remain valid until the ea
115134

116135
## Create public access tokens
117136

118-
API keys can be used create scoped [Public Access Tokens](/realtime/auth) using `auth.createPublicToken()`.
137+
API keys can be used to create scoped [Public Access Tokens](/realtime/auth) using `auth.createPublicToken()`.
119138

120139
In order to do so with the newer non-root keys, you must use `@trigger.dev/sdk` version 4.5.8 or later. Creating public tokens with non-root keys has the following restrictions:
121140

0 commit comments

Comments
 (0)