Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/vercel

src/create-deployment.js

19 lines · 988 B · JavaScript
import { createDeployment } from './vercel.js'

/**
 * Create a Vercel deployment from a git source or uploaded files.
 * Requires `dryRun: true` to preview or `confirm: true` to write.
 * @param {Object} input
 * @param {string} [input.name] Deployment name (or pass `project`).
 * @param {string} [input.target] `production` or `staging`. Omit unless confirmed.
 * @param {boolean} [input.dryRun] Return the request preview without creating a deployment.
 * @param {boolean} [input.confirm] Required for the live write.
 * @returns {Promise<Record<string, unknown>>} Created deployment or dry-run preview.
 * @example
 * import createDeployment from 'kody:@kody/vercel/create-deployment'
 * const preview = await createDeployment({ name: 'example-app', target: 'preview', dryRun: true })
 * // => { dryRun: true, method: 'POST', path: '/v13/deployments', body: { … } }
 */
export default async function createDeploymentEntrypoint(input = {}) {
	return await createDeployment(input)
}