@curity/identityserver-haapi-web-driver

中文文档
1.5.0发布于 2026/03/23UNLICENSEDTypeScriptCommonJS零依赖近 30 天下载 9499

Curity Identity Server HAAPI Web driver

原始使用文档

HAAPI Web Driver

Typescript/Javascript library with classes and functions to access Curity Identity Server Hypermedia Authentication API (HAAPI) from browser-based applications. The library is available on the npm public registry and can be installed using:

npm install @curity/identityserver-haapi-web-driver

Usage example

The package defines the createHaapiFetch function, which creates fetch-like functions that can be used to perform HAAPI requests. The returned functions automatically manage attestation, access tokens, DPoP tokens, and Session-Id under the covers.

// 0 - Import the createHaapiFetch function
import { createHaapiFetch } from '@curity/identityserver-haapi-web-driver';

// 1 - Create a fetch-like function to perform HAAPI requests
const haapiFetch = createHaapiFetch({
    clientId: 'test-client-id',
    tokenEndpoint: 'https://localhost:8443/dev/oauth/token',
});

// 2 - Use haapiFetch to access HAAPI resources
const authorizeRequest = '/dev/oauth/authorize?client_id=test-client-id&response_type=code&scope=read&state=foobar&redirect_uri=https://localhost:7777/client-callback';
haapiFetch(authorizeRequest)
    .then(res => {
        // ...
    });

版本与发布记录

@curity/identityserver-haapi-web-driver 共发布 11 个版本,首次发布于 2020/11/30;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.5.0latest2026/03/237 个月前
1.4.02025/11/041 年前
1.3.02024/12/161.9 年前
1.2.02022/11/084 年前
1.1.12021/10/045 年前
1.1.02021/08/125 年前

关于 @curity/identityserver-haapi-web-driver 的常见问题

@curity/identityserver-haapi-web-driver 是什么?

Curity Identity Server HAAPI Web driver

如何安装 @curity/identityserver-haapi-web-driver?

在项目目录运行 npm install @curity/identityserver-haapi-web-driver,或使用 pnpm add / yarn add / bun add。

@curity/identityserver-haapi-web-driver 支持 TypeScript 吗?

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

@curity/identityserver-haapi-web-driver 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@curity/identityserver-haapi-web-driver 可以商用吗?

@curity/identityserver-haapi-web-driver 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@curity/identityserver-haapi-web-driver 的下载量有多少?

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

@curity/identityserver-haapi-web-driver 还在维护吗?

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