Skip to content

Conversation

@lindseystead
Copy link
Contributor

This PR updates the environment variable documentation to address issue #2621.

A maintainer explained in the issue discussion how to use .env.production files by manually pasting them into the Trigger.dev Environment Variables page. This PR adds that missing clarification directly to the documentation.

It also provides an optional example showing how to use dotenvx together with the syncEnvVars build extension for teams who want a more automated workflow.

Closes #2621

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works (N/A - documentation only)

Testing

No code changes - this is documentation only. I verified the markdown renders correctly and the examples follow the existing documentation style.

Changelog

Added new section "Using .env.production or dotenvx with Trigger.dev" to the environment variables documentation, explaining:

  • Manual paste method for .env.production files
  • Automated sync using syncEnvVars with dotenvx

Screenshots

N/A - documentation only

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

⚠️ No Changeset found

Latest commit: 4a5a902

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

A new documentation section titled "Using .env.production or dotenvx with Trigger.dev" was added to docs/deploy-environment-variables.mdx. It describes two approaches for loading environment variables: (1) manually copying variables from .env.production/.env into the Trigger.dev dashboard, and (2) automatically syncing via a build extension (syncEnvVars) that uses dotenvx to read and parse a .env.production file. The change includes a code example configuring the build extension. The new content appears twice in the file as two identical blocks.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Documentation-only change with no runtime code or logic modifications
  • Single file modified, additions are repetitive (duplicated block)
  • Review attention:
    • Confirm whether the duplicated section is intentional or should be removed/merged
    • Verify the build extension code example is syntactically correct and matches expected API names
    • Check wording for clarity and accuracy of the two described approaches

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding documentation about using .env.production and dotenvx for environment variables in Trigger.dev.
Description check ✅ Passed The description follows the template structure with complete sections including checklist completion, testing rationale, changelog, and issue reference.
Linked Issues check ✅ Passed The PR directly addresses issue #2621 by documenting both the manual .env.production method and dotenvx support as requested in the linked issue.
Out of Scope Changes check ✅ Passed All changes are scoped to documentation updates for environment variables, directly aligned with the objectives of resolving issue #2621.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f22bbf and 4a5a902.

📒 Files selected for processing (1)
  • docs/deploy-environment-variables.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/deploy-environment-variables.mdx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a70ab10 and 0f22bbf.

📒 Files selected for processing (1)
  • docs/deploy-environment-variables.mdx (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: julienvanbeveren
Repo: triggerdotdev/trigger.dev PR: 2417
File: apps/webapp/app/routes/api.v1.projects.$projectRef.envvars.$slug.import.ts:56-61
Timestamp: 2025-08-19T09:49:07.011Z
Learning: In the Trigger.dev codebase, environment variables should default to `isSecret: false` when not explicitly marked as secrets in the syncEnvVars functionality. This is the intended behavior for both regular variables and parent variables.
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 2155
File: hosting/docker/.env.example:4-7
Timestamp: 2025-06-06T23:55:01.933Z
Learning: In the trigger.dev project, .env.example files should contain actual example secret values rather than placeholders, as these help users understand the expected format. The files include clear warnings about not using these defaults in production and instructions for generating proper secrets.
📚 Learning: 2025-06-06T23:55:01.933Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 2155
File: hosting/docker/.env.example:4-7
Timestamp: 2025-06-06T23:55:01.933Z
Learning: In the trigger.dev project, .env.example files should contain actual example secret values rather than placeholders, as these help users understand the expected format. The files include clear warnings about not using these defaults in production and instructions for generating proper secrets.

Applied to files:

  • docs/deploy-environment-variables.mdx
📚 Learning: 2025-08-19T09:49:07.011Z
Learnt from: julienvanbeveren
Repo: triggerdotdev/trigger.dev PR: 2417
File: apps/webapp/app/routes/api.v1.projects.$projectRef.envvars.$slug.import.ts:56-61
Timestamp: 2025-08-19T09:49:07.011Z
Learning: In the Trigger.dev codebase, environment variables should default to `isSecret: false` when not explicitly marked as secrets in the syncEnvVars functionality. This is the intended behavior for both regular variables and parent variables.

Applied to files:

  • docs/deploy-environment-variables.mdx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to trigger.config.ts : Declare build options and extensions (external, jsx, conditions, extensions) via the build block in trigger.config.ts rather than custom scripts

Applied to files:

  • docs/deploy-environment-variables.mdx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import Trigger.dev APIs from "trigger.dev/sdk/v3" when writing tasks or related utilities

Applied to files:

  • docs/deploy-environment-variables.mdx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to trigger.config.ts : Provide a valid Trigger.dev configuration using defineConfig with project ref and dirs (e.g., ["./trigger"]; tests/specs auto-excluded)

Applied to files:

  • docs/deploy-environment-variables.mdx
📚 Learning: 2025-08-29T10:06:49.293Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-08-29T10:06:49.293Z
Learning: Applies to {apps/webapp/app/**/*.server.{ts,tsx},apps/webapp/app/routes/**/*.ts} : Access environment variables only via the env export from app/env.server.ts; do not reference process.env directly

Applied to files:

  • docs/deploy-environment-variables.mdx
📚 Learning: 2025-11-10T09:09:07.392Z
Learnt from: myftija
Repo: triggerdotdev/trigger.dev PR: 2663
File: apps/webapp/app/env.server.ts:1205-1206
Timestamp: 2025-11-10T09:09:07.392Z
Learning: In the trigger.dev webapp, S2_ACCESS_TOKEN and S2_DEPLOYMENT_LOGS_BASIN_NAME environment variables must remain optional until an OSS version of S2 is available, to avoid breaking environments that don't have S2 provisioned.

Applied to files:

  • docs/deploy-environment-variables.mdx

@matt-aitken matt-aitken merged commit 8cec3b7 into triggerdotdev:main Nov 13, 2025
1 check passed
@matt-aitken
Copy link
Member

Thanks @lindseystead, this is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to use .env.production or dotenvx?

2 participants