⚠️ Beta Stage: Photon is currently in beta. APIs may change before stable release.

Deploy your Photon application to Cloudflare Workers and Pages.

Prerequisites

npm install -g vercel
vercel login

Installation

Install the Vercel adapter:

npm install @photonjs/runtime @photonjs/vercel

Configuration

Vite Configuration

Add the Vercel adapter to your Vite config:

// vite.config.ts
import { photon } from '@photonjs/runtime/vite'
import { vercel } from '@photonjs/vercel/vite'
 
export default {
  plugins: [
    photon(),
    vercel()
  ]
}

Deployment

Production

Deploy to Vercel Functions using the CLI:

# This will guide you through the setup process
vercel