Phase 6: Credentials Setup Guide
This guide walks you through gathering all credentials needed to execute the Phase 6 orchestrator.Prerequisites
- GitHub account with org access
- Cloudflare account with full API permissions
- Neon account (optional but recommended for automation)
- Sentry account (optional but recommended for error tracking)
- PostHog account (optional but recommended for analytics)
Step 1: GitHub Personal Access Token (PAT)
Why?
- Create 6 app repositories (
wordis-bond,cypher-healing,prime-self,ijustus,the-calling,neighbor-aid) - Store secrets in GitHub Actions
- Automate repository setup
How to Generate?
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click Generate new token
-
Give it a name:
Factory Core Phase 6 - Infrastructure Setup - Set expiration: 90 days (rotate after first successful Phase 6 run)
-
Select scopes:
- ✅
repo(full control of private repositories) - ✅
admin:repo_hook(write access to hooks) - ✅
admin:org_hook(org hooks) - ✅
write:packages(publish packages) - ❌ Do NOT select
delete:packagesordelete:repo
- ✅
- Click Generate token
- Copy the token immediately (you won’t see it again)
Export as Environment Variable
Step 2: Cloudflare API Token & Account ID
Why?
- Create 7 Hyperdrive instances (database bindings)
- Manage Workers environments
- Configure rate limiting
- Deploy to Cloudflare infrastructure
Get Your Account ID
- Log in to Cloudflare Dashboard
- Click on any domain or your account
- Look for Account ID in the right sidebar (or go to Settings → Account)
- Copy it (looks like:
a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6)
Export as Environment Variable
Create API Token
- Go to Cloudflare Dashboard → Settings → API Tokens
- Click Create token (or use existing if you have one)
- Choose Create custom token
-
Required permissions:
- ✅
Cloudflare Workers Scripts - Edit(deploy workers) - ✅
Cloudflare Workers KV - Edit(for KV storage) - ✅
Hyperdrive - Edit(create/manage Hyperdrive) - ✅
Rate Limiting - Edit(configure rate limits) - ✅
Account Settings - Read(verify account)
- ✅
-
Client IP Restriction (optional but recommended):
- Add your current IP: Run
curl https://api.ipify.org - Or leave blank for machine learning/CI environments
- Add your current IP: Run
- TTL: Set to 90 days (rotate after)
- Click Create token
- Copy the token immediately
Export as Environment Variable
Verify Both
"success": true.
Step 3: Neon API Key (Optional but Recommended)
Why?
- Automate database provisioning (7 databases, schema setup, migrations)
- Faster than manual
neon project create - Tracks database IDs for Hyperdrive binding
Create API Key
- Go to Neon Dashboard → Account → API Keys
- Click Create API key
- Name it:
Factory Core Phase 6 - Copy the key immediately (you won’t see it again)
Export as Environment Variable
Verify
Step 4: Sentry Auth Token (Optional but Recommended)
Why?
- Automate error tracking project creation (6 projects)
- Capture unhandled exceptions from Cloudflare Workers
- Real-time alerting on production errors
Create Auth Token
- Go to Sentry → Settings → Auth Tokens
- Click Create New Token
-
Name it:
Factory Core Phase 6 -
Select scopes:
- ✅
project:admin(create/manage projects) - ✅
org:admin(organization settings)
- ✅
- Copy the token immediately
Export as Environment Variable
Step 5: PostHog API Key (Optional but Recommended)
Why?
- Automate analytics project creation (6 projects)
- Track user behavior, feature flags, and funnels
- Real-time dashboards
Create Project API Key
- Go to PostHog → Settings → Project Settings
- Scroll to API Keys
- Copy the Project API Key (starts with
phc_) - Or create a personal API key:
- Settings → Personal API Keys → Create
Export as Environment Variable
Complete Setup Script
Create.env.phase-6 (or add to your shell rc file):
Load before running orchestrator
Rotation Schedule
After rotation, update all CI/CD secrets in GitHub Actions.
Troubleshooting
gh auth status fails
- Check
GITHUB_TOKENformat (should start withghp_) - Regenerate PAT with correct scopes
Cloudflare API returns code: 10000 (Invalid request)
- Verify
CF_ACCOUNT_IDis correct (check dashboard again) - Ensure API token scopes include
Account Settings - Read
403 Forbidden on Neon API
- Check
NEON_API_KEYformat - Regenerate with correct organization privileges
Orchestrator hangs during Sentry/PostHog setup
- These are optional; skip if not needed
- Remove
SENTRY_AUTH_TOKENandPOSTHOG_API_KEYfrom env