# @types/passport.socketio

> TypeScript definitions for passport.socketio

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

## Install

```sh
npm install @types/passport.socketio
pnpm add @types/passport.socketio
yarn add @types/passport.socketio
bun add @types/passport.socketio
```

## 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 | 3.7.10 |
| Published | 2023-11-07 |
| First published | 2019-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Dependencies (4)

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

## Recent versions

- 3.7.10 (latest) — 2023-11-07
- 3.7.7 (ts3.8) — 2021-12-24
- 3.7.6 (ts3.6) — 2021-07-08
- 3.7.5 (ts3.5) — 2021-05-14
- 3.7.4 (ts3.2) — 2020-11-09
- 3.7.3 (ts3.0) — 2020-07-22
- 3.7.0 (ts2.8) — 2019-08-21
- 3.7.9 — 2023-10-18
- 3.7.8 — 2023-09-24
- 3.7.2 — 2020-02-04
- 3.7.1 — 2019-10-03

## README

# Installation
> `npm install --save @types/passport.socketio`

# Summary
This package contains type definitions for passport.socketio (https://github.com/jfromaniello/passport.socketio#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport.socketio.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport.socketio/index.d.ts)
````ts
import { RequestHandler } from "express";
import { Store } from "express-session";
import { PassportStatic } from "passport";
import { Server, Socket } from "socket.io";

export interface PassportSocketIoOptions {
    /**
     * the name of the cookie where express/connect stores its session_id.
     */
    key?: string | undefined;

    /**
     * the session_secret to parse the cookie.
     */
    secret?: string | undefined;

    /**
     * we NEED to use a sessionstore. No MemoryStore please.
     */
    store: Store;

    /**
     * the same middleware you registrer in express.
     */
    cookieParser?: RequestHandler | undefined;
    passport?: PassportStatic | undefined;

    /**
     * callback on success.
     */
    success?: ((data: any, accept: (err?: any, accepted?: boolean) => void) => void) | undefined;

    /**
     * callback on fail/error.
     */
    fail?:
        | ((data: any, message: string, critical: boolean, accept: (err?: any, accepted?: boolean) => void) => void)
        | undefined;
}

export function authorize(options: PassportSocketIoOptions): (socket: Socket, fn: (err?: any) => void) => void;
export function filterSocketsByUser(io: Server, filter: (user: any) => boolean): Socket[];

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/express-session](https://npmjs.com/package/@types/express-session), [@types/passport](https://npmjs.com/package/@types/passport), [@types/socket.io](https://npmjs.com/package/@types/socket.io)

# Credits
These definitions were written by [Jack Scotson](https://github.com/Scotsoo).

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