@azure/msal-common

中文文档
16.16.1发布于 2026/11/07MITTypeScriptESM + CJS零依赖近 30 天下载 1.5亿

Microsoft Authentication Library for js

原始使用文档
文档目录8 节
  1. About
  2. FAQ
  3. Prerequisites and Usage
  4. Installation
  5. Via NPM:
  6. Security Reporting
  7. License
  8. We Value and Adhere to the Microsoft Open Source Code of Co…

Microsoft Authentication Library for JavaScript (MSAL.js) Common Protocols Package

npm version npm version codecov

Getting StartedAAD DocsLibrary Reference
  1. About
  2. FAQ
  3. Changelog
  4. Releases
  5. Prerequisites and Usage
  6. Installation
  7. Security Reporting
  8. License
  9. Code of Conduct

About

The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using Azure AD work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through Azure AD B2C service. It also enables your app to get tokens to access Microsoft Cloud services such as Microsoft Graph.

The @azure/msal-common package described by the code in this folder serves as a common package dependency for the @azure/msal-browser package (and in the future, the msal-node package). Be aware that this is an internal library, and is subject to frequent change. It is not meant for production consumption by itself.

FAQ

See here.

Prerequisites and Usage

This library is not meant for production use. Please use one of these packages specific to the platform you are developing for:

Installation

Via NPM:

npm install @azure/msal-common

Security Reporting

If you find a security issue with our libraries or services please report it to [email protected] with as much detail as possible. Your submission may be eligible for a bounty through the Microsoft Bounty program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting this page and subscribing to Security Advisory Alerts.

License

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");

We Value and Adhere to the Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

版本与发布记录

@azure/msal-common 共发布 191 个版本,首次发布于 2020/01/18;过去 12 个月发布了 44 个版本。

版本发布日期距今
16.16.1latest2026/11/07今天
16.16.02026/11/052 天前
16.15.02026/10/2811 天前
16.14.32026/10/2217 天前
16.14.22026/10/031 个月前
16.14.12026/09/161 个月前

其他发布通道:alpha → 16.0.0-alpha.0,beta → 16.0.0-beta.0,lts → 15.17.0,hotfix → 16.2.1。

关于 @azure/msal-common 的常见问题

@azure/msal-common 是什么?

Microsoft Authentication Library for js

如何安装 @azure/msal-common?

在项目目录运行 npm install @azure/msal-common,或使用 pnpm add / yarn add / bun add。

@azure/msal-common 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@azure/msal-common 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@azure/msal-common 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=0.8.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@azure/msal-common 可以商用吗?

@azure/msal-common 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@azure/msal-common 的下载量有多少?

根据 npm 官方下载统计,@azure/msal-common 在 2026/10/08 – 2026/11/06 这 30 天内被下载 146,746,766 次,日均约 4,891,559 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@azure/msal-common 还在维护吗?

最新版本 16.16.1 发布于 2026/11/07(今天);至今共发布 191 个版本,其中过去 12 个月发布了 44 个;首次发布于 2020/01/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。