# axios-ntlm

> An NTLM auth extension to the Axios HTTP library

Latest version **1.4.6** (published 2025-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install axios-ntlm
pnpm add axios-ntlm
yarn add axios-ntlm
bun add axios-ntlm
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.4.6 |
| Published | 2025-09-15 |
| First published | 2021-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 54.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | CatButtes |
| Maintainers | catbuttes |
| Keywords | axios, ntlm, authentication, windows authentication, windows, auth |

## Links

- npm: https://www.npmjs.com/package/axios-ntlm
- Repository: https://github.com/catbuttes/axios-ntlm
- Homepage: https://buttes.dev/axios-ntlm/
- Issues: https://github.com/catbuttes/axios-ntlm/issues
- npm.io page: https://npm.io/package/axios-ntlm

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^1.12.2
- [des.js](https://npm.io/package/des.js.md) ^1.1.0
- [js-md4](https://npm.io/package/js-md4.md) ^0.3.2
- [dev-null](https://npm.io/package/dev-null.md) ^0.1.1

## 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.4.6 (latest) — 2025-09-15
- 1.4.4 — 2025-03-21
- 1.4.3 — 2025-01-11
- 1.4.2 — 2023-11-13
- 1.4.1 — 2023-02-15
- 1.4.0 — 2023-02-09
- 1.3.1 — 2022-11-24
- 1.3.0 — 2022-03-27
- 1.2.3 — 2022-02-14
- 1.2.1 — 2021-09-08
- 1.2.0 — 2021-09-05
- 1.1.8 — 2021-09-05
- 1.1.7 — 2021-08-23
- 1.1.6 — 2021-03-29
- 1.1.5 — 2021-02-24
- … 10 more at https://npm.io/package/axios-ntlm/versions

## README

# Axios-NTLM

This is a helper library for NTLM Authentication using the [Axios](https://github.com/axios/axios) HTTP library on Node. It attaches interceptors to an axios instance to authenticate using NTLM for any resources that offer it.

## Examples

### Basic example

This example will create you a brand new axios instance you can utilise the same as any other axios instance

```ts

import { NtlmClient } from 'axios-ntlm';

(async () => {

    let credentials: NtlmCredentials = {
        username: 'username',
        password: "password",
        domain: 'domain'
    }

    let client = NtlmClient(credentials)

    try {
        let resp = await client({
            url: 'https://protected.site.example.com',
            method: 'get'
        });
        console.log(resp.data);
    }
    catch (err) {
        console.log(err)
        console.log("Failed")
    }

})()

```
### With a custom Axios config

This shows how to pass in an axios config in the same way that you would when setting up any other axios instance. 

Note: If doing this, be aware that http(s)Agents need to be attached to keep the connection alive. If there are none attached already, they will be added. If you are providing your own then you will need to set this up.

```ts
import { AxiosRequestConfig } from 'axios';
import { NtlmClient, NtlmCredentials } from 'axios-ntlm';

(async () => {
    
    let credentials: NtlmCredentials = {
        username: 'username',
        password: "password",
        domain: 'domain'
    }

    let config: AxiosRequestConfig = {
        baseURL: 'https://protected.site.example.com',
        method: 'get'
    }

    let client = NtlmClient(credentials, config)

    try {
        let resp = await client.get('/api/123')
        console.log(resp);
    }
    catch (err) {
        console.log(err)
        console.log("Failed")
    }

})()

```

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