@trackback/did
v0.0.1-alpha.20
Published
Decentralized Identifiers (DIDs) SDK
Downloads
32
Readme
TrackBack DID SDK
The library is intended to be used as a common template for resolving a DID.
Supports Decentralized Identifiers spec.
IMPORTANT!
- This is a minimum viable product suite with limited functionality.
- Please do not use this for production
- This is a part of SDKs for Verifiable Credentials, Verifiable Credential Presentations, DID Keys, Self Sovereign Identity and Decentralised Identifiers
TrackBack DID
Installation
yarn install
Usage
importing DID builder and resolver
ES Modules import
import { Builder, DIDResolver } from '@trackback/did'
CommonJS import
const { Builder, DIDResolver } = require('@trackback/did');
Example
Following shows how to resolve a DID using different libraries
const { DIDResolver } = require('@trackback/did');
const { Connector } = require('@trackback/agent');
const customWebResolver = {resolve:(didUri)=>{...}}
const connector = new Connector();
const agent = new TrackBackAgent(connector);
const resolver = new DIDResolver();
resolver.add('web', customWebResolver);
resolver.add('trackback', agent.procedure);
const result: DIDResolutionResult = await resolver.resolve(
'did:web:test1234'
);
// {
// didResolutionMetadata: {...},
// didDocument: {...},
// didDocumentMetadata: {...},
// };