# @types/passport-http-bearer

> TypeScript definitions for passport-http-bearer

Latest version **1.0.42** (published 2025-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/passport-http-bearer
pnpm add @types/passport-http-bearer
yarn add @types/passport-http-bearer
bun add @types/passport-http-bearer
```

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.42 |
| Published | 2025-09-23 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51443 |
| Maintainers | types |

## Links

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

## Dependencies (3)

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

## Recent versions

- 1.0.42 (latest) — 2025-09-23
- 1.0.41 (ts4.5) — 2023-11-21
- 1.0.37 (ts3.6) — 2021-07-07
- 1.0.36 (ts3.1) — 2020-09-15
- 1.0.35 (ts2.8) — 2020-04-04
- 1.0.34 (ts2.3) — 2019-10-14
- 1.0.30 (ts2.1) — 2016-09-19
- 1.0.40 — 2023-11-07
- 1.0.39 — 2023-10-18
- 1.0.38 — 2023-09-24
- 1.0.33 — 2018-05-09
- 1.0.32 — 2018-04-03
- 1.0.31 — 2017-10-25
- 1.0.29 — 2016-07-14
- 1.0.28-alpha — 2016-07-08
- … 8 more at https://npm.io/package/@types/passport-http-bearer/versions

## README

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

import passport = require("passport");
import express = require("express");
import koa = require("koa");

interface IStrategyOptions {
    scope?: string | string[] | undefined;
    realm?: string | undefined;
    passReqToCallback?: boolean | undefined;
}
interface IVerifyOptions {
    message?: string | undefined;
    scope?: string | string[];
}

interface VerifyFunction {
    (token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void;
}

interface IKoaContextContainer {
    ctx: koa.Context;
}
type KoaPassportExpressRequestMock = Partial<express.Request> & IKoaContextContainer;

interface VerifyFunctionWithRequest {
    (
        req: express.Request,
        token: string,
        done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
    ): void;
}
interface VerifyFunctionWithContext {
    (
        req: KoaPassportExpressRequestMock,
        token: string,
        done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
    ): void;
}

type VerifyFunctions =
    | VerifyFunction
    | VerifyFunctionWithRequest
    | VerifyFunctionWithContext;

declare class Strategy<T extends VerifyFunctions> implements passport.Strategy {
    constructor(verify: VerifyFunction);
    constructor(options: IStrategyOptions, verify: T);

    name: string;
    authenticate(req: express.Request, options?: Object): void;
}

````

### Additional Details
 * Last updated: Tue, 23 Sep 2025 23:32:05 GMT
 * Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/koa](https://npmjs.com/package/@types/koa), [@types/passport](https://npmjs.com/package/@types/passport)

# Credits
These definitions were written by [Isman Usoh](https://github.com/isman-usoh).

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