diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf18c2..ef77711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# isomorphic-lib-template Changelog +# issuer-registry-client Changelog ## 1.0.0 - TBD diff --git a/README.md b/README.md index 87a06ac..d51e326 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Example Isomorphic TS/JS Lib Template _(@digitalcredentials/isomorphic-lib-template)_ +# Known Issuer Registry Client _(@digitalcredentials/issuer-registry-client)_ -[![Build status](https://img.shields.io/github/workflow/status/digitalcredentials/isomorphic-lib-template/Node.js%20CI)](https://github.com/digitalcredentials/isomorphic-lib-template/actions?query=workflow%3A%22Node.js+CI%22) -[![NPM Version](https://img.shields.io/npm/v/@digitalcredentials/isomorphic-lib-template.svg)](https://npm.im/@digitalcredentials/isomorphic-lib-template) +[![Build status](https://img.shields.io/github/workflow/status/digitalcredentials/issuer-registry-client/Node.js%20CI)](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) -> A Typescript/Javascript isomorphic library template, for use in the browser, Node.js, and React Native. +> Isomorphic client for fetching Known Issuer/Known Verifier registries for Node, browser and React Native. ## Table of Contents @@ -24,14 +24,14 @@ TBD ## Install -- Node.js 14+ is recommended. +- Node.js 18+ is recommended. ### NPM To install via NPM: ``` -npm install @digitalcredentials/isomorphic-lib-template +npm install @digitalcredentials/issuer-registry-client ``` ### Development @@ -39,14 +39,28 @@ npm install @digitalcredentials/isomorphic-lib-template To install locally (for development): ``` -git clone https://github.com/digitalcredentials/isomorphic-lib-template.git -cd isomorphic-lib-template +git clone https://github.com/digitalcredentials/issuer-registry-client.git +cd issuer-registry-client npm install ``` ## Usage -TBD +The library exports two main things: a global `registryCollection`, containing +an instance of registry collections, and a loading function. + +```js +import { registryCollections, loadRegistryCollections } from '@digitalcredentials/issuer-registry-client' + +// registryCollections is empty, when first exported + +// Load the registries from the web (typically done at app startup). +await loadRegistryCollections() + +// You can now query to see if a given DID is in a registry +isInRegistryCollection('did:example:123') +// false +``` ## Contribute diff --git a/package.json b/package.json index a1c1a44..57eea64 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "alliance" ], "engines": { - "node": ">=16.0" + "node": ">=18.0" }, "author": { "name": "Digital Credentials Consortium", diff --git a/src/lib/Registry.ts b/src/lib/Registry.ts index 0c7c6ce..7e16fc6 100644 --- a/src/lib/Registry.ts +++ b/src/lib/Registry.ts @@ -2,7 +2,7 @@ * Copyright (c) 2022 Digital Credentials Consortium. All rights reserved. */ -import { RegistryRaw } from '../types/registry'; +import { RegistryRaw } from '../types'; export class Registry implements RegistryRaw { entries;