-
Notifications
You must be signed in to change notification settings - Fork 134
fix: include a .env.example file, add clarification around required environment variables (fixes #74)
#80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
robskinney
wants to merge
1
commit into
vercel-labs:main
Choose a base branch
from
robskinney:robskinney/update-env-documentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+51
−12
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ## Database | ||
| DATABASE_URL=postgresql://user:password@localhost:5432/workflow_builder | ||
|
|
||
| ## Better Auth | ||
| BETTER_AUTH_SECRET=your-secret-key # Generate with: openssl rand -base64 32 | ||
| BETTER_AUTH_URL=http://localhost:3000 | ||
|
|
||
| # GitHub | ||
| GITHUB_CLIENT_ID= | ||
| GITHUB_CLIENT_SECRET= | ||
| NEXT_PUBLIC_GITHUB_CLIENT_ID= | ||
|
|
||
| GOOGLE_CLIENT_ID= | ||
| GOOGLE_CLIENT_SECRET= | ||
| NEXT_PUBLIC_GOOGLE_CLIENT_ID= | ||
|
|
||
| ## AI Gateway (for AI workflow generation) | ||
| AI_GATEWAY_API_KEY=your-openai-api-key | ||
|
|
||
| ## API URL (for application Route Handlers) | ||
| NEXT_PUBLIC_API_URL=http://localhost:3000 | ||
|
|
||
| ## Credentials Encryption | ||
| INTEGRATION_ENCRYPTION_KEY=your-32-byte-hexadecimal-key # Generate with: openssl rand -hex 32 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing environment variable
NEXT_PUBLIC_APP_URLwhich is used by the authentication fallback logic. The PR documentation updated variable names without updating the corresponding code.View Details
📝 Patch Details
Analysis
Missing environment variable documentation for
NEXT_PUBLIC_APP_URLWhat fails: Authentication fails in custom deployments (non-Vercel) when users follow only the documented environment variables. The
getBaseURL()function inlib/auth.ts(lines 38-40) checks forNEXT_PUBLIC_APP_URLas a Priority 2 fallback for determining the authentication base URL, but this variable is not documented in.env.example, causing users to not set it.How to reproduce:
NEXT_PUBLIC_API_URLbut skip undocumentedNEXT_PUBLIC_APP_URLBETTER_AUTH_URL(assuming only documented vars are needed)Result:
getBaseURL()falls through all documented priorities (noBETTER_AUTH_URL, noVERCEL_URL) and returns hardcodedhttp://localhost:3000regardless of actual deployment URL, causing authentication endpoints to fail with CORS or connection errors.Expected:
NEXT_PUBLIC_APP_URLshould be documented in.env.example(alongsideNEXT_PUBLIC_API_URL) so users can properly configure the authentication base URL for custom deployments. The priority chain inlib/auth.tsis:BETTER_AUTH_URL(Priority 1 - documented)NEXT_PUBLIC_APP_URL(Priority 2 - was undocumented)VERCEL_URL(Priority 3 - auto-set by Vercel)http://localhost:3000(Priority 4 - hardcoded fallback)Fix: Added
NEXT_PUBLIC_APP_URLto.env.examplewith documentation explaining it as a fallback/alternative toBETTER_AUTH_URLfor scenarios requiring per-environment configuration outside of Vercel deployments.