# @frontify/frontify-authenticator 中文文档

规范地址：https://npmcn.com/package/%40frontify/frontify-authenticator/

版本：2\.1\.0
npm 元数据更新时间：2026-09-23T08:55:31.211Z
中文译文更新时间：2026-11-15T15:03:35.467Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40frontify/frontify-authenticator
原文对照：https://npmcn.com/package/%40frontify/frontify-authenticator/?lang=original
项目主页：https://developer.frontify.com/
源码仓库：https://github.com/Frontify/frontify-authenticator

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：133 kB，10 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2021-10-06T07:42:32.134Z
- 最新版本发布：2026-09-23T08:55:30.878Z
- 近 30 天下载量：19400（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：10（近 12 个月 5 个）

## 中文简介

从任何安全的网络应用程序中认证您的 Frontify 实例 .

## 安装

```sh
npm install @frontify/frontify-authenticator
```

也可以使用：`pnpm add @frontify/frontify-authenticator`、`yarn add @frontify/frontify-authenticator`、`bun add @frontify/frontify-authenticator`

## README

# 前置认证器 v2

从任何安全的网络应用程序中认证您的 Frontify 实例 .

# 安装

安装或要求Frontify认证器v2有三种可能的方法.

## 国家预防机制

在第三方app上安装最新发布的软件包与运行一样简单 `npm i @frontify/frontify-authenticator` 并且要求主课通过CommonJs或作为ES模块.

```js
// CommonJs require
const FrontifyAuthenticator = require('@frontify/frontify-authenticator');
```

或

```js
// ESM import
import { authorize, refresh, revoke } from '@frontify/frontify-authenticator';
```

## 光盘N

或者,如果你在你的网络应用中不依赖 npm 包,你也可以通过使用像UPAKG这样的CDN来直接要求精密的JS脚本. 你可以找到最新的一个 [Frontfy 认证器 v2 源代码](https://unpkg.com/@frontify/frontify-authenticator@latest/dist/index.js) 并且通过一个 `<script>` HTML 元素.

```html
<script src="https://unpkg.com/@frontify/frontify-authenticator@latest/dist/index.js"></script>
```

您可能需要特定版本 。 要这样做,你只需要改变这个词 `latest` 带有您想要使用的特定版本( e. v2.0. 0) .

要使用脚本中可用的方法,你只需要使用 `FrontifyAuthenticator` 所附对象引用 `window`。 。 。 .

示例

```js
FrontifyAuthenticator.authorize(...);
```

或者说

```js
window.FrontifyAuthenticator.authorize(...);
```

## 当地

本地安装任何软件包,与CDN的用例没有很大区别. 你可以用这个 [以上提到的链接](https://unpkg.com/@frontify/frontify-authenticator@latest/dist/index.js) 下载文件内容,将其保存到本地实例中,并需要通过 `<script>` HTML 元素制作 `src` 地址指向您的本地文件.

```html
<script src="<PATH_TO_FILE>/<FILENAME>.js"></script>
```

就像CDN案中所提到的,如果想要需要特定版本,你只需要改变单词 `latest` 带有您想要使用的特定版本( e. v2.0. 0) .

您必须知道,在这种情况下,最新的代码不会自动更新,所以它依赖于手动下载,每次您想要在您的网络应用中实现新版本生效.

## 常见问题

### @frontify/frontify-authenticator 是什么？

从任何安全的网络应用程序中认证您的 Frontify 实例 \.

### 如何安装 @frontify/frontify-authenticator？

在项目目录运行 npm install @frontify/frontify-authenticator，或使用 pnpm add / yarn add / bun add。

### @frontify/frontify-authenticator 支持 TypeScript 吗？

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

### @frontify/frontify-authenticator 支持 ESM 还是 CommonJS？

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

### @frontify/frontify-authenticator 可以商用吗？

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

### @frontify/frontify-authenticator 的下载量有多少？

根据 npm 官方下载统计，@frontify/frontify-authenticator 在 2026/10/16 – 2026/11/14 这 30 天内被下载 19,400 次，日均约 647 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @frontify/frontify-authenticator 还在维护吗？

最新版本 2\.1\.0 发布于 2026/09/23（1 个月前）；至今共发布 10 个版本，其中过去 12 个月发布了 5 个；首次发布于 2021/10/06。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

