netlify-functions

Write Netlify serverless functions using modern default export and Config syntax.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/JamesMitofsky/tag-archive --skill netlify-functions-jamesmitofsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-functions
Source: https://github.com/JamesMitofsky/tag-archive/tree/main/.claude/skills/netlify-functions
Command: npx skills add https://github.com/JamesMitofsky/tag-archive --skill netlify-functions-jamesmitofsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @netlify/functions.

What problem does it solve? Writing Netlify Functions involves many subtle rules — modern vs legacy handler syntax, path routing, background and scheduled execution, region and memory configuration, and runtime file bundling — and getting any of them wrong leads to functions that work locally but fail in production. ## Core Features & Use Cases - Modern Function Patterns: Enforces the default export + Config pattern with TypeScript, covering path routing, method routing, streaming responses, and context object usage. - Specialized Function Types: Guides creation of background functions (15-minute tasks), scheduled cron functions, and event handlers for deploy and Identity lifecycle events. - Production Pitfall Prevention: Documents resource limits, environment variable size caps, region defaults, and the included_files requirement for runtime file reads. - Use Case: You need an API endpoint that processes a form submission, runs a long task in the background, and a nightly cron job — this Skill ensures each function uses the correct config, timeout model, and deployment pattern. ## Quick Start Create a Netlify Function at /api/items that handles GET and POST requests using the modern default export syntax.

Frequently Asked Questions about netlify-functions

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

FAQPage Schema
How do I write a Netlify Function with the modern syntax?

Export a default async function receiving a standard Request and a Netlify Context, and export a Config object for routing. Place the file in netlify/functions/ and avoid the legacy exports.handler pattern.

How do I create a scheduled cron function on Netlify?

Set a schedule in the config export using shortcuts like @hourly or a cron expression. Scheduled functions have a 30-second timeout, run only on published deploys, and have no public HTTP URL.

Why does my Netlify Function fail to read files in production?

Only imported modules are bundled; files read from disk at runtime are not deployed. Declare them with included_files in netlify.toml, or import static data as a module instead.

What is the difference between background and scheduled Netlify Functions?

Background functions run up to 15 minutes and return an immediate 202 to the client. Scheduled functions run on a UTC cron schedule with a 30-second timeout and cannot be triggered over HTTP.

Can I set the region or memory for a Netlify Function?

Yes, via config.region and config.memory, but defaults (cmh region, 1024 MB) fit most workloads. Only override them for documented needs like data residency or memory-intensive processing.