Skip to content

Commit 31b1f14

Browse files
committed
chore(examples): consistent env files across all examples
1 parent c26be26 commit 31b1f14

File tree

12 files changed

+34
-31
lines changed

12 files changed

+34
-31
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Get your v0 API key here: https://v0.dev/chat/settings/keys
2+
V0_API_KEY=your_v0_api_key_here
3+
AI_GATEWAY_API_KEY=your_ai_gateway_api_key_here

examples/ai-tools-example/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ This example demonstrates how to use `@v0-sdk/ai-tools` with the AI SDK to inter
1111
```
1212

1313
2. **Set up environment variables:**
14-
Create a `.env` file in this directory:
14+
Create a `.env.local` file in the root directory:
1515

16-
```env
17-
V0_API_KEY=your_v0_api_key_here
18-
AI_GATEWAY_API_KEY=your_ai_gateway_api_key_here
16+
```bash
17+
cp .env.example .env.local
1918
```
2019

2120
3. **Get your API keys:**

examples/classic-v0/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Get your v0 API key here: https://v0.dev/chat/settings/keys
2+
V0_API_KEY=your_v0_api_key_here

examples/classic-v0/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ yarn-error.log*
3232

3333
# env files (can opt-in for committing if needed)
3434
.env*
35+
!.env.example
3536

3637
# vercel
3738
.vercel

examples/classic-v0/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ A faithful recreation of the original v0.dev interface using the v0-sdk. This ex
4343
pnpm install
4444
```
4545

46-
3. Set up environment variables:
46+
3. Create a `.env.local` file in the root directory:
4747

4848
```bash
49-
export V0_API_KEY=your_api_key_here
49+
cp .env.example .env.local
5050
```
5151

5252
4. Run the development server:

examples/simple-v0/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Get your v0 API key here: https://v0.dev/chat/settings/keys
2-
V0_API_KEY="your_v0_api_key"
2+
V0_API_KEY=your_v0_api_key_here
33

44
# Optional: for rate limiting
55
KV_REST_API_URL=your_upstash_redis_rest_url

examples/simple-v0/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ You can deploy your own version of Simple v0 to Vercel with one click:
2121
2. **Configure environment:**
2222
Create a `.env.local` file in the root directory:
2323

24-
```env
25-
V0_API_KEY=your_api_key_here
26-
27-
# Optional: For rate limiting (if not provided, rate limiting is disabled)
28-
KV_REST_API_URL=your_kv_rest_api_url
29-
KV_REST_API_TOKEN=your_kv_rest_api_token
24+
```bash
25+
cp .env.example .env.local
3026
```
3127

3228
- Get your v0 API key from [v0.dev/settings](https://v0.dev/settings)

examples/v0-clone/.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Auth Secret - Generate a random string for production
2+
# Generate with: openssl rand -base64 32
3+
# Or visit: https://generate-secret.vercel.app/32
4+
AUTH_SECRET=your-auth-secret-here
5+
6+
# Database URL - PostgreSQL connection string
7+
POSTGRES_URL=postgresql://user:password@localhost:5432/v0_clone
8+
# For Vercel Postgres, use the connection string from your dashboard
9+
10+
# Get your API key from https://v0.dev/chat/settings/keys
11+
V0_API_KEY=your_v0_api_key_here
12+
13+
# Optional: Use a custom API URL
14+
# V0_API_URL=http://localhost:3001/v1

examples/v0-clone/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ yarn-error.log*
3232

3333
# env files (can opt-in for committing if needed)
3434
.env*
35+
!.env.example
3536

3637
# vercel
3738
.vercel

examples/v0-clone/README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,10 @@ You can deploy your own version of the v0 clone to Vercel with one click:
2929

3030
### Environment Variables
3131

32-
Create a `.env` file with all required variables:
32+
Create a `.env.local` file in the root directory:
3333

3434
```bash
35-
# Auth Secret - Generate a random string for production
36-
# Generate with: openssl rand -base64 32
37-
# Or visit: https://generate-secret.vercel.app/32
38-
AUTH_SECRET=your-auth-secret-here
39-
40-
# Database URL - PostgreSQL connection string
41-
POSTGRES_URL=postgresql://user:password@localhost:5432/v0_clone
42-
# For Vercel Postgres, use the connection string from your dashboard
43-
44-
# Get your API key from https://v0.dev/chat/settings/keys
45-
V0_API_KEY=your_v0_api_key_here
46-
47-
# Optional: Use a custom API URL
48-
# V0_API_URL=http://localhost:3001/v1
35+
cp .env.example .env.local
4936
```
5037

5138
### Database Setup
@@ -116,7 +103,7 @@ This v0 clone includes:
116103

117104
### Setup
118105

119-
1. Set up all environment variables in `.env`
106+
1. Set up all environment variables in `.env.local`
120107
2. Run database migrations with `pnpm db:migrate`
121108
3. Start the development server with `pnpm dev` or production server with `pnpm start`
122109

0 commit comments

Comments
 (0)