@digitalcredentials/issuer-registry-client

中文文档
4.1.0发布于 2026/09/01MITTypeScriptES Module构建来源已验证近 30 天下载 1.1万

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

中文使用文档
文档目录9 节
  1. 目录
  2. 说明
  3. 安装
  4. 国家预防机制
  5. 发展
  6. 使用量
  7. 供应你自己 fetch
  8. 贡献
  9. 许可证

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

Build status NPM Version

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

目录

说明

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

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

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

发展

这个项目使用 小时本地安装(用于 发展:

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

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

[
  {
    "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"
  }
]

你用这个列表:

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数字 :

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如上所举,将其包起来,或将其捆绑起来:

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

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

{
  "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"
    }
  ]
}

贡献

公关接受.

请遵照 标准读取 规格.

许可证

MIT 许可证 2025年数字证书联合会.

版本与发布记录

@digitalcredentials/issuer-registry-client 共发布 12 个版本,首次发布于 2022/12/01;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.1.0latest2026/09/012 个月前
4.0.02026/06/055 个月前
3.2.0-beta.5beta2025/05/151.5 年前
3.2.0-beta.42025/05/141.5 年前
3.2.0-beta.32025/05/031.5 年前
3.2.0-beta.22025/05/021.5 年前

关于 @digitalcredentials/issuer-registry-client 的常见问题

@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 和提交记录判断。