-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.env.example
More file actions
139 lines (127 loc) · 5.73 KB
/
Copy path.env.example
File metadata and controls
139 lines (127 loc) · 5.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# ===================================================================
# CONVEX BACKEND ENVIRONMENT VARIABLES (Convex Cloud)
# ===================================================================
# These variables are ONLY accessible from convex/*.ts files
# They run in Convex's cloud infrastructure, NOT in Next.js
#
# ⚠️ CRITICAL: DO NOT put these in .env.local - they will be IGNORED!
#
# Set these using the Convex CLI:
# npx convex env set VARIABLE_NAME "value"
#
# View all set variables:
# npx convex env list
#
# Remove a variable:
# npx convex env remove VARIABLE_NAME
# ===================================================================
# Cloudflare Stream (for video uploads via TUS protocol)
# Get from: https://dash.cloudflare.com/ → Stream → API Tokens
# CLOUDFLARE_ACCOUNT_ID=your-cloudflare-account-id
# CLOUDFLARE_STREAM_API_TOKEN=your-stream-api-token
# Cloudflare R2 (for image/file storage)
# Get from: https://dash.cloudflare.com/ → R2 → Manage R2 API Tokens
# CLOUDFLARE_R2_ACCESS_KEY_ID=your-r2-access-key
# CLOUDFLARE_R2_SECRET_ACCESS_KEY=your-r2-secret-key
# CLOUDFLARE_R2_ENDPOINT=https://xxx.r2.cloudflarestorage.com
# CLOUDFLARE_R2_BUCKET_NAME=chatkut-media
# Cloudflare Webhooks (for video processing status updates)
# Get from: Cloudflare Stream webhook configuration
# CLOUDFLARE_WEBHOOK_SECRET=your-webhook-secret
# AI Integration (for chat/planning/code generation)
# Option 1: Dedalus AI (multi-model routing - NOT YET SUPPORTED IN NODE.JS)
# Get from: https://dedalus.ai/dashboard
# DEDALUS_API_KEY=dsk_your-dedalus-api-key
#
# Option 2: Anthropic Claude (RECOMMENDED - fallback when Dedalus unavailable)
# Get from: https://console.anthropic.com/
# ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key
#
# Note: The system checks API key prefix and uses appropriate SDK:
# - Keys starting with "sk-ant-" → Anthropic SDK
# - Keys starting with "dsk_" → Dedalus SDK (when Node.js support is added)
# Remotion Lambda (for cloud video rendering)
# These are generated by: npx remotion lambda deploy
# REMOTION_AWS_REGION=us-east-1
# REMOTION_FUNCTION_NAME=remotion-render-lambda
# REMOTION_AWS_ACCESS_KEY_ID=your-aws-access-key
# REMOTION_AWS_SECRET_ACCESS_KEY=your-aws-secret
# ===================================================================
# SETUP INSTRUCTIONS
# ===================================================================
#
# 1. Install dependencies:
# npm install
#
# 2. Start Convex development:
# npx convex dev
# (This auto-generates .env.local with NEXT_PUBLIC_CONVEX_URL)
#
# 3. Set Convex environment variables (REQUIRED for backend to work):
# npx convex env set CLOUDFLARE_ACCOUNT_ID "your-account-id"
# npx convex env set CLOUDFLARE_STREAM_API_TOKEN "your-token"
# npx convex env set CLOUDFLARE_R2_ACCESS_KEY_ID "your-key"
# npx convex env set CLOUDFLARE_R2_SECRET_ACCESS_KEY "your-secret"
# npx convex env set CLOUDFLARE_R2_ENDPOINT "https://xxx.r2.cloudflarestorage.com"
# npx convex env set CLOUDFLARE_R2_BUCKET_NAME "chatkut-media"
# npx convex env set CLOUDFLARE_WEBHOOK_SECRET "your-webhook-secret"
# npx convex env set DEDALUS_API_KEY "your-dedalus-key"
#
# 4. (Optional) Set Remotion Lambda variables if using cloud rendering:
# npx convex env set REMOTION_AWS_REGION "us-east-1"
# npx convex env set REMOTION_FUNCTION_NAME "remotion-render-lambda"
# npx convex env set REMOTION_AWS_ACCESS_KEY_ID "your-aws-key"
# npx convex env set REMOTION_AWS_SECRET_ACCESS_KEY "your-aws-secret"
#
# 5. Verify all variables are set:
# npx convex env list
#
# 6. Start Next.js development server:
# npm run dev
#
# ===================================================================
# ===================================================================
# NEXT.JS FRONTEND ENVIRONMENT VARIABLES (.env.local)
# ===================================================================
# These variables are for Next.js server/client code (app/*, components/*)
# Put these in .env.local (NOT this file)
# Variables with NEXT_PUBLIC_ prefix are accessible in browser
# ===================================================================
# Convex (auto-generated by `npx convex dev`, do not edit manually)
CONVEX_DEPLOYMENT=
NEXT_PUBLIC_CONVEX_URL=
# Node.js Network Configuration
# Fix IPv6 timeout issues by preferring IPv4 DNS resolution
# Add this if you experience connection timeouts to Convex
NODE_OPTIONS=--dns-result-order=ipv4first
# Optional: Authentication (if using Clerk)
# NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
# CLERK_SECRET_KEY=sk_test_xxx
# Optional: Analytics & Monitoring
# NEXT_PUBLIC_SENTRY_DSN=
# NEXT_PUBLIC_VERCEL_ANALYTICS_ID=
# ===================================================================
# TROUBLESHOOTING
# ===================================================================
#
# Problem: "CLOUDFLARE_ACCOUNT_ID is not defined"
# Solution: You forgot to set it via CLI. Run:
# npx convex env set CLOUDFLARE_ACCOUNT_ID "your-id"
#
# Problem: "Cannot read .env.local in convex functions"
# Solution: Convex cloud ignores .env.local. Use `npx convex env set`
#
# Problem: "How do I know if a variable is for Convex or Next.js?"
# Answer: If the code is in convex/*.ts → Use `npx convex env set`
# If the code is in app/* or components/* → Use .env.local
#
# Problem: "I updated .env.local but Convex action still can't access it"
# Solution: Convex actions run in Convex cloud, not Next.js. Use CLI.
#
# ===================================================================
# MORE INFO
# ===================================================================
# See: CONVEX_ENV_VARS.md for detailed explanation
# See: README.md for complete setup instructions
# See: PRIORITIZED_IMPLEMENTATION_PLAN.md for implementation guide
# ===================================================================