Skip to main content

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.

SettingDescription
TokenVercel API token
Team idOptional — required for team-scoped deployments
Team slugOptional — 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:

CodeMeaning
broken-referenceThe HTML references a file that is missing on disk
invalid-referenceA reference is not a valid project path
large-assetA single asset is large enough to hurt load time
large-htmlThe entry HTML itself is heavy
large-bundleTotal bundle approaches Vercel's deploy-body limit
no-doctypeMissing <!DOCTYPE html> — renders in quirks mode
external-scriptThe 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:

FailureCause
FILE_NOT_FOUNDfileName does not exist in the project
Unsupported providerproviderId is not vercel-self

Deploying​

  1. Open the project and select the artifact.
  2. Open the deploy menu from the preview toolbar.
  3. Review the preflight result.
  4. Confirm.

The response records the deployment:

FieldMeaning
urlThe live preview URL
deploymentIdVercel's deployment id
statusready · link-delayed · protected · …
deploymentCountHow many times this file has been deployed
reachableAtWhen 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​

StatusMeaningWhat to do
readyLive and reachableNothing
link-delayedDeployment succeeded; the URL is not answering yetWait, then re-check the link
protectedDeployment is behind Vercel authenticationDisable deployment protection, or share access
errorDeployment failedCheck 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​

EndpointMethodDescription
/api/deploy/configGETConfig with the token masked
/api/deploy/configPUTUpdate config
/api/projects/:id/deployPOSTDeploy { fileName, providerId? }
/api/projects/:id/deploy/preflightPOSTDry-run the file set
/api/projects/:id/deploymentsGETDeployment history
/api/projects/:id/deployments/:deploymentId/check-linkPOSTRe-probe a URL

There is no CLI subcommand for deploy; use the app or the HTTP routes.