Deployment
TF Design deploys an artifact to Vercel as a preview deployment, directly from the preview toolbar.
Vercel is the only supported provider (vercel-self). Any other providerId is rejected with 400 BAD_REQUEST rather than silently falling back.
Configuration
Deployment needs a Vercel token with permission to create deployments on the target account or team.
| Setting | Description |
|---|---|
| Token | Vercel API token |
| Team id | Optional — required for team-scoped deployments |
| Team slug | Optional — alternative to team id |
The config is stored at $OD_USER_STATE_DIR/vercel.json, defaulting to ~/.open-design/vercel.json, with mode 0600 because the token is a credential. Reads mask it:
curl -s http://127.0.0.1:7456/api/deploy/config
# {"providerId":"vercel-self","configured":true,"tokenMask":"••••••","teamId":"…","teamSlug":"…","target":"preview"}
Write it with PUT /api/deploy/config. Sending the masked placeholder back leaves the existing token untouched, so a client can round-trip the config without ever handling the secret.
Preflight
Preflight runs before any upload. It resolves the file set for the artifact and reports what would be sent, so a broken artifact fails locally instead of producing a broken live site.
curl -s -X POST http://127.0.0.1:7456/api/projects/<id>/deploy/preflight \
-H 'content-type: application/json' \
-d '{"fileName":"index.html"}'
Preflight is also available in the app: opening the deploy menu runs it and shows the result before the confirm step.
Warnings it reports:
| Code | Meaning |
|---|---|
broken-reference | The HTML references a file that is missing on disk |
invalid-reference | A reference is not a valid project path |
large-asset | A single asset is large enough to hurt load time |
large-html | The entry HTML itself is heavy |
large-bundle | Total bundle approaches Vercel's deploy-body limit |
no-doctype | Missing <!DOCTYPE html> — renders in quirks mode |
external-script | The page loads a script from another origin |
Warnings are informational: they do not block a deploy, but they explain almost every "it works locally and looks wrong live" report.
Common failures:
| Failure | Cause |
|---|---|
FILE_NOT_FOUND | fileName does not exist in the project |
| Unsupported provider | providerId is not vercel-self |
Deploying
- Open the project and select the artifact.
- Open the deploy menu from the preview toolbar.
- Review the preflight result.
- Confirm.
The response records the deployment:
| Field | Meaning |
|---|---|
url | The live preview URL |
deploymentId | Vercel's deployment id |
status | ready · link-delayed · protected · … |
deploymentCount | How many times this file has been deployed |
reachableAt | When the URL first became reachable |
Redeploying the same file updates the existing record rather than creating a second one, and increments deploymentCount. The URL stays stable across redeploys, so a link you have shared keeps working.
Deployment states
| Status | Meaning | What to do |
|---|---|---|
ready | Live and reachable | Nothing |
link-delayed | Deployment succeeded; the URL is not answering yet | Wait, then re-check the link |
protected | Deployment is behind Vercel authentication | Disable deployment protection, or share access |
error | Deployment failed | Check the Vercel dashboard for the build log |
POST /api/projects/:id/deployments/:deploymentId/check-link re-probes a deployment whose URL was not ready, which is how link-delayed resolves without a full redeploy.
Managing deployments
GET /api/projects/:id/deployments lists every deployment for a project with its status, URL, and timestamps. History is per file, so two artifacts in one project deploy independently.
Best practices
- Run preflight first. It is cheaper than discovering a missing asset on a live URL.
- Keep the artifact self-contained. Inlined CSS, fonts, and images deploy cleanly; external references can break behind Vercel's access rules.
- Verify in preview. The sandboxed preview and the deployed page should match; a difference usually means a remote asset.
- Deploy from the latest artifact. Deploy the file you just reviewed, not an older tab.
- Use a team-scoped token if the project lives under a Vercel team — a personal token will not have access.
Routes
| Endpoint | Method | Description |
|---|---|---|
/api/deploy/config | GET | Config with the token masked |
/api/deploy/config | PUT | Update config |
/api/projects/:id/deploy | POST | Deploy { fileName, providerId? } |
/api/projects/:id/deploy/preflight | POST | Dry-run the file set |
/api/projects/:id/deployments | GET | Deployment history |
/api/projects/:id/deployments/:deploymentId/check-link | POST | Re-probe a URL |
There is no CLI subcommand for deploy; use the app or the HTTP routes.