Skip to content

Commit

Permalink
Add notice on sideEffects in deployment guide (#680)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Aitken <matt@mattaitken.com>
  • Loading branch information
zcesur and matt-aitken committed May 7, 2024
1 parent 7d6430d commit ff04c98
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/documentation/guides/deployment-setup.mdx
Expand Up @@ -16,7 +16,21 @@ export const client = new TriggerClient({
});
```

## 2. Set your environment variables on your server
## 2. Include your Jobs in `sideEffects` if needed

If your `package.json` does not declare `sideEffects`, you can safely skip this step. Otherwise, include a glob pattern that matches your jobs so that they are not tree shaken away in your production bundle.

```json
// package.json
{
"name": "my-app",
"sideEffects": [
"./src/jobs/**/*.ts"
]
}
```

## 3. Set your environment variables on your server

Ensure that your `TRIGGER_API_KEY` (or whatever you've set it to) environment variable is set on your server, to the correct value from the "Environments & API Keys" page in your Trigger.dev dashboard.

Expand All @@ -31,11 +45,11 @@ The exact instructions will vary depending on where you deploy to. Here are the
- [Cloudflare Workers](https://developers.cloudflare.com/workers/platform/environment-variables/)
- [Netlify](https://docs.netlify.com/environment-variables/overview/)

## 3. Deploy your code as usual
## 4. Deploy your code as usual

Your Job code lives in your codebase, so you can deploy it as you normally would.

## 4. Connect the Endpoint for the first time
## 5. Connect the Endpoint for the first time

1. Go to the "Environments & API Keys" page in your Trigger.dev dashboard
![Go to the Environments & API Keys page ](/images/environments-link.png)
Expand Down

0 comments on commit ff04c98

Please sign in to comment.