# Cloudflare Pages Deploy

Want to deploy a project straight to Cloudflare Pages in JavaScript or TypeScript?

Cloudflare provides the `[wrangler](https://www.npmjs.com/package/wrangler)` CLI for convenient deployments from the terminal. However, Cloudflare has no official SDK for programmatic JavaScript/TypeScript deployments.

This package extracts the deployment logic from the `wrangler` CLI (which is written in TypeScript) and exports it as a fully-typed JavaScript module.

```js
import deploy from "cloudflare-pages-deploy"

await deploy("./example-source-directory", {
	projectName: "exampleprojectname",
	branch: "production",
	productionBranch: "production"
})
```

This function bundles the logic from the Cloudflare Wrangler CLI as a script. Under the hood, it uses the exact same logic as the official CLI.