# auth0-js

> Auth0 headless browser sdk

Latest version **10.2.1** (published 2026-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install auth0-js
pnpm add auth0-js
yarn add auth0-js
bun add auth0-js
```

## Health

**Score 73/100 (B)** — status: active.

Positive: has types package; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 10.2.1 |
| Published | 2026-08-06 |
| First published | 2013-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/auth0-js) |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 8.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1059 |
| Author | Auth0 |
| Maintainers | auth0-oss, auth0npm, auth0brokkr, jessele, oktajeffoktajeff, bsmith-auth0, sanjay.manikandhan, nirjo, niltorresatko, jaskirat_atko, henry.mcardle, nicolas.villalobos, choah, josecarlos-chavez_atko, skatko, tj.okta, sgarcia-atko, roger.chan, maaantone, lewisbyrne-okta, tarunpreet.kaur |
| Keywords | auth0, auth, openid, authentication, jwt, browser |

## Links

- npm: https://www.npmjs.com/package/auth0-js
- Repository: https://github.com/auth0/auth0.js
- Homepage: https://github.com/auth0/auth0.js#readme
- Issues: https://github.com/auth0/auth0.js/issues
- npm.io page: https://npm.io/package/auth0-js

## Dependencies (8)

- [qs](https://npm.io/package/qs.md) ^6.15.2
- [winchan](https://npm.io/package/winchan.md) ^0.2.2
- [minimist](https://npm.io/package/minimist.md) ^1.2.5
- [url-join](https://npm.io/package/url-join.md) ^4.0.1
- [base64-js](https://npm.io/package/base64-js.md) ^1.5.1
- [js-cookie](https://npm.io/package/js-cookie.md) ^3.0.7
- [superagent](https://npm.io/package/superagent.md) ^10.2.3
- [idtoken-verifier](https://npm.io/package/idtoken-verifier.md) ^2.2.4

## 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

- 10.2.1 (latest) — 2026-08-06
- 9.7.4-beta1 (beta) — 2018-08-28
- 8.0.0-alpha.2 (alpha) — 2016-12-05
- 6.8.4 (support) — 2016-10-20
- 10.2.0 — 2026-06-25
- 10.1.0 — 2026-06-10
- 10.0.0 — 2026-05-06
- 9.32.0 — 2026-03-25
- 9.31.0 — 2026-03-16
- 9.30.1 — 2026-02-06
- 9.30.0 — 2026-01-09
- 9.29.1 — 2025-12-17
- 9.29.0 — 2025-10-06
- 9.28.0 — 2024-10-21
- 9.27.0 — 2024-09-27
- … 259 more at https://npm.io/package/auth0-js/versions

## README

![Client Side JavaScript toolkot for Auth0 API](https://cdn.auth0.com/website/sdks/banners/auth0-js-banner.png)

![Release](https://img.shields.io/npm/v/auth0-js)
[![Codecov](https://img.shields.io/codecov/c/github/auth0/auth0.js)](https://codecov.io/gh/auth0/auth0.js)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/auth0/auth0.js)
![Downloads](https://img.shields.io/npm/dw/auth0-js)
[![License](https://img.shields.io/:license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
[![CircleCI](https://img.shields.io/circleci/build/github/auth0/auth0.js)](https://circleci.com/gh/auth0/auth0.js)

📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started) - 💻 [API Reference](#api-reference) - 💬 [Feedback](#feedback)

## Documentation

- [Library docs](https://auth0.com/docs/libraries/auth0js) - a complete reference and examples.
- [Sample App](https://github.com/auth0/auth0.js/blob/master/example/) - a sample application integrated with Auth0.
- [Examples](https://github.com/auth0/auth0.js/blob/master/EXAMPLES.md) - code samples for common auth0-js authentication scenario's.
- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.

## Getting started

### Installation

From CDN:

```html
<!-- Latest patch release -->
<script src="https://cdn.auth0.com/js/auth0/10.2.1/auth0.min.js"></script>
```

From [npm](https://npmjs.org):

```sh
npm install auth0-js
```

After installing the `auth0-js` module using [npm](https://npmjs.org), you'll need to bundle it up along with all of its dependencies, or import it using:

```js
import auth0 from 'auth0-js';
```

### Configure the SDK

#### auth0.WebAuth

Provides support for all the authentication flows.

```js
var auth0 = new auth0.WebAuth({
  domain: '{YOUR_AUTH0_DOMAIN}',
  clientID: '{YOUR_AUTH0_CLIENT_ID}'
});
```

#### auth0.Authentication

Provides an API client for the Auth0 Authentication API.

```js
var auth0 = new auth0.Authentication({
  domain: '{YOUR_AUTH0_DOMAIN}',
  clientID: '{YOUR_AUTH0_CLIENT_ID}'
});
```

#### auth0.Management

Provides an API Client for the Auth0 Management API (only methods meant to be used from the client with the user token). You should use an `access_token` with the `https://YOUR_DOMAIN.auth0.com/api/v2/` audience to make this work. For more information, read [the user management section of the Auth0.js documentation](https://auth0.com/docs/libraries/auth0js/v9#user-management).

```js
var auth0 = new auth0.Management({
  domain: '{YOUR_AUTH0_DOMAIN}',
  token: '{ACCESS_TOKEN_FROM_THE_USER}'
});
```

## API reference

### auth0.webAuth

- [constructor](https://auth0.github.io/auth0.js/WebAuth.html#WebAuth)
- [authorize(options)](https://auth0.github.io/auth0.js/WebAuth.html#authorize)
- [changePassword(options)](https://auth0.github.io/auth0.js/WebAuth.html#changePassword)
- [checkSession(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#checkSession)
- [customTokenExchange(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#customTokenExchange)
- [login(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#login)
- [logout(options)](https://auth0.github.io/auth0.js/WebAuth.html#logout)
- [parseHash(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#parseHash)
- [passwordlessLogin(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#passwordlessLogin)
- [passwordlessStart(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#passwordlessStart)
- [passwordlessVerify(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#passwordlessVerify)
- [renderCaptcha(element, options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#renderCaptcha)
- [renewAuth(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#renewAuth)
- [signup(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#signup)
- [signupAndAuthorize(options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#signupAndAuthorize)
- [validateAuthenticationResponse(options, parsedHash, callback)](https://auth0.github.io/auth0.js/WebAuth.html#validateAuthenticationResponse)

### auth0.Authentication

- [buildAuthorizeUrl(options)](https://auth0.github.io/auth0.js/Authentication.html#buildAuthorizeUrl)
- [buildLogoutUrl(options)](https://auth0.github.io/auth0.js/Authentication.html#buildLogoutUrl)
- [customTokenExchange(options, callback)](https://auth0.github.io/auth0.js/Authentication.html#customTokenExchange)
- [delegation(options, callback)](https://auth0.github.io/auth0.js/Authentication.html#delegation)
- [getChallenge(callback)](https://auth0.github.io/auth0.js/Authentication.html#getChallenge)
- [getSSOData(withActiveDirectories, callback)](https://auth0.github.io/auth0.js/Authentication.html#getSSOData)
- [login(options, callback)](https://auth0.github.io/auth0.js/Authentication.html#login)
- [loginWithDefaultDirectory(options, callback)](https://auth0.github.io/auth0.js/Authentication.html#loginWithDefaultDirectory)
- [loginWithResourceOwner(options, callback)](https://auth0.github.io/auth0.js/Authentication.html#loginWithResourceOwner)
- [userInfo(token, callback)](https://auth0.github.io/auth0.js/Authentication.html#userInfo)

### auth0.Management

- [getUser(userId, callback)](https://auth0.github.io/auth0.js/Management.html#getUser)
- [linkUser(userId, secondaryUserId, callback)](https://auth0.github.io/auth0.js/Management.html#linkUser)
- [patchUserAttributes(userId, user, callback)](https://auth0.github.io/auth0.js/Management.html#patchUserAttributes)
- [patchUserMetadata(userId, userMetadata, callback)](https://auth0.github.io/auth0.js/Management.html#patchUserMetadata)

## Feedback

### Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)

### Raise an issue

To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0.js/issues).

### Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.

---

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png"   width="150">
    <source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150">
    <img alt="Auth0 Logo" src="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
  </picture>
</p>
<p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
<p align="center">
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0.js/blob/master/LICENSE"> LICENSE</a> file for more info.</p>

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