# @nextcloud/auth

> Nextcloud helpers related to authentication and the current user

Latest version **2.6.0** (published 2026-04-14) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @nextcloud/auth
pnpm add @nextcloud/auth
yarn add @nextcloud/auth
bun add @nextcloud/auth
```

## Health

**Score 70/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.6.0 |
| Published | 2026-04-14 |
| First published | 2019-10-02 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^20.0.0 \|\| ^22.0.0 \|\| ^24.0.0 |
| Dependencies | 3 |
| Unpacked size | 71.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11 |
| Author | Nextcloud GmbH and Nextcloud contributors |
| Maintainers | icewind1991, skjnldsv, christophwurst, juliushaertl, nickvergessen, artonge, gretadoci, mejo-, susnux |
| Keywords | nextcloud |

## Links

- npm: https://www.npmjs.com/package/@nextcloud/auth
- Repository: https://github.com/nextcloud-libraries/nextcloud-auth
- Homepage: https://github.com/nextcloud-libraries/nextcloud-auth#readme
- Issues: https://github.com/nextcloud-libraries/nextcloud-auth/issues
- npm.io page: https://npm.io/package/@nextcloud/auth

## Dependencies (3)

- [@nextcloud/router](https://npm.io/package/@nextcloud/router.md) ^3.1.0
- [@nextcloud/event-bus](https://npm.io/package/@nextcloud/event-bus.md) ^3.3.3
- [@nextcloud/browser-storage](https://npm.io/package/@nextcloud/browser-storage.md) ^0.5.0

## Recent versions

- 2.6.0 (latest) — 2026-04-14
- 2.5.3 — 2025-10-08
- 2.5.2 — 2025-07-07
- 2.5.1 — 2025-05-13
- 2.5.0 — 2025-05-12
- 2.4.0 — 2024-08-13
- 2.3.0 — 2024-04-22
- 2.2.1 — 2023-09-20
- 2.1.0 — 2023-05-22
- 2.0.0 — 2022-08-11
- 1.3.0 — 2020-06-04
- 1.2.3 — 2020-04-06
- 1.2.2 — 2020-03-19
- 1.2.1 — 2020-01-10
- 1.2.0 — 2020-01-07
- … 6 more at https://npm.io/package/@nextcloud/auth/versions

## README

<!--
  - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  - SPDX-License-Identifier: GPL-3.0-or-later
-->
# @nextcloud/auth

[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-auth)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-auth)
[![npm](https://img.shields.io/npm/v/@nextcloud/auth.svg)](https://www.npmjs.com/package/@nextcloud/auth)
[![Documentation](https://img.shields.io/badge/Documentation-online-brightgreen)](https://nextcloud-libraries.github.io/nextcloud-auth/index.html)

Nextcloud helpers related to authentication and the current user

## Install

```sh
npm install @nextcloud/auth --save
```

```sh
yarn add @nextcloud/auth
```

## Usage
For detailed information check [the package documentation](https://nextcloud-libraries.github.io/nextcloud-auth/index.html).

One example usage to get the current user:
```ts
import { getCurrentUser } from '@nextcloud/auth'

const user = getCurrentUser()

if (user.isAdmin) {
  // do something
}
```

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