# @netlify/functions

> TypeScript utilities for interacting with Netlify Functions

Latest version **6.0.0** (published 2026-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @netlify/functions
pnpm add @netlify/functions
yarn add @netlify/functions
bun add @netlify/functions
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-08-18 |
| First published | 2021-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.12.0 |
| Dependencies | 1 |
| Unpacked size | 41.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 26 |
| Author | Netlify Inc. |
| Maintainers | netlify-bot, mikewen, youvalv, serhalp-netlify, mlgualtieri-gatsby |

## Links

- npm: https://www.npmjs.com/package/@netlify/functions
- Repository: https://github.com/netlify/primitives
- Homepage: https://github.com/netlify/primitives#readme
- Issues: https://github.com/netlify/primitives/issues
- npm.io page: https://npm.io/package/@netlify/functions

## Dependencies (1)

- [@netlify/types](https://npm.io/package/@netlify/types.md) 3.0.0

## Recent versions

- 6.0.0 (latest) — 2026-08-18
- 4.2.3 (missing) — 2025-08-27
- 1.6.0-v2api-1 (v2api) — 2023-07-10
- 1.2.0-rc (rc) — 2022-08-12
- 2.0.1-beta (beta) — 2022-07-02
- 0.7.3-streaming.12 (streaming) — 2021-09-23
- 0.7.3-handle-secrets.2 (handle-secrets) — 2021-09-02
- 5.3.0 — 2026-05-29
- 5.2.2 — 2026-05-18
- 5.2.1 — 2026-05-13
- 5.2.0 — 2026-04-09
- 5.1.5 — 2026-03-19
- 5.1.4 — 2026-03-18
- 5.1.3 — 2026-03-12
- 5.1.2 — 2025-12-21
- … 103 more at https://npm.io/package/@netlify/functions/versions

## README

# ![functions](functions.png)

[![Build](https://github.com/netlify/primitives/workflows/Build/badge.svg)](https://github.com/netlify/primitives/actions)
[![Node](https://img.shields.io/node/v/@netlify/functions.svg?logo=node.js)](https://www.npmjs.com/package/@netlify/functions)

JavaScript and TypeScript utilities for [Netlify Functions](https://docs.netlify.com/functions/overview/).

## Installation

```
npm install @netlify/functions
```

## Usage

### On-demand Builders

To use On-demand Builders, wrap your function handler with the `builder` function.

- With JavaScript:

  ```js
  const { builder } = require('@netlify/functions')

  const handler = async (event, context) => {
    return {
      statusCode: 200,
      body: JSON.stringify({ message: 'Hello World' }),
    }
  }

  exports.handler = builder(handler)
  ```

- With TypeScript:

  ```ts
  import { builder, Handler } from '@netlify/functions'

  const myHandler: Handler = async (event, context) => {
    return {
      statusCode: 200,
      body: JSON.stringify({ message: 'Hello World' }),
    }
  }

  const handler = builder(myHandler)

  export { handler }
  ```

### Scheduled Functions (currently in beta)

To use Scheduled Functions, wrap your function handler with the `schedule` function.

- With JavaScript:

  ```js
  const { schedule } = require('@netlify/functions')

  exports.handler = schedule('5 4 * * *', async () => {
    console.log("It's 04:05 AM!")
  })
  ```

- With TypeScript:

  ```ts
  import { schedule } from '@netlify/functions'

  export const handler = schedule('5 4 * * *', async () => {
    console.log("It's 04:05 AM!")
  })
  ```

### TypeScript typings

This module exports typings for authoring Netlify Functions in TypeScript.

```ts
import { Handler } from '@netlify/functions'

const handler: Handler = async (event, context) => {
  return {
    statusCode: 200,
    body: JSON.stringify({ message: 'Hello World' }),
  }
}

export { handler }
```

The following types are exported:

- `Handler`
- `HandlerCallback`
- `HandlerContext`
- `HandlerEvent`
- `HandlerResponse`

## Contributors

Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks
for contributing!

---
_Source: https://npm.io/package/@netlify/functions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
