vercel-functions

Configure and debug Vercel Serverless and Edge Functions, streaming, WebSockets, and Cron Jobs.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill vercel-functions-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-functions
Source: https://github.com/AarnavBaddam/skills/tree/main/vercel-functions
Command: npx skills add https://github.com/AarnavBaddam/skills --skill vercel-functions-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @vercel/functions, ws, socket.io, socket.io-client.

What problem does it solve? Choosing the right Vercel runtime, configuring function limits, and debugging timeouts or cold starts is error-prone, especially with misconceptions about streaming, WebSockets, and Edge versus Node.js runtimes. ## Core Features & Use Cases - Runtime Selection Guidance: Compares Serverless (Node.js), Edge, Bun, and Rust runtimes with concrete criteria for latency, API compatibility, and workload type. - Fluid Compute & Streaming: Explains concurrency, Active CPU pricing, background work with waitUntil/after, and zero-config SSE streaming on the Node.js runtime. - WebSockets & Cron Jobs: Provides working patterns for ws, Socket.IO, and Next.js upgradeWebSocket, plus vercel.json cron configuration with CRON_SECRET verification. - Diagnostics: Decision trees for 504 timeouts, 500 errors, invocation failures, cold starts, and Edge timeouts. - Use Case: You are building a realtime chat API route and unsure whether to use Edge or Node.js; this Skill shows you how to hold WebSocket connections on Fluid Compute and handle reconnects with backoff. ## Quick Start Ask the assistant how to add a streaming SSE endpoint or WebSocket handler to a Vercel API route and which runtime to choose.

Frequently Asked Questions about vercel-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream responses from a Vercel Function?

Return a Response wrapping a ReadableStream with a text/event-stream content type from your route handler. Streaming works on the default Node.js runtime with Fluid Compute, so you do not need to switch to the Edge runtime for SSE.

Do Vercel Functions support WebSockets?

Yes, Vercel Functions hold open bidirectional WebSocket connections on Fluid Compute using libraries like ws or Socket.IO. In Next.js, use experimental_upgradeWebSocket from @vercel/functions, and configure Socket.IO clients to use the websocket transport instead of long-polling.

Should I use Edge or Node.js runtime for my API route?

Use the Node.js runtime when you need full Node.js APIs, npm packages, or database connections. Choose Edge for ultra-low cold starts on simple logic like auth checks, redirects, and A/B testing, since Edge lacks fs, native modules, and full crypto support.

Why is my Vercel Function timing out with a 504 error?

All plans default to 300s with Fluid Compute, and Pro or Enterprise can extend maxDuration up to 800s in vercel.json. For tasks lasting hours, use Workflow DevKit, and for slow database queries add connection pooling such as the Neon serverless driver.

How do I schedule Cron Jobs on Vercel?

Define a crons array in vercel.json with a path and schedule expression for each job. Secure the endpoint by checking the authorization header against the CRON_SECRET environment variable before running scheduled work.

What are the limits of Vercel Edge Functions?

Edge Functions have a 25-second hard execution limit that is not configurable and lack full Node.js APIs like fs and native modules. Move heavy computation to Node.js Serverless Functions or stream early and finish work in the background with waitUntil.