@robinpath/vercel
0.1.1Node.jsPublicVercel module for RobinPath.
Vercel
Vercel module for RobinPath.
Package: @robinpath/vercel | Category: Devops | Type: Integration
Authentication
vercel.setToken "my-vercel-token"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the vercel module when you need to:
- List all projects in the authenticated account -- Use
vercel.listProjectsto perform this operation - Get details of a project by ID or name -- Use
vercel.getProjectto perform this operation - Create a new Vercel project -- Use
vercel.createProjectto perform this operation - Update settings of an existing project -- Use
vercel.updateProjectto perform this operation - Delete a Vercel project -- Use
vercel.deleteProjectto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setToken | Set the Vercel API bearer token for authentication | {configured} |
listProjects | List all projects in the authenticated account | {projects[], pagination} |
getProject | Get details of a project by ID or name | Project object with id, name, framework, targets, etc. |
createProject | Create a new Vercel project | Created project object |
updateProject | Update settings of an existing project | Updated project object |
deleteProject | Delete a Vercel project | {deleted, projectId} |
listDeployments | List deployments, optionally filtered by project, state, or target | {deployments[], pagination} |
getDeployment | Get details of a specific deployment | Deployment object with id, url, state, meta, etc. |
createDeployment | Create a new deployment with files | Created deployment object |
cancelDeployment | Cancel an in-progress deployment | Cancelled deployment object |
deleteDeployment | Delete a deployment | {deleted, deploymentId} |
redeployDeployment | Redeploy an existing deployment (create from existing) | New deployment object |
listDomains | List all domains in the authenticated account | {domains[], pagination} |
getDomain | Get information about a specific domain | Domain object with name, serviceType, verified, etc. |
addDomain | Register a new domain to the account | Created domain object |
removeDomain | Remove a domain from the account | {deleted, domain} |
listProjectDomains | List all domains assigned to a project | {domains[]} |
addProjectDomain | Add a domain to a project | Domain configuration object |
removeProjectDomain | Remove a domain from a project | {deleted, projectId, domain} |
getDomainConfig | Get DNS configuration for a domain | Domain DNS config with misconfigured, cnames, aValues, etc. |
verifyDomain | Verify a domain attached to a project | Verification result object |
listEnvVars | List all environment variables for a project | {envs[]} with key, value, target, type, id |
getEnvVar | Get details of a specific environment variable | Env var object with key, value, target, type |
createEnvVar | Create a new environment variable for a project | Created env var object |
updateEnvVar | Update an existing environment variable | Updated env var object |
deleteEnvVar | Delete an environment variable from a project | {deleted, projectId, envId} |
getUser | Get the authenticated user's profile | User object with id, email, name, username, etc. |
listTeams | List all teams the authenticated user belongs to | {teams[], pagination} |
getTeam | Get details of a specific team | Team object with id, slug, name, etc. |
getDeploymentLogs | Get build logs for a deployment | Array of log event objects |
Functions
setToken
Set the Vercel API bearer token for authentication
Module: vercel | Returns: object -- {configured}
vercel.setToken "my-vercel-token"
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Vercel API token |
listProjects
List all projects in the authenticated account
Module: vercel | Returns: object -- {projects[], pagination}
vercel.listProjects {"limit": 20, "search": "my-app"}
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | No | {limit, from, search} |
getProject
Get details of a project by ID or name
Module: vercel | Returns: object -- Project object with id, name, framework, targets, etc.
vercel.getProject "my-project"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
createProject
Create a new Vercel project
Module: vercel | Returns: object -- Created project object
vercel.createProject "my-app" {"framework": "nextjs"}
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name |
options | object | No | {framework, gitRepository, buildCommand, rootDirectory} |
updateProject
Update settings of an existing project
Module: vercel | Returns: object -- Updated project object
vercel.updateProject "my-project" {"buildCommand": "npm run build"}
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
options | object | Yes | Fields to update (name, framework, buildCommand, etc.) |
deleteProject
Delete a Vercel project
Module: vercel | Returns: object -- {deleted, projectId}
vercel.deleteProject "my-project"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
listDeployments
List deployments, optionally filtered by project, state, or target
Module: vercel | Returns: object -- {deployments[], pagination}
vercel.listDeployments {"projectId": "prj_abc123", "limit": 10}
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | No | {projectId, limit, state, target} |
getDeployment
Get details of a specific deployment
Module: vercel | Returns: object -- Deployment object with id, url, state, meta, etc.
vercel.getDeployment "dpl_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
deploymentId | string | Yes | Deployment ID or URL |
createDeployment
Create a new deployment with files
Module: vercel | Returns: object -- Created deployment object
vercel.createDeployment "my-app" [{"file": "index.html", "data": "<h1>Hello</h1>"}]
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name for the deployment |
files | array | Yes | Array of file objects [{file, data}] |
options | object | No | {target, gitSource} |
cancelDeployment
Cancel an in-progress deployment
Module: vercel | Returns: object -- Cancelled deployment object
vercel.cancelDeployment "dpl_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
deploymentId | string | Yes | Deployment ID |
deleteDeployment
Delete a deployment
Module: vercel | Returns: object -- {deleted, deploymentId}
vercel.deleteDeployment "dpl_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
deploymentId | string | Yes | Deployment ID or URL |
redeployDeployment
Redeploy an existing deployment (create from existing)
Module: vercel | Returns: object -- New deployment object
vercel.redeployDeployment "dpl_abc123" {"target": "production"}
| Parameter | Type | Required | Description |
|---|---|---|---|
deploymentId | string | Yes | Source deployment ID to redeploy |
options | object | No | {target, name} |
listDomains
List all domains in the authenticated account
Module: vercel | Returns: object -- {domains[], pagination}
vercel.listDomains
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | No | {limit, since, until} |
getDomain
Get information about a specific domain
Module: vercel | Returns: object -- Domain object with name, serviceType, verified, etc.
vercel.getDomain "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name |
addDomain
Register a new domain to the account
Module: vercel | Returns: object -- Created domain object
vercel.addDomain "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name to add |
options | object | No | {cdnEnabled} |
removeDomain
Remove a domain from the account
Module: vercel | Returns: object -- {deleted, domain}
vercel.removeDomain "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name to remove |
listProjectDomains
List all domains assigned to a project
Module: vercel | Returns: object -- {domains[]}
vercel.listProjectDomains "my-project"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
addProjectDomain
Add a domain to a project
Module: vercel | Returns: object -- Domain configuration object
vercel.addProjectDomain "my-project" "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
domain | string | Yes | Domain name to add |
removeProjectDomain
Remove a domain from a project
Module: vercel | Returns: object -- {deleted, projectId, domain}
vercel.removeProjectDomain "my-project" "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
domain | string | Yes | Domain name to remove |
getDomainConfig
Get DNS configuration for a domain
Module: vercel | Returns: object -- Domain DNS config with misconfigured, cnames, aValues, etc.
vercel.getDomainConfig "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name |
verifyDomain
Verify a domain attached to a project
Module: vercel | Returns: object -- Verification result object
vercel.verifyDomain "my-project" "example.com"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
domain | string | Yes | Domain name to verify |
listEnvVars
List all environment variables for a project
Module: vercel | Returns: object -- {envs[]} with key, value, target, type, id
vercel.listEnvVars "my-project"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
getEnvVar
Get details of a specific environment variable
Module: vercel | Returns: object -- Env var object with key, value, target, type
vercel.getEnvVar "my-project" "env_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
envId | string | Yes | Environment variable ID |
createEnvVar
Create a new environment variable for a project
Module: vercel | Returns: object -- Created env var object
vercel.createEnvVar "my-project" "API_KEY" "secret123" ["production", "preview"]
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
key | string | Yes | Environment variable name |
value | string | Yes | Environment variable value |
targets | array | Yes | Deployment targets: production, preview, development |
options | object | No | {type, gitBranch} type: encrypted |
updateEnvVar
Update an existing environment variable
Module: vercel | Returns: object -- Updated env var object
vercel.updateEnvVar "my-project" "env_abc123" "newValue"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
envId | string | Yes | Environment variable ID |
value | string | Yes | New value |
options | object | No | {target, type, gitBranch} |
deleteEnvVar
Delete an environment variable from a project
Module: vercel | Returns: object -- {deleted, projectId, envId}
vercel.deleteEnvVar "my-project" "env_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID or name |
envId | string | Yes | Environment variable ID |
getUser
Get the authenticated user's profile
Module: vercel | Returns: object -- User object with id, email, name, username, etc.
vercel.getUser
| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) | No | Call with no arguments |
listTeams
List all teams the authenticated user belongs to
Module: vercel | Returns: object -- {teams[], pagination}
vercel.listTeams
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | No | {limit, since, until} |
getTeam
Get details of a specific team
Module: vercel | Returns: object -- Team object with id, slug, name, etc.
vercel.getTeam "team_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
teamId | string | Yes | Team ID |
getDeploymentLogs
Get build logs for a deployment
Module: vercel | Returns: array -- Array of log event objects
vercel.getDeploymentLogs "dpl_abc123"
| Parameter | Type | Required | Description |
|---|---|---|---|
deploymentId | string | Yes | Deployment ID |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Vercel API token not set. Call vercel.setToken first. | Check the error message for details |
Vercel API error (${response.status}): ${errMsg} | Check the error message for details |
token is required | Check the error message for details |
projectId is required | Check the error message for details |
name is required | Check the error message for details |
deploymentId is required | Check the error message for details |
files must be an array | Check the error message for details |
domain is required | Check the error message for details |
@desc "List projects and validate result"
do
set $result as vercel.listProjects {"limit": 20, "search": "my-app"}
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Projects
Retrieve all items and loop through them.
@desc "Setup authentication"
do
vercel.setToken $token
enddo
@desc "List projects and iterate results"
do
set $result as vercel.listProjects {"limit": 20, "search": "my-app"}
each $item in $result
print $item
end
enddo
2. Create a new item with createProject
Create a new resource and capture the result.
@desc "Setup authentication"
do
vercel.setToken $token
enddo
@desc "Create project"
do
set $result as vercel.createProject "my-app" {"framework": "nextjs"}
print "Created: " + $result
enddo
3. Create and update workflow
Create an item and then update it.
@desc "Setup authentication"
do
vercel.setToken $token
enddo
@desc "Create project and update project"
do
set $created as vercel.createProject "my-app" {"framework": "nextjs"}
# Update the created item
vercel.updateProject "my-project" {"buildCommand": "npm run build"}
enddo
4. Check before creating
List existing items and only create if needed.
@desc "Setup authentication"
do
vercel.setToken $token
enddo
@desc "List projects and create project"
do
set $existing as vercel.listProjects {"limit": 20, "search": "my-app"}
if $existing == null
vercel.createProject "my-app" {"framework": "nextjs"}
print "Item created"
else
print "Item already exists"
end
enddo
5. Multi-step Vercel workflow
Chain multiple vercel operations together.
@desc "Setup authentication"
do
vercel.setToken $token
enddo
@desc "List projects, get project, and more"
do
set $r_listProjects as vercel.listProjects {"limit": 20, "search": "my-app"}
set $r_getProject as vercel.getProject "my-project"
set $r_createProject as vercel.createProject "my-app" {"framework": "nextjs"}
print "All operations complete"
enddo
6. Safe listProjects with validation
Check results before proceeding.
@desc "Setup authentication"
do
vercel.setToken $token
enddo
@desc "List projects and validate result"
do
set $result as vercel.listProjects {"limit": 20, "search": "my-app"}
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- docker -- Docker module for complementary functionality
- git -- Git module for complementary functionality
- github -- GitHub module for complementary functionality
- gitlab -- GitLab module for complementary functionality
- netlify -- Netlify module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
Related Modules
github
JS@robinpathv0.1.1
GitHub module for RobinPath.
bitbucket
JS@robinpathv0.1.2
Bitbucket module for RobinPath.
box
JS@robinpathv0.1.2
Box module for RobinPath.
cache
JS@robinpathv0.1.2
In-memory key-value cache with optional TTL expiration for temporary data storage
$ robinpath add @robinpath/vercel
