# @types/csurf

> TypeScript definitions for csurf

Latest version **1.11.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/csurf
pnpm add @types/csurf
yarn add @types/csurf
bun add @types/csurf
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.11.5 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/csurf
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csurf
- npm.io page: https://npm.io/package/@types/csurf

## Dependencies (1)

- [@types/express-serve-static-core](https://npm.io/package/@types/express-serve-static-core.md) *

## Recent versions

- 1.11.5 (latest) — 2023-11-07
- 1.11.3 (ts4.3) — 2023-09-04
- 1.11.2 (ts3.6) — 2021-07-06
- 1.11.1 (ts3.5) — 2021-04-07
- 1.11.0 (ts3.2) — 2020-11-09
- 1.9.36 (ts2.3) — 2019-10-22
- 1.9.34 (ts2.0) — 2017-08-21
- 1.11.4 — 2023-10-18
- 1.9.35 — 2017-10-25
- 1.9.33 — 2016-12-12
- 1.9.32 — 2016-09-19
- 1.9.31 — 2016-08-25
- 1.9.30 — 2016-08-11
- 1.9.29 — 2016-08-02
- 0.0.28 — 2016-07-14
- … 9 more at https://npm.io/package/@types/csurf/versions

## README

# Installation
> `npm install --save @types/csurf`

# Summary
This package contains type definitions for csurf (https://www.npmjs.org/package/csurf).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csurf.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csurf/index.d.ts)
````ts
import express = require("express-serve-static-core");

declare global {
    namespace Express {
        interface Request {
            csrfToken(): string;
        }
    }
}

declare function csurf(options?: {
    value?: ((req: express.Request) => string) | undefined;
    /**
     * @default false
     */
    cookie?: csurf.CookieOptions | boolean | undefined;
    ignoreMethods?: string[] | undefined;
    sessionKey?: string | undefined;
}): express.RequestHandler;

declare namespace csurf {
    interface CookieOptions extends express.CookieOptions {
        /**
         * @default '_csrf'
         */
        key?: string | undefined;
    }
}

export = csurf;

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
 * Dependencies: [@types/express-serve-static-core](https://npmjs.com/package/@types/express-serve-static-core)

# Credits
These definitions were written by [Hiroki Horiuchi](https://github.com/horiuchi), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

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