Vercel app
The Vercel app deploys Vercel projects again when a Picked project publishes a workspace. It connects to Vercel through the Picked Vercel Integration.
How to deploy to Vercel when you publish gives the steps.
Manifest
| Property | Value |
|---|---|
handle | vercel-deploy |
name | Vercel |
scopes | None. The app asks for no access to the project data. |
offlineAccess | Not set |
events | workspace.published |
slots | app-home, workspace-postpublish-actions |
workflowTools | trigger_deploy |
See App manifest for each property.
Slots
| Location | Title | Height | What it shows |
|---|---|---|---|
app-home | Vercel connection | 520 | The app page. See App page. |
workspace-postpublish-actions | Deploy to Vercel | 120 | A Deploy <project> button for each chosen project, in the publish modal after a workspace publishes. |
The height is in pixels.
In the publish modal, the slot shows one of these messages when it has no button:
| Message | When |
|---|---|
Connect Vercel on the Vercel app page. | The installation has no connection. |
Choose the projects to deploy on the Vercel app page. | The connection has no chosen project. |
App page
The Vercel connection page has these parts:
| Part | What it does |
|---|---|
| Connect Vercel | Opens a new window at the install page of the Picked Vercel Integration. Shows only when the installation has no connection, and the Picked environment has the integration. |
| Account line | Connected to Vercel team <team ID>, or Connected to Vercel personal account. When the installation has a configuration, (configuration <icfg_…>) follows. |
| Projects to deploy | A checkbox for each project of the Vercel team or account. The list holds 2,000 projects at most. |
| Save projects | Stores the chosen projects. Picked checks each project at Vercel first. |
| Deploy now | A Deploy <project> button for each chosen project. The button deploys that project. With no chosen project, it shows Choose a project to deploy. |
Disconnect | Removes the connection. See Removal of the connection. |
Recent deploys | A table of the last 20 deployments: When, Project, Started by (manual, publish or workflow) and Result (Deploying, or Failed: and the reason). |
When the team holds more than 2,000 projects, the page shows a message. See Messages.
Connection
Connect Vercel opens the install page of the Picked Vercel Integration on Vercel. The person chooses a Vercel team or a personal account, and approves the integration. Vercel then sends the window back to the app. The window closes.
The sign-in page of Vercel can separate the window from the app page. Then the window stays
open after the connection, and shows the result. The person then goes back to the app page.
The status line shows
The connection window closed. If you finished connecting there, it shows here, and the page
shows the connection.
The connection completes only in the browser that clicked Connect Vercel, within ten minutes. See About app authentication.
The integration asks Vercel for these permissions:
| Vercel permission | Access |
|---|---|
| Deployments | Read, write |
| Projects | Read |
A connection to a different team removes the chosen projects of the last team.
Deployments
A deployment of a chosen project has two parts:
- The app finds the last production deployment of the project with the state
READY. - The app tells Vercel to make a new production deployment from it, with
forceNew. Vercel builds the project again.
The app deploys each chosen project on its own. A failure of one project does not stop the
other projects. When a project has no READY production deployment, its deployment fails
with <project> has no ready production deployment to redeploy.
Three things start a deployment:
| Start | Started by | Projects |
|---|---|---|
| A workspace publishes | publish | Each chosen project. |
| A button | manual | The project of the button. |
| A workflow | workflow | The projects that trigger_deploy names. |
Event workspace.published
Picked sends workspace.published to the app when a workspace of the project publishes. The
app deploys each chosen project.
The app deploys one time each time that a workspace publishes. When Picked sends the same event again, with the
same eventId, the app does not deploy again. When the installation has no connection, the
app ignores the event.
Workflow tool trigger_deploy
| Property | Value |
|---|---|
| Tool name | app.<installation slug>.trigger_deploy, for example app.vercel-deploy.trigger_deploy |
| Label in workflows | Vercel: Trigger Vercel deploy |
| Effect | write |
Arguments
| Name | Label | Type | Required | Description |
|---|---|---|---|---|
project | Vercel project | string | No | The name or the ID of a chosen project. Empty, or not set, deploys each chosen project. |
Output
| Name | Label | Type | Description |
|---|---|---|---|
triggered | Projects redeployed | number | The number of projects that the call deployed. 0 in a test run. |
A test run of a workflow does not deploy. The tool returns { "triggered": 0 }. The tool
still makes its checks for a connection and a chosen project, and fails as a real run does.
Errors
| Message | When |
|---|---|
Connect Vercel on the app’s page in this project first | The installation has no connection. |
Choose the Vercel projects to deploy on the app’s page in this project first | project is empty, and the connection has no chosen project. |
<project> is not among the Vercel projects this project deploys | project names no chosen project. |
Vercel could not redeploy <project>: <message>. Redeployed <projects> | Vercel refused one or more projects. The message also names the projects that Vercel deployed. |
See How to use an app tool in a workflow.
Configuration URL
The Configuration URL of the integration is <app URL>/configure. Vercel opens it from the
Vercel dashboard, with ?configurationId=icfg_….
| Request | Answer |
|---|---|
configurationId is an icfg_ ID | A 302 redirect to <dashboard>/apps/<app ID>/open?label=vercel.configuration_id&value=<icfg_…>. |
| Other values, or an app with no app ID or no dashboard | A page with the heading Manage the Vercel integration in Picked. When the app has a dashboard, the page has an Open Picked link to it. |
The dashboard opens the installation that holds that configuration. See the guide about links to an installation.
Data that Picked keeps
The app keeps no data on its server. It keeps the data of each installation in labels of the installation in Picked:
| Label | Type | Secret | Value |
|---|---|---|---|
vercel.access_token | text | Yes | The Vercel access token. |
vercel.team_id | text | No | The Vercel team. Not set for a personal account. |
vercel.configuration_id | text | No | The integration configuration, icfg_…. The Configuration URL uses it. |
vercel.projects | json | No | The chosen projects, with id and name. |
vercel.deliveries | json | No | The last 20 deployments. |
vercel.last-event | text | No | The eventId of the last workspace.published event. |
The pages of the app never get the access token. See How to store data for an installation.
Removal of the connection
Disconnect deletes vercel.access_token, vercel.team_id, vercel.configuration_id and
vercel.projects. vercel.deliveries and vercel.last-event stay, so the Recent deploys
table stays.
The integration stays on the Vercel account. The integration has no permission to remove itself. A person removes it under Integrations in the Vercel dashboard.
Removal of the app from the project deletes all of its labels. The integration also stays on the Vercel account then.
Messages
| Message | When |
|---|---|
Waiting for Vercel… | The new window of Connect Vercel is open. |
Connected to Vercel | The connection is complete. |
Picked’s Vercel Integration is not configured on this deployment, so it cannot connect. | The Picked environment has no Vercel Integration. |
Picked’s Vercel Integration is not configured on this deployment | The new window started a connection, and the environment has no integration. |
Vercel sent no code | Vercel sent the window back with no authorization code. |
This connection link has expired or was opened in another browser; start again | The window is too old, or it is in a different browser. |
The app could not start connecting | The window did not get the install page address. |
Allow pop-ups to connect | The browser did not open the window. |
The connection window closed. If you finished connecting there, it shows here | The window closed before it sent a result. |
Vercel named a different integration configuration; start again | The configuration in the address is not the configuration of the token. |
Vercel could not be connected: <message> | Vercel refused the authorization code. |
Vercel could not be connected | The connection failed for a different reason. |
Vercel lists more projects than this page shows; the first 2,000 are listed. | The team holds more than 2,000 projects. |
Vercel lists no projects for this account. | The Vercel team or account has no project. |
Saved the projects to deploy | Save projects is complete. |
Choose the projects to deploy | The list of projects is not valid. |
Vercel has no such project for this team | A chosen project is not in the Vercel team or account. |
<project>: deploying | Vercel accepted the deployment. |
<project>: failed (<message>) | Vercel refused the deployment. |
No project to deploy | A button started a deployment with no chosen project. |
Vercel answered <status>: <message> | Vercel refused a request. |
Vercel could not be reached | The app cannot reach Vercel. |
Disconnected | Disconnect is complete. |
Sign in again | The session of the page expired. |
