Skip to content

Commit f7cc7ea

Browse files
authored
Merge pull request #239 from roerohan/rmukherjee/update-readme
fix: added instructions for token creation
2 parents fe89acd + ea3f110 commit f7cc7ea

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.dev.vars.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#CUSTOM_DOMAIN="your-domain.com" # Your custom domain for CORS
33
#ENVIRONMENT="prod" # Options: dev, staging, prod
44

5+
# Cloudflare Credentials (Required for manual deployment via `bun run deploy`)
6+
# These are automatically provided when using "Deploy to Cloudflare" button
7+
# Get these from: https://dash.cloudflare.com/profile/api-tokens
8+
#CLOUDFLARE_API_TOKEN="" # API token with Account-level permissions (see README for required permissions)
9+
#CLOUDFLARE_ACCOUNT_ID="" # Your Cloudflare account ID
10+
511
# Essential Secrets:
612
#CLOUDFLARE_AI_GATEWAY_TOKEN="" # If this has read and edit permissions, the AI Gateway will be created automatically. run is required at the least
713

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,53 @@ The setup script will guide you through:
332332

333333
After setup, start the development server:
334334

335+
#### Required for Manual Deployment
336+
337+
If you're deploying manually using `bun run deploy`, you **must** set these environment variables:
338+
339+
**Cloudflare API Token & Account ID:**
340+
341+
1. **Get your Account ID**:
342+
- Go to [Cloudflare Dashboard -> Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages)
343+
- Copy your Account ID from the right sidebar or URL
344+
345+
2. **Create an API Token**:
346+
- Go to [Cloudflare Dashboard -> API Tokens](https://dash.cloudflare.com/?to=/:account/api-tokens)
347+
- Click "Create Token" → Use custom token
348+
- Configure with these **minimum required permissions**:
349+
- **Account****Containers****Edit**
350+
- **Account****Secrets Store****Edit**
351+
- **Account****D1****Edit**
352+
- **Account****Workers R2 Storage****Edit**
353+
- **Account****Workers KV Storage****Edit**
354+
- **Account****Workers Scripts****Edit**
355+
- **Account****Account Settings****Read**
356+
- **Zone****Workers Routes****Edit**
357+
- Under "Zone Resources": Select "All zones from an account" → Choose your account
358+
- Click "Continue to summary" → "Create Token"
359+
- Copy the token immediately (you won't see it again)
360+
361+
3. **Set the environment variables**:
362+
```bash
363+
export CLOUDFLARE_API_TOKEN="your-api-token-here"
364+
export CLOUDFLARE_ACCOUNT_ID="your-account-id-here"
365+
```
366+
367+
> **Note**: These credentials are automatically provided when using the "Deploy to Cloudflare" button, but are required for manual `bun run deploy`.
368+
369+
**For Local Development (.dev.vars):**
335370
```bash
336371
bun run dev
337372
```
338373

339374
Visit `http://localhost:5173` to access VibSDK locally.
340375

376+
**For Production Deployment (.prod.vars):**
377+
```bash
378+
cp .dev.vars.example .prod.vars
379+
# Edit .prod.vars with your production API keys and tokens
380+
```
381+
341382
### Production Deployment
342383

343384
Deploy to Cloudflare Workers:

0 commit comments

Comments
 (0)