← NetlifyCONTENT HISTORY

Update to Netlify

Snapshot Sep 30, 2026 · 23:18 UTC · version 1.0.0

Collection source: not recorded for this historical snapshot. These snapshots do not have a confirmed matching collection source. Differences in file lists alone do not establish changes to the package.

WHAT CHANGED · RULE-BASED ANALYSIS

Supporting file metadata differs

Newly listed paths: LICENSE.txt, agents/openai.yaml. This compares saved file lists, not package contents; a different collection source can change the list.

Observed in package metadata. These changes alone do not establish a new customer-facing feature.

Supporting files

Before

[{"relative_path":"assets/netlify-small.svg","size_in_bytes":1291},{"relative_path":"assets/netlify.png","size_in_bytes":2686}]

After

[{"relative_path":"LICENSE.txt","size_in_bytes":10776},{"relative_path":"agents/openai.yaml","size_in_bytes":352},{"relative_path":"assets/netlify-small.svg","size_in_bytes":1291},{"relative_path":"assets/netlify.png","size_in_bytes":2686}]

Compare saved observations

Download comparison JSON
Full technical diff · 1 changed fields

changed /included_files

BEFORE
[
  {
    "relative_path": "assets/netlify-small.svg",
    "size_in_bytes": 1291
  },
  {
    "relative_path": "assets/netlify.png",
    "size_in_bytes": 2686
  }
]
AFTER
[
  {
    "relative_path": "LICENSE.txt",
    "size_in_bytes": 10776
  },
  {
    "relative_path": "agents/openai.yaml",
    "size_in_bytes": 352
  },
  {
    "relative_path": "assets/netlify-small.svg",
    "size_in_bytes": 1291
  },
  {
    "relative_path": "assets/netlify.png",
    "size_in_bytes": 2686
  }
]
Full snapshot data
{
  "name": "netlify-functions",
  "description": "Guide for writing Netlify serverless functions. Use when creating API endpoints, background processing, scheduled tasks, or any server-side logic using Netlify Functions. Covers modern syntax (default export + Config), TypeScript, path routing, background functions, scheduled functions, streaming, and method routing.",
  "included_files": [
    {
      "relative_path": "LICENSE.txt",
      "size_in_bytes": 10776
    },
    {
      "relative_path": "agents/openai.yaml",
      "size_in_bytes": 352
    },
    {
      "relative_path": "assets/netlify-small.svg",
      "size_in_bytes": 1291
    },
    {
      "relative_path": "assets/netlify.png",
      "size_in_bytes": 2686
    }
  ],
  "skill_md_contents": "---\nname: netlify-functions\ndescription: Guide for writing Netlify serverless functions. Use when creating API endpoints, background processing, scheduled tasks, or any server-side logic using Netlify Functions. Covers modern syntax (default export + Config), TypeScript, path routing, background functions, scheduled functions, streaming, and method routing.\n---\n\n# Netlify Functions\n\n## Modern Syntax\n\nAlways use the modern default export + Config pattern. Never use the legacy `exports.handler` or named `handler` export.\n\n```typescript\nimport type { Context, Config } from \"@netlify/functions\";\n\nexport default async (req: Request, context: Context) => {\n  return new Response(\"Hello, world!\");\n};\n\nexport const config: Config = {\n  path: \"/api/hello\",\n};\n```\n\nThe handler receives a standard Web API `Request` and returns a `Response`. The second argument is a Netlify `Context` object.\n\n## File Structure\n\nPlace functions in `netlify/functions/`:\n\n```\nnetlify/functions/\n  _shared/           # Non-function shared code (underscore prefix)\n    auth.ts\n    db.ts\n  items.ts           # -> /.netlify/functions/items (or custom path via config)\n  users/index.ts     # -> /.netlify/functions/users\n```\n\nUse `.ts` or `.mts` extensions. If both `.ts` and `.js` exist with the same name, the `.js` file takes precedence.\n\n## Path Routing\n\nDefine custom paths via the `config` export:\n\n```typescript\nexport const config: Config = {\n  path: \"/api/items\",                    // Static path\n  // path: \"/api/items/:id\",            // Path parameter\n  // path: [\"/api/items\", \"/api/items/:id\"], // Multiple paths\n  // excludedPath: \"/api/items/special\", // Excluded paths\n  // preferStatic: true,                // Don't override static files\n};\n```\n\nWithout a `path` config, functions are available at `/.netlify/functions/{name}`. Setting a `path` makes the function available **only** at that path.\n\nAccess path parameters via `context.params`:\n\n```typescript\n// config: { path: \"/api/items/:id\" }\nexport default async (req: Request, context: Context) => {\n  const { id } = context.params;\n  // ...\n};\n```\n\n## Method Routing\n\n```typescript\nexport default async (req: Request, context: Context) => {\n  switch (req.method) {\n    case \"GET\":    return handleGet(context.params.id);\n    case \"POST\":   return handlePost(await req.json());\n    case \"DELETE\": return handleDelete(context.params.id);\n    default:       return new Response(\"Method not allowed\", { status: 405 });\n  }\n};\n\nexport const config: Config = {\n  path: \"/api/items/:id\",\n  method: [\"GET\", \"POST\", \"DELETE\"],\n};\n```\n\n## Background Functions\n\nFor long-running tasks (up to 15 minutes). The client receives an immediate `202` response; return values are ignored.\n\nName the file with a `-background` suffix:\n\n```\nnetlify/functions/process-background.ts\n```\n\nStore results externally (Netlify Blobs, database) for later retrieval.\n\n## Scheduled Functions\n\nRun on a cron schedule (UTC timezone):\n\n```typescript\nexport default async (req: Request) => {\n  const { next_run } = await req.json();\n  console.log(\"Next invocation at:\", next_run);\n};\n\nexport const config: Config = {\n  schedule: \"@hourly\", // or cron: \"0 * * * *\"\n};\n```\n\nShortcuts: `@yearly`, `@monthly`, `@weekly`, `@daily`, `@hourly`. Scheduled functions have a **30-second timeout** and only run on published deploys.\n\n## Streaming Responses\n\nReturn a `ReadableStream` body for streamed responses (up to 20 MB):\n\n```typescript\nexport default async (req: Request) => {\n  const stream = new ReadableStream({ /* ... */ });\n  return new Response(stream, {\n    headers: { \"Content-Type\": \"text/event-stream\" },\n  });\n};\n```\n\n## Context Object\n\n| Property | Description |\n|---|---|\n| `context.params` | Path parameters from config |\n| `context.geo` | `{ city, country: {code, name}, latitude, longitude, subdivision, timezone, postalCode }` |\n| `context.ip` | Client IP address |\n| `context.cookies` | `.get()`, `.set()`, `.delete()` |\n| `context.deploy` | `{ context, id, published }` |\n| `context.site` | `{ id, name, url }` |\n| `context.account.id` | Team account ID |\n| `context.requestId` | Unique request ID |\n| `context.waitUntil(promise)` | Extend execution after response is sent |\n\n## Environment Variables\n\nUse `Netlify.env` (not `process.env`) inside functions:\n\n```typescript\nconst apiKey = Netlify.env.get(\"API_KEY\");\n```\n\n## Resource Limits\n\n| Resource | Limit |\n|---|---|\n| Synchronous timeout | 60 seconds |\n| Background timeout | 15 minutes |\n| Scheduled timeout | 30 seconds |\n| Memory | 1024 MB |\n| Buffered payload | 6 MB |\n| Streamed payload | 20 MB |\n\n## Framework Considerations\n\nFrameworks with server-side capabilities (Astro, Next.js, Nuxt, SvelteKit, TanStack Start) typically generate their own serverless functions via adapters. You usually do not write raw Netlify Functions in these projects — the framework adapter handles server-side rendering and API routes. Write Netlify Functions directly when:\n\n- Using a client-side-only framework (Vite + React SPA, vanilla JS)\n- Adding background or scheduled tasks to any project\n- Building standalone API endpoints outside the framework's routing\n\nSee the **netlify-frameworks** skill for adapter setup.\n"
}

SHA-256: 72f84b3d8f3e17fb1d6b128aabe353d2a75edcb77a43beec989b9329922491ff