Vercel to Cloudflare Worker Migration for Openclaw

A technical automation skill for migrating Next.js applications from Vercel to Cloudflare Workers with native Supabase and Hyperdrive support.

jiafar
v1.0.0
Feb 20, 2026
0
1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install vercel-to-cloudflare

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install vercel-to-cloudflare using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Vercel to Cloudflare Worker Migration?

This skill provides a comprehensive framework for transitioning Next.js projects from Vercel to the Cloudflare ecosystem. It streamlines the process of adapting Node.js-centric code to the Cloudflare Worker runtime, specifically targeting common infrastructure pain points like high egress costs and database connection limits. By leveraging Openclaw Skills, developers can seamlessly integrate the @opennextjs/cloudflare adapter and implement Hyperdrive for high-performance database connection pooling.

The skill focuses on refactoring environment variable access and database initialization patterns to ensure they are compatible with edge environments. It provides clear pathways for connecting to Supabase via direct IPv6 connections, ensuring that applications remain fast, scalable, and cost-effective when running on Cloudflare's global network.

Vercel to Cloudflare Worker Migration Use Cases

  • Reducing hosting and bandwidth costs by migrating away from Vercel.
  • Scaling Next.js applications on Cloudflare Workers for lower global latency.
  • Implementing Hyperdrive to provide connection pooling for Supabase databases.
  • Fixing connectivity issues between Cloudflare Workers and database providers by utilizing direct connection strings.

How Vercel to Cloudflare Worker Migration Works

  1. Scan the existing Next.js project using an analysis script to identify Vercel-specific dependencies.
  2. Install and configure the @opennextjs/cloudflare adapter within the project root.
  3. Refactor environment variable access from the standard Node.js process.env to the Cloudflare context-aware getCloudflareContext system.
  4. Update database singleton patterns to use per-request initialization with React cache to prevent module-level initialization errors.
  5. Configure the wrangler.toml file with necessary bindings for Hyperdrive and other Cloudflare services.
  6. Execute the migration script to apply code transformations across the repository.

Vercel to Cloudflare Worker Migration Setup

To begin the migration using Openclaw Skills, first install the necessary adapter:

npm install @opennextjs/cloudflare

Then, utilize the provided automation scripts to analyze and migrate your codebase:

# Analyze the project for migration readiness
python3 scripts/analyze_project.py <project-path>

# Run the migration transformation
python3 scripts/migrate.py <project-path>

Vercel to Cloudflare Worker Migration Data Schema & Taxonomy

The skill manages the migration process by modifying specific project configurations and directory structures:

Component Implementation Details
wrangler.toml Stores Cloudflare Worker metadata, compatibility dates, and Hyperdrive bindings.
next.config.js Updated to include the OpenNext adapter for Cloudflare compatibility.
Environment Variables Transitioned to a structured object accessed via getCloudflareContext().env.
Database Clients Refactored from global singletons to cached, per-request instances.
Scripts Directory Contains the analyze_project.py and migrate.py logic.

Vercel to Cloudflare Worker Migration Advanced Features

  • Intelligent detection of Supabase Pooler vs. Direct Connection strings to prevent nested pooling errors.
  • Automated refactoring of Drizzle ORM and Postgres.js singleton patterns for edge compatibility.
  • Built-in support for IPv6 fallback configurations for local development with Supabase Free Tier.
  • Integrated Hyperdrive SSL management, ensuring internal Worker-to-Hyperdrive traffic is correctly configured.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*