# @types/request-ip

> TypeScript definitions for request-ip

Latest version **0.0.41** (published 2023-11-07) · MIT license · 635.7K weekly downloads

## Install

```sh
npm install @types/request-ip
pnpm add @types/request-ip
yarn add @types/request-ip
bun add @types/request-ip
```

## Health

**Score 60/100 (C)** — status: abandoned.

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

Warnings: no esm support; pre 1.0.

Negative: abandoned.

## Facts

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

## Links

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

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.0.41 (latest) — 2023-11-07
- 0.0.38 (ts4.3) — 2023-06-06
- 0.0.37 (ts3.6) — 2021-07-07
- 0.0.35 (ts2.8) — 2020-02-04
- 0.0.34 (ts2.3) — 2019-07-09
- 0.0.31 (ts2.0) — 2016-09-19
- 0.0.40 — 2023-10-18
- 0.0.39 — 2023-09-27
- 0.0.36 — 2021-06-21
- 0.0.33 — 2017-11-14
- 0.0.32 — 2017-10-25
- 0.0.30 — 2016-08-25
- 0.0.29 — 2016-08-19
- 0.0.28 — 2016-08-02
- 0.0.27 — 2016-07-14
- … 9 more at https://npm.io/package/@types/request-ip/versions

## README

# Installation
> `npm install --save @types/request-ip`

# Summary
This package contains type definitions for request-ip (https://github.com/pbojinov/request-ip).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/request-ip.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/request-ip/index.d.ts)
````ts
/// <reference types="node" />

import * as http from "http";

interface RequestHeaders extends http.IncomingHttpHeaders {
    "x-client-ip"?: string | undefined;
    "x-forwarded-for"?: string | undefined;
    "x-real-ip"?: string | undefined;
    "x-cluster-client-ip"?: string | undefined;
    "x-forwarded"?: string | undefined;
    "forwarded-for"?: string | undefined;
    "forwarded"?: string | undefined;
}

interface Request {
    headers?: RequestHeaders;
    connection?: {
        remoteAddress?: string | undefined;
        socket?: {
            remoteAddress?: string | undefined;
        } | undefined;
    } | undefined;
    info?: {
        remoteAddress?: string | undefined;
    } | undefined;
    socket?: {
        remoteAddress?: string | undefined;
    } | undefined;
}

interface Options {
    attributeName: string;
}

export declare function getClientIp(req: Request): string | null;

export function mw(options?: Options): (req: Request, res: any, next: any) => any;

declare global {
    namespace Express {
        interface Request {
            clientIp?: string | undefined;
        }
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Adam Babcock](https://github.com/mrhen).

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