Skip to content
netlify avatar

Netlify Functions

Write and deploy Netlify serverless functions in TypeScript, JavaScript, or Go, with path routing and config options.

CCM score
71 of 100
skills.sh installs
3.7K
GitHub stars
57
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the default-handler .mts shape, path routing, background and scheduled functions, streaming, and local testing with netlify dev
  • Includes context.user identity handling, context.geo and context.ip access, and context.waitUntil for post-response work
  • Enforces that config-file variables stay out of functions and that response headers are set in code, not netlify.toml
  • Designed for developers adding API endpoints, cron jobs, auth hooks, or long-running background tasks on Netlify

Install

$ npx -y skills add netlify/context-and-tools --skill netlify-functions -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Netlify Functions

Reach for the modern default-handler API (.mts TypeScript). Export a default async handler taking a web Request and a Netlify Context, returning a web Response. Avoid the legacy AWS Lambda handler shape unless writing Go or migrating old code (see Legacy at the end).

Building an app's backend? Start with Netlify Server, a long-lived server that holds connections open and keeps state between requests; use functions alongside it for individual tasks, scheduled jobs, and events. See When to use a server.

File locations

Details

Repository
github.com/netlify/context-and-tools
Categories
Backend & APIs, DevOps & Cloud
First seen
Jun 3, 2026

Questions

What does the netlify-functions skill help an agent build?

It guides writing Netlify serverless functions in TypeScript, JavaScript, or Go, covering API endpoints, backend routes, scheduled cron jobs, and long background jobs. It explains the default export handler shape that takes a Request and Context and returns a Response.

How do I install the netlify-functions skill?

Run npx -y skills add netlify/context-and-tools --skill netlify-functions -y in your project. This adds the skill so your agent can write and configure Netlify functions following the guide.

Which other skills lead the Backend & APIs category?

The netlify-functions skill sits in the Backend & APIs category, where the other top skills include entra-app-registration, neon, firebase-basics, firebase-auth-basics, and workers-best-practices. This skill sets itself apart by covering Netlify's modern default-handler syntax, path routing, and scheduled and background functions.

Does the netlify-functions skill cover secrets and environment variables?

Yes, it shows how to read environment variables and secrets with Netlify.env.get() and warns against hardcoding them. It also notes that variables set in netlify.toml are not available to functions and that their scope must include Functions.

Can I use netlify-functions for scheduled jobs and streaming responses?

Yes, the skill covers scheduled functions using cron strings, background functions for long-running work, and streaming responses. It also explains custom path routing and how to test locally with netlify dev.

More from netlify/context-and-tools

All 12

Similar to Netlify Functions

More Backend & APIs