# @villedemontreal/auth-oidc-plugin-superagent

> superagent binding for auth-oidc

Latest version **1.1.5** (published 2026-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @villedemontreal/auth-oidc-plugin-superagent
pnpm add @villedemontreal/auth-oidc-plugin-superagent
yarn add @villedemontreal/auth-oidc-plugin-superagent
bun add @villedemontreal/auth-oidc-plugin-superagent
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2026-01-02 |
| First published | 2021-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20.0.0 |
| Dependencies | 2 |
| Unpacked size | 130.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Montreal City Authors |
| Maintainers | psionikangel, olivieralbertini, sdriton, joscelynjean, steph-lebl, livetocode, electrotype |
| Keywords | auth, oidc, superagent |

## Links

- npm: https://www.npmjs.com/package/@villedemontreal/auth-oidc-plugin-superagent
- Repository: https://github.com/VilledeMontreal/authentication-nodejs-lib
- Homepage: https://github.com/VilledeMontreal/authentication-nodejs-lib#readme
- Issues: https://github.com/VilledeMontreal/authentication-nodejs-lib/issues
- npm.io page: https://npm.io/package/@villedemontreal/auth-oidc-plugin-superagent

## Dependencies (2)

- [@villedemontreal/auth-core](https://npm.io/package/@villedemontreal/auth-core.md) ^1.1.5
- [@villedemontreal/auth-oidc](https://npm.io/package/@villedemontreal/auth-oidc.md) ^1.1.5

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.1.5 (latest) — 2026-01-02
- 1.1.1-beta.15 (beta) — 2025-06-06
- 1.1.4 — 2025-10-19
- 1.1.3 — 2025-05-12
- 1.1.1-beta.13 — 2025-05-12
- 1.1.2 — 2024-09-21
- 1.1.1-beta.12 — 2024-09-21
- 1.1.1 — 2023-12-10
- 1.1.1-beta.10 — 2023-12-10
- 1.1.1-beta.9 — 2023-12-10
- 1.1.1-beta.6 — 2023-12-10
- 1.1.0 — 2023-05-13
- 1.1.1-beta.0 — 2023-05-13
- 1.0.15 — 2023-02-20
- 1.0.16-beta.0 — 2023-02-20
- … 31 more at https://npm.io/package/@villedemontreal/auth-oidc-plugin-superagent/versions

## README

# Description

This is the HTTP client binding for the [Superagent](https://visionmedia.github.io/superagent/) library.

It provides an implementation of IHttpClient, to use Superagent for all OIDC internal calls, and it provides
additional plugins which enable authentication, logging and correlation ID injection.

This library belongs to a monorepo. Please visit https://github.com/VilledeMontreal/authentication-nodejs-lib
for more information.

## Plugins

- [authenticator](src/authenticator.ts)
- [requestLogger](src/requestLogger.ts)
- [correlationId](src/correlationId.ts)

# Usage

```
npm install superagent @villemontrea/auth-oidc-plugin-superagent
npm install @types/superagent --save-dev
```

```typescript
import * as superagent from 'superagent';
import {
  authenticator,
  createSession,
  requestLogger,
} from '@villedemontreal/auth-oidc-plugin-superagent';
// configure
const session = createSession({
  authMethod: 'client_secret_basic',
  client: {
    id: 'client',
    secret: 'clientSecret',
  },
  issuer: 'http://localhost:5005',
  scopes: ['openid', 'profile'],
});
// custom auth for each http call:
const res = await superagent
  .get('http://localhost:4004/secured/profile')
  .use(requestLogger(session.logger))
  .use(authenticator(session));
console.log(res.status, res.body);
// or configure auth once for all http calls:
const myAgent = superagent.agent().use(authenticator(session));
// then each call will be automatically authenticated
const res2 = await myAgent.get('http://localhost:4004/secured/profile');
console.log(res2.status, res.body);
```

# Documentation

See [Documentation](https://github.com/VilledeMontreal/authentication-nodejs-lib/tree/master/doc/README.md).

# Examples

See [Superagent client](https://github.com/VilledeMontreal/authentication-nodejs-lib/tree/master/examples/client-superagent)

---
_Source: https://npm.io/package/@villedemontreal/auth-oidc-plugin-superagent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
