vercel-functions

Configure, debug, and optimize Vercel Serverless and Edge Functions.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill vercel-functions-dsgalkar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-functions
Source: https://github.com/dsgalkar/dnyaneshwar_portfolio/tree/main/.agents/plugins/vercel/skills/vercel-functions
Command: npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill vercel-functions-dsgalkar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It guides developers through building, configuring, and troubleshooting server-side code on Vercel, covering runtime selection, timeouts, streaming, WebSockets, and common serverless pitfalls. ## Core Features & Use Cases - Runtime Guidance: Choose between Node.js Serverless Functions, Edge Functions, Bun, and Rust runtimes based on latency, API, and dependency needs. - Fluid Compute & Streaming: Configure maxDuration, memory, background processing with waitUntil/after, and SSE streaming on both runtimes. - Realtime & Scheduling: Implement WebSockets (ws, Socket.IO, experimental_upgradeWebSocket) and Cron Jobs with authenticated endpoints. - Use Case: When a Next.js route handler times out or a developer tries to add Socket.IO to an API route, this Skill provides the correct Vercel-native pattern and diagnostics. ## Quick Start Ask how to add a streaming API route or WebSocket endpoint to your Vercel project and follow the provided runtime and configuration guidance.

Frequently Asked Questions about vercel-functions

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

FAQPage Schema
How do I create a serverless API route on Vercel?

Create a route handler file like app/api/hello/route.ts and export named functions such as GET or POST that return a Response. Vercel deploys these as Serverless Functions on the Node.js runtime by default.

Edge Functions vs Serverless Functions on Vercel, which should I use?

Use Edge Functions for ultra-low latency tasks like auth checks and redirects, since they cold start in under 1ms but lack full Node.js APIs. Use Serverless Functions when you need npm packages, database connections, or longer execution durations.

Does Vercel support WebSockets in serverless functions?

Yes, Vercel Functions support bidirectional WebSocket connections on Fluid Compute using libraries like ws or Socket.IO. In Next.js, use experimental_upgradeWebSocket from @vercel/functions inside a route handler.

Do I need the Edge runtime for streaming or SSE on Vercel?

No, streaming responses and Server-Sent Events work on the default Node.js runtime with Fluid Compute. Staying on Node.js keeps full API access, npm packages, and longer durations.

Why does my Vercel function return a 504 timeout error?

All plans default to 300s execution with Fluid Compute, extendable to 800s on Pro and Enterprise via maxDuration in vercel.json. For tasks lasting hours, move the logic to the Vercel Workflow SDK for durable execution.

Can I use Express.js in Vercel Functions?

Express middleware, req/res objects, and app.listen() do not work in Vercel's serverless model. Replace Express with Next.js route handlers exporting GET/POST functions that use the Web Request/Response API.