netlify-edge-functions

Write and deploy Netlify Edge Functions on the Deno runtime for request manipulation.

Updated May 19, 2026
One-click install
npx skills add https://github.com/costrict-plugins-repo/anthropic-netlify-skills --skill netlify-edge-functions-costrict-plugins-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-edge-functions
Source: https://github.com/costrict-plugins-repo/anthropic-netlify-skills/tree/main/codex/skills/netlify-edge-functions
Command: npx skills add https://github.com/costrict-plugins-repo/anthropic-netlify-skills --skill netlify-edge-functions-costrict-plugins-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @netlify/edge-functions.

What problem does it solve? It guides you through writing, routing, and deploying Netlify Edge Functions correctly, avoiding silent failures like unrouted functions, misconfigured caching, and conflicts with framework-generated middleware. ## Core Features & Use Cases - Request/Response Manipulation: Implement redirects, same-site rewrites, middleware transforms, and auth checks using the default-export handler and Context object with geo, cookies, and params. - Routing & Configuration: Configure path, excludedPath, method, and header matching via inline config exports or netlify.toml, with control over execution ordering. - Response Caching & Error Handling: Opt into CDN caching with cache: "manual" plus cache headers, and configure onError behavior (fail, bypass, or custom path). - Use Case: Add geolocation-based redirects so visitors from Paris see a localized sale page, or run A/B testing and auth middleware at the edge with under 50 ms CPU time. ## Quick Start Ask the agent to create a Netlify edge function that redirects visitors based on their geolocation and routes it to a specific path.

Frequently Asked Questions about netlify-edge-functions

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

FAQPage Schema
How do I create a Netlify Edge Function?

Create a TypeScript or JavaScript file in netlify/edge-functions that default-exports an async handler receiving (request, context), and export a config object with a path. Import the Config and Context types from @netlify/edge-functions.

Why is my Netlify edge function not running?

Edge functions are not auto-assigned a URL, so a missing config export or netlify.toml declaration means the function deploys but never executes. Check that a path route is declared first, since no build error or warning appears.

Edge functions vs serverless functions on Netlify?

Use edge functions for low-latency request manipulation, geolocation, auth redirects, and personalization. Use serverless functions for long-running work up to 15 minutes, heavy Node dependencies, database operations, or memory needs above 512 MB.

How do I cache edge function responses on Netlify?

Set cache: "manual" in the function config and return a Response with Cache-Control headers such as public, s-maxage=3600. Both parts are required; headers alone or config alone cache nothing.

Can I use npm packages in Netlify Edge Functions?

Yes, npm package support is in beta: install packages and import them by name. Packages needing native binaries or runtime dynamic imports may fail, so prefer node: built-ins or Deno URL imports like esm.sh.

What are the limitations of Netlify Edge Functions?

Limits include 20 MB compressed code size, 512 MB memory, and 50 ms CPU per request. Edge functions do not run with Split Testing enabled, custom headers do not apply, and prerendering is skipped for edge-served paths.