Skip to content

Commit 93fd184

Browse files
committed
Added preview branch notes to the API keys docs
1 parent 160e325 commit 93fd184

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/apikeys.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,25 @@ Each environment has its own secret key. You can find the value on the API keys
1111

1212
![How to find your secret key](/images/api-keys.png)
1313

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+
1419
### Automatically Configuring the SDK
1520

1621
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`).
1722

1823
```bash .env
1924
TRIGGER_SECRET_KEY="tr_dev_…"
25+
TRIGGER_PREVIEW_BRANCH="my-branch" # Only needed for preview branches
2026
```
2127

2228
You can do the same if you are self-hosting and need to change the default URL by using `TRIGGER_API_URL`.
2329

2430
```bash .env
2531
TRIGGER_API_URL="https://trigger.example.com"
32+
TRIGGER_PREVIEW_BRANCH="my-branch" # Only needed for preview branches
2633
```
2734

2835
The default URL is `https://api.trigger.dev`.
@@ -37,6 +44,7 @@ import { myTask } from "./trigger/myTasks";
3744

3845
configure({
3946
secretKey: "tr_dev_1234", // WARNING: Never actually hardcode your secret key like this
47+
previewBranch: "my-branch", // Only needed for preview branches
4048
baseURL: "https://mytrigger.example.com", // Optional
4149
});
4250

0 commit comments

Comments
 (0)