DeployKit

Promise client

Every method on createClient, from @deploykit/node.

import { createClient } from "@deploykit/node/vercel" // or "@deploykit/node/cloudflare"

const deploykit = createClient(options)

Options are the provider's Vercel or Cloudflare client options.

Every method returns a Promise and takes an optional last argument with signal. For deploy methods, signal goes in the deploy options. Errors are thrown as the classes in Errors, plus AbortError and ClientClosedError.

Apps

MethodReturnsNotes
createApp(name)App{ id, name }
getApp(appId)App
deleteApp(appId)voidDeletes the project and all its deployments
findAppByName(name)App | undefinedOptional capability adoptByName
setAccess(appId, access)voidVercel only. See Access control

Deploying

MethodReturnsNotes
deploy(appId, artifact, options?)DeploymentSee Deploying
deployDirectory(appId, directory, options?)DeploymentEvery file under directory
deployManifest(appId, manifest, read, options?)Deploymentmanifest is JSON or an object. See Manifests
getDeployment(appId, deploymentId)DeploymentCurrent status

Activation (Vercel)

MethodReturnsNotes
activateDeployment(appId, deploymentId)ActivationSee Activation
getActivation(appId, deploymentId)Activation
reconcileDeployment(appId, operationId)ReconciliationFind a deployment after a lost response

Client

MethodReturnsNotes
getCapabilities()CapabilitiesWhat this provider supports
close()voidCancel running calls and release resources. See Lifecycle
[Symbol.asyncDispose]Same as close, for await using

Helpers from @deploykit/node

These don't need a client.

FunctionReturns
artifactFromDirectory(directory)Artifact
artifactFromFiles(files)Artifact. Each file is { path, text }, { path, bytes } or { path, file }
artifactFromManifest(manifest, read)Artifact
manifestFromDirectory(directory, { source })Manifest
manifestFromArtifact(artifact, { source })Manifest
waitUntilServing(url, options?)The accepted HTTP status

All take an optional signal in their last argument.

See Types for App, Deployment, Activation and the rest.

Waiting

waitUntilReady(appId, deploymentId, options?) polls an existing receipt until the provider reports a terminal status. It returns failed deployments too; check status before using the URL. It can throw DeploymentTimeoutError or ProviderError.

Promise wait optionDefaultMeaning
intervalMs1000Delay between observations
timeoutMs300000Polling schedule duration
tolerateFailures3Stop on this many consecutive provider errors
signalUnsetCancel polling and in-flight requests

The schedule duration is not a hard deadline for an in-flight request. Use an AbortSignal deadline as in the quickstarts to bound the whole operation.

deployAndWait(appId, artifact, { ...deployOptions, wait }) creates and waits in one call. Unlike waitUntilReady, it raises DeploymentFailedError for a failed deployment. It does not check HTTP serving or application behavior. Use separate creation and waiting when you need to persist the receipt immediately, as the quickstarts do.

Managing existing deployments

MethodReturnsMeaning
listDeployments(appId, options?)ReadonlyArray<Deployment>One page, newest first; optional target and limit
deleteDeployment(appId, deploymentId, options?)voidDelete a deployment; adapter checks current production routing first
rollback(appId, deploymentId, options?)ActivationRequest production routing to an earlier eligible deployment

Each accepts cancellation. Listing defaults to 20 entries and clamps a finite limit to 1–100; this API does not expose a pagination cursor. Check the corresponding capability before using it. Vercel rollback returns pending activation; observe getActivation. Pages uses its own rollback endpoint and reports active on success. Neither rollback operation rebuilds the artifact. A delete pre-check is not atomic with concurrent activation: serialize these operations in your application. An ambiguous mutation still needs provider inspection before repetition.

Last updated on

On this page