---
title: Generated types
description: "sproutboat types writes sproutboat-env.d.ts so env and the handler are fully typed."
---

`sproutboat types` declares your project's binding names and shapes, so your editor can check `env.SESSIONS` and the handler's parameters.

```sh npm
npx sproutboat types       # writes sproutboat-env.d.ts
```

```sh pnpm
pnpm sproutboat types       # writes sproutboat-env.d.ts
```

```sh bun
bunx sproutboat types      # writes sproutboat-env.d.ts
```

```sh yarn
yarn sproutboat types       # writes sproutboat-env.d.ts
```

The file declares a global `env` with one property per binding, typed by kind, and references the binding types shipped with the CLI. Commit it, and add it to your tsconfig's `include`.

:::note
`dev` and `deploy` rewrite `sproutboat-env.d.ts` whenever it no longer matches `sproutboat.jsonc`, so a binding you just added shows up without asking. They create the file only in a project that has a `tsconfig.json`.
:::

## Handler typing

With a `compatibility_date` of `2026-09-28` or later, the handler receives `(request, env, ctx)`. Type it with `WorkersHandler`:

```ts
export default {
  fetch(request, env, ctx) {
    return new Response(env.SITE);
  },
} satisfies WorkersHandler<typeof env>;
```

With an earlier date, the handler receives `(request, ctx)`; type it with `SproutboatHandler`.
