Cloudflare API Token Setup for Headless Deploy
For: notes.hoffdesk.com on headless titanium-butler
Method: API Token (no browser required)
Step 1: Create Token in Cloudflare Dashboard
- Go to: https://dash.cloudflare.com/profile/api-tokens
- Click "Create Token"
- Click "Custom token"
Step 2: Configure These Exact Settings
| Field | Value |
|---|---|
| Token name | hoffdesk-blog-deploy |
| Permissions | |
| → Zone | Zone:Read |
| → Zone | Zone:Edit |
| → Account | Cloudflare Pages:Edit |
| → Account | Account:Read |
| Zone Resources | Include - Specific zone - hoffdesk.com |
| Account Resources | Include - Account - <your account> |
| TTL | No expiration (or set a date) |
Step 3: Get Account ID and Zone ID
While in Cloudflare Dashboard:
1. Go to: https://dash.cloudflare.com
2. Click on hoffdesk.com
3. On the right sidebar, find:
- Account ID: (looks like 1a2b3c4d5e6f...)
- Zone ID: (looks like 7g8h9i0j1k2l...)
4. Copy both
Step 4: Give Me the Credentials
Once you have the token, export it:
export CLOUDFLARE_API_TOKEN=your_token_here
Then I can run:
# Verify token works
wrangler whoami
# Create Pages project
wrangler pages project create notes-hoffdesk
# Deploy
wrangler pages deploy ~/hoffdesk-api/dist/blog --project-name=notes-hoffdesk --branch=main
Alternative: Manual Pages Setup
If API tokens get complicated, you can also:
- Go to: https://dash.cloudflare.com
- Click "Pages" in sidebar
- Click "Create a project"
- Project name:
notes-hoffdesk - Upload manually (drag-drop your
~/hoffdesk-api/dist/blogfolder)
Then add CNAME:
- Name: notes
- Target: notes-hoffdesk.pages.dev
This bypasses all CLI complexity.
Which route do you prefer?