# @duosecurity/duo_api

> Duo API SDK for Node.js applications

Latest version **1.6.0** (published 2026-08-25) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @duosecurity/duo_api
pnpm add @duosecurity/duo_api
yarn add @duosecurity/duo_api
bun add @duosecurity/duo_api
```

## Health

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

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2026-08-25 |
| First published | 2018-07-12 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 55.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 20 |
| Maintainers | duo_security, matts_duosec, duokristina, aaron_at_duo, rbixby, yizshi, smaxfield |
| Keywords | Duo Security, Two-Factor Authentication |

## Links

- npm: https://www.npmjs.com/package/@duosecurity/duo_api
- Repository: https://github.com/duosecurity/duo_api_nodejs
- Homepage: https://www.duosecurity.com/api
- Issues: https://www.duosecurity.com/support
- npm.io page: https://npm.io/package/@duosecurity/duo_api

## 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.6.0 (latest) — 2026-08-25
- 1.5.0 — 2025-04-28
- 1.4.0 — 2024-01-16
- 1.3.0 — 2023-02-17
- 1.2.3 — 2021-11-17
- 1.2.2 — 2020-10-19
- 1.2.1 — 2020-01-10
- 1.0.2 — 2020-01-09
- 1.2.0 — 2019-03-12
- 1.0.1 — 2018-07-12

## README

# Overview

[![Build Status](https://github.com/duosecurity/duo_api_nodejs/workflows/Node%20CI/badge.svg)](https://github.com/duosecurity/duo_api_nodejs/actions)
[![Issues](https://img.shields.io/github/issues/duosecurity/duo_api_nodejs)](https://github.com/duosecurity/duo_api_nodejs/issues)
[![Forks](https://img.shields.io/github/forks/duosecurity/duo_api_nodejs)](https://github.com/duosecurity/duo_api_nodejs/network/members)
[![Stars](https://img.shields.io/github/stars/duosecurity/duo_api_nodejs)](https://github.com/duosecurity/duo_api_nodejs/stargazers)
[![License](https://img.shields.io/badge/License-View%20License-orange)](https://github.com/duosecurity/duo_api_nodejs/blob/master/LICENSE)

**Auth** - https://www.duosecurity.com/docs/authapi

**Admin** - https://www.duosecurity.com/docs/adminapi

**Accounts** - https://www.duosecurity.com/docs/accountsapi

## Node Versions Tested Against:
* 8
* 10
* 12
* 14
* 15

## TLS 1.2 and 1.3 Support

Duo_api_nodejs uses the Node tls library and OpenSSL for TLS operations.  All versions of Node receiving security support (14 and higher) use OpenSSL 1.1.1 which supports TLS 1.2 and 1.3.

# Installing

Development:

```
$ git clone https://github.com/duosecurity/duo_api_nodejs.git
$ cd duo_api_nodejs
$ npm install
```

System:

```
$ npm install global @duosecurity/duo_api
```

Or run the following to add to your project:

```
$ npm install --save @duosecurity/duo_api
```

# Using

```
$ node --interactive
> const duo_api = require('duo_api');
> const client = new duo_api.Client(ikey, skey, host);
> client.jsonApiCall('POST', '/auth/v2/preauth', { username: 'testuser' }, console.log);
> { response:
   { devices: [ [Object] ],
     result: 'auth',
     status_msg: 'Account is active' },
  stat: 'OK' }
```

# Testing

```
$ npm run test
...
OK: 10 assertions (12ms)
```

# Linting

```
$ npm run lint

> @duosecurity/duo_api@1.0.0 lint duo_api_nodejs
> eslint lib/ tests/
```

# Support

Report any bugs, feature requests, etc. to us directly: support@duosecurity.com

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