# @digitalcredentials/issuer-registry-client 中文文档

规范地址：https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/

版本：4\.1\.0
npm 元数据更新时间：2026-09-30T17:46:19.756Z
中文译文更新时间：2026-11-12T08:55:41.782Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：25.8 kB，16 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=24\.0
- 运行依赖：2 个
- 首次发布：2022-11-30T23:45:36.898Z
- 最新版本发布：2026-08-31T19:37:15.961Z
- 近 30 天下载量：10908（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：12（近 12 个月 2 个）

## 中文简介

已知发行人/核查人注册客户端,用于Typescript,浏览器和React Natural.

## 安装

```sh
npm install @digitalcredentials/issuer-registry-client
```

也可以使用：`pnpm add @digitalcredentials/issuer-registry-client`、`yarn add @digitalcredentials/issuer-registry-client`、`bun add @digitalcredentials/issuer-registry-client`

## README

# 已知发行人注册客户端 _(@数字证书/签发人-登记人-客户)_

[![Build status](https://img.shields.io/github/actions/workflow/status/digitalcredentials/issuer-registry-client/main.yml?branch=main)](https://github.com/digitalcredentials/issuer-registry-client/actions?query=workflow%3A%22Node.js+CI%22) [![NPM Version](https://img.shields.io/npm/v/@digitalcredentials/issuer-registry-client.svg)](https://npm.im/@digitalcredentials/issuer-registry-client)

> 在已知发行人/已知验证人中查找的Isomorphic客户端 登记。 对于节点,浏览器和React Induct.

## 目录

-   [说明](https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/#readme-description)
-   [安装](https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/#readme-install)
-   [使用量](https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/#readme-usage)
-   [贡献](https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/#readme-contribute)
-   [许可证](https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/#readme-license)

## 说明

这是一个客户端库,在其中之一查找DIS:

-   使用 /fetch 的 OIDF 注册 ? 子= oidf 端点以查看已完成的, 将其传递为“ sub” 参数的值
-   以DCC以前使用的格式编码的DDs的静态列表 成员和社区注册, 并公开服务, 像这个: [https://github.com/digitalcreditis/dcc-community-registry/registry.json 互联网档案馆的存檔,存档日期2013-12-22](https://github.com/digitalcredentials/dcc-community-registry/registry.json)

请注意,个人在多个登记册中可以出现。 因为这样, 页:1 _顺序_ 登记事项。 例如,提供一份登记册清单:

```js
const knownRegistries = [
  {
    type: 'oidf',
    fetchEndpoint: 'https://registry.dcconsortium.org/fetch?sub=',
    name: 'DCC Member Registry'
  },
  {
    name: 'DCC Sandbox Registry',
    url: 'https://digitalcredentials.github.io/sandbox-registry/registry.json',
    type: 'dcc-legacy'
  }
]
```

如果两个登记处都包含一个签发人Did,则签发人输入 (包含发行人名称和URL)将来自 _第一个_ 登记册, "DCC成员注册".

换言之,核查人和其他执行人必须下令登记 _内 从最权威到最少的顺序_。 。 。 .

## 安装

-   建议节点.js 24+.

### 国家预防机制

通过国家预防机制安装:

```
npm install @digitalcredentials/issuer-registry-client
```

### 发展

这个项目使用 [小时](https://pnpm.io/)本地安装(用于 发展:

```
git clone https://github.com/digitalcredentials/issuer-registry-client.git
cd issuer-registry-client
pnpm install
```

构建、提供和测试:

```
pnpm run build         # compile to dist/ via tsc
pnpm run lint          # eslint
pnpm run test-node     # vitest (Node)
pnpm run test-browser  # playwright (browser); run `pnpm exec playwright install chromium` first
pnpm test              # fix + lint + node + browser
```

## 使用量

您需要一系列已知的 发行人和核查人注册 核对,例如公开的DCC已知登记册副本:

[https://digitalcreditifics.github.io/dcc-有名-registries/有名-did-registries.json 互联网档案馆的存檔,存档日期2013-12-22](https://digitalcredentials.github.io/dcc-known-registries/known-did-registries.json)

截至2025年4月22日,情况如此(为方便起见,在此转载):

```json
[
  {
    "type": "oidf",
    "fetchEndpoint": "https://registry.dcconsortium.org/fetch?sub=",
    "name": "DCC Member Registry"
  },
  {
    "type": "dcc-legacy",
    "name": "DCC Sandbox Registry",
    "url": "https://digitalcredentials.github.io/sandbox-registry/registry.json"
  },
  {
    "type": "dcc-legacy",
    "name": "DCC Community Registry",
    "url": "https://digitalcredentials.github.io/community-registry/registry.json"
  },
  {
    "type": "dcc-legacy",
    "name": "MSP Registry",
    "url": "https://sandbox-issuer.myskillspocket.com/registry.json"
  }
]
```

你用这个列表:

```js
import { RegistryClient } from '@digitalcredentials/issuer-registry-client'

const registryClient = new RegistryClient()

// get the list of known issuers from wherever you store it, which could just be in a variable,
// but here we show how to fetch the DCC's list from it's github repository:
const response = await fetch("https://digitalcredentials.github.io/dcc-known-registries/known-did-registries.json");
const knownRegistries = await response.json();

// set the registry client to use that list
await registryClient.use({ registries: knownRegistries })

// You can now query to see if a DID is known in any registry
const results = registryClient.lookupIssuersFor('did:key:z6MkpLDL3RoAoMRTwTgo3rs39ZwssfaPKtGdZw7AGRN7CK4W'))
```

查询返回 :

-   已登记所提供DAD的发行人名单
-   任何登记册的清单(来自所提供的已知发行人名单) 选中

每个返回的发行商包括发行商的元数据,以及发行商的元数据 签发人登记的登记处.

### 供应你自己 `fetch`

每一个登记请求都通过 `globalThis.fetch` 默认。 传出 a `fetch` 自己来接手 - 应用超时,添加信头,服务 从缓存中获取,或到达一个登记册,运行时间不能直接请求(在 浏览器, 一个不发送 CORS 信头的浏览器, 否则会返回 `uncheckedRegistries`数字 :

```js
const registryClient = new RegistryClient({
  fetch: async url =>
    await fetch(`https://gateway.example/fetch?url=${encodeURIComponent(url)}`)
})
```

它被称为 URL并返回 a `Response`完全一样 `fetch`。 。 。 .

注意,它被称为客户的一种方法, 所以一个赤裸裸的全球参考 - `{ fetch }` 或者说 `{ fetch: globalThis.fetch }` - 这是一个独立的呼叫。 在浏览器中 抛出 `TypeError: Illegal invocation`,每个注册都回来 `uncheckedRegistries`如上所举,将其包起来,或将其捆绑起来:

```js
const registryClient = new RegistryClient({
  fetch: globalThis.fetch.bind(globalThis)
})
```

以下是一个保存在一个遗产中的 DD 的搜索回复 注册,一个OIDF注册, 并列出一个无法检查的注册 由于某种原因(例如,服务器已关闭) :

```json
{
  "matchingIssuers": [
    {
      "issuer": {
        "federation_entity": {
          "organization_name": "OneUni University",
          "homepage_uri": "https://oneuni.edu",
          "logo_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAB4SURBVEhLY1Da6ENTNGoBQTRqAUE0Yixwkq3X5tNgAANBkRlosvgQERbM0OaAmAwFNLFAkMNdW2KGkwjIE1S3AIFGLSCIRi0giEYtwIHq5Tk0BCEIaDwIwLh89RiKMRBRFkDNxQBUsoAyNGoBQTRqAUE01C3Y6AMAsDxJowXOs6oAAAAASUVORK5CYII="
        },
        "institution_additional_information": {
          "legal_name": "Board and Trustees of OneUni University"
        },
        "credential_registry_entity": {
          "ctid": "ce-e8a41a52-6ff6-48f0-9872-889c87b093b7",
          "ce_url": "https://credentialengineregistry.org/resources/ce-e8a41a52-6ff6-48f0-9872-889c87b093b7"
        },
        "ror_entity": {
          "rorid": "042nb2s44",
          "ror_url": "https://ror.org/042nb2s44"
        }
      },
      "registry": {
        "type": "oidf",
        "fetchEndpoint": "https://test.registry.dcconsortium.org/fetch?sub=",
        "name": "DCC Member Registry"
      }
    },
    {
      "issuer": {
        "federation_entity": {
          "organization_name": "Issuer Registry Client test",
          "homepage_uri": "https://dcconsortium.org/",
          "location": "here"
        }
      },
      "registry": {
        "type": "dcc-legacy",
        "name": "DCC Community Registry",
        "url": "https://digitalcredentials.github.io/community-registry/registry.json"
      }
    }
  ],
  "uncheckedRegistries": [
    {
      "type": "oidf",
      "fetchEndpoint": "https://registryyyyy.dcconsortium.org/fetch?sub=",
      "name": "DCC Member Registry Not Real"
    }
  ]
}
```

## 贡献

公关接受.

请遵照 [标准读取](https://github.com/RichardLitt/standard-readme) 规格.

## 许可证

[MIT 许可证](https://npmcn.com/package/%40digitalcredentials/issuer-registry-client/LICENSE.md) 2025年数字证书联合会.

## 常见问题

### @digitalcredentials/issuer-registry-client 是什么？

已知发行人/核查人注册客户端,用于Typescript,浏览器和React Natural\.

### 如何安装 @digitalcredentials/issuer-registry-client？

在项目目录运行 npm install @digitalcredentials/issuer-registry-client，或使用 pnpm add / yarn add / bun add。

### @digitalcredentials/issuer-registry-client 支持 TypeScript 吗？

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

### @digitalcredentials/issuer-registry-client 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @digitalcredentials/issuer-registry-client 需要什么版本的 Node\.js？

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

### @digitalcredentials/issuer-registry-client 可以商用吗？

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

### @digitalcredentials/issuer-registry-client 的下载量有多少？

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

### @digitalcredentials/issuer-registry-client 还在维护吗？

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

