You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apikeys.mdx
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,25 @@ Each environment has its own secret key. You can find the value on the API keys
11
11
12
12

13
13
14
+
<Note>
15
+
For preview branches, you need to also set the `TRIGGER_PREVIEW_BRANCH` environment variable as
16
+
well. You can find the value on the API keys page when you're on the preview branch.
17
+
</Note>
18
+
14
19
### Automatically Configuring the SDK
15
20
16
21
To automatically configure the SDK with your secret key, you can set the `TRIGGER_SECRET_KEY` environment variable. The SDK will automatically use this value when calling API methods (like `trigger`).
17
22
18
23
```bash .env
19
24
TRIGGER_SECRET_KEY="tr_dev_…"
25
+
TRIGGER_PREVIEW_BRANCH="my-branch"# Only needed for preview branches
20
26
```
21
27
22
28
You can do the same if you are self-hosting and need to change the default URL by using `TRIGGER_API_URL`.
23
29
24
30
```bash .env
25
31
TRIGGER_API_URL="https://trigger.example.com"
32
+
TRIGGER_PREVIEW_BRANCH="my-branch"# Only needed for preview branches
26
33
```
27
34
28
35
The default URL is `https://api.trigger.dev`.
@@ -37,6 +44,7 @@ import { myTask } from "./trigger/myTasks";
37
44
38
45
configure({
39
46
secretKey: "tr_dev_1234", // WARNING: Never actually hardcode your secret key like this
47
+
previewBranch: "my-branch", // Only needed for preview branches
0 commit comments