| summary | Deploy checklist: Convex backend + Vercel web app + /api rewrites. | ||
|---|---|---|---|
| read_when |
|
ClawHub is two deployables:
- Web app (TanStack Start) → typically Vercel.
- Convex backend → Convex deployment (serves
/api/...routes).
From your local machine:
bunx convex env set APP_BUILD_SHA "$(git rev-parse HEAD)" --prod
bunx convex env set APP_DEPLOYED_AT "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" --prod
bunx convex deployOr use the GitHub Actions pipeline:
gh workflow run deploy.yml --repo openclaw/clawhub --ref mainProduction deploy notes:
deploy.ymlis manual-only (workflow_dispatch). Merging tomaindoes not deploy.- The workflow must be started from
main. - Deploy targets:
full: deploy Convex, verify contract, wait for the matching Vercel production deploy, then run smoke testsbackend: deploy Convex, verify contract, then run smoke tests against current productionfrontend: wait for the Vercel production deploy for the selectedmainSHA, then run smoke tests
frontenddoes not callvercel deploydirectly yet. It relies on the existing Vercel Git-based production deploy for that SHA.- The real deploy job uses the GitHub
Productionenvironment for deploy secrets, but it does not wait for a separate approval. - Required
Productionenvironment secret:CONVEX_DEPLOY_KEY. - Optional
Productionenvironment secret:PLAYWRIGHT_AUTH_STORAGE_STATE_JSONfor authenticated smoke coverage.
The clawhub CLI package is released separately from the app deploy.
Only stable releases are supported here: vX.Y.Z.
Use the GitHub Actions workflow:
gh workflow run clawhub-cli-npm-release.yml \
--repo openclaw/clawhub \
--ref main \
-f tag=v0.11.0 \
-f preflight_only=trueThen rerun the same workflow from main with:
- the same
tag preflight_only=falsepreflight_run_id=<successful preflight run id>
CLI release notes:
- Real publishes are manual-only and require the workflow to be started from
main. - The publish job waits at the GitHub
npm-releaseenvironment for approval. - npm auth is handled through npm trusted publishing, not an
NPM_TOKEN. - npm trusted publisher must be configured for package
clawhubwith repositoryopenclaw/clawhub, workflowclawhub-cli-npm-release.yml, and environmentnpm-release.
That workflow assumes Vercel Git integration is enabled for this repo. It does
not run vercel deploy directly; frontend-related steps wait for the GitHub
commit status Vercel – clawhub for the selected SHA, then run smoke tests
against production.
Ensure Convex env is set (auth + embeddings):
AUTH_GITHUB_IDAUTH_GITHUB_SECRETCONVEX_SITE_URLJWT_PRIVATE_KEYJWKSOPENAI_API_KEYSITE_URL(your web app URL)- Optional webhook env (see
docs/webhook.md) - Optional:
GITHUB_TOKEN(recommended; raises GitHub API limits used by publish gates)
Set env vars:
VITE_CONVEX_URLVITE_CONVEX_SITE_URL(Convex “site” URL)CONVEX_SITE_URL(same value; used by auth provider config)SITE_URL(web app URL)VITE_APP_BUILD_SHA(set to the same commit SHA stamped into Convex)
Deploy order:
- Convex
- contract verify
- wait for Vercel production deploy for the same Git SHA
- smoke
This repo currently uses vercel.json rewrites:
source: /api/:path*destination: https://<deployment>.convex.site/api/:path*
For self-host:
- update
vercel.jsonto your deployment’s Convex site URL.
The CLI can discover the API base from:
/.well-known/clawhub.json(preferred)/.well-known/clawdhub.json(legacy)
If you don’t serve that file, users must set:
export CLAWHUB_REGISTRY=https://your-site.examplecurl -i "https://<site>/api/v1/search?q=test"
curl -i "https://<site>/api/v1/skills/gifgrep"Then:
clawhub login --site https://<site>
clawhub whoamiRate-limit sanity checks:
curl -i "https://<site>/api/v1/download?slug=gifgrep"Confirm headers are present:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-ResetRateLimit-Limit,RateLimit-Remaining,RateLimit-ResetRetry-Afteron429
Drift checks:
bun run verify:convex-contract -- --prod
PLAYWRIGHT_BASE_URL=https://clawhub.ai bunx playwright test e2e/menu-smoke.pw.test.ts e2e/upload-auth-smoke.pw.test.tsThe Playwright smoke suite should fail on visible error UI, page errors, and browser console errors.
Proxy/IP caveat:
- Default IP source is
cf-connecting-ip. - For non-Cloudflare trusted proxy setups, set
TRUST_FORWARDED_IPS=true. - If a trusted client IP is missing, anonymous downloads fall back to endpoint-scoped buckets to avoid unrelated packages sharing one
ip:unknowndownload bucket. - If proxy headers are not forwarded/trusted correctly, multiple users may collapse into one IP and hit false-positive rate limits.