Overview
The DidsApi provides methods for DID operations including resolution, creation, updates, and management.Methods
resolve()
Resolve a DID to a DID document following the W3C DID Resolution specification.The DID or DID URL to resolve
Resolution options
Promise<DidResolutionResult>
resolveDidDocument()
Resolve a DID to a DID document. Throws an error if resolution fails. Simpler alternative toresolve().
The DID or DID URL to resolve
Promise<DidDocument>
Throws: CredoError if resolution fails
create()
Create, register, and store a new DID following the DID Registration specification.DID creation options
method: DID method (e.g., ‘key’, ‘peer’, ‘web’)options: Method-specific optionssecret: Method-specific secretsdidDocument: Optional pre-defined DID document
Promise<DidCreateResult>
update()
Update an existing DID document following the DID Registration specification.DID update options
did: DID to updatedidDocument: Updated DID documentoptions: Method-specific options
Promise<DidUpdateResult>
deactivate()
Deactivate an existing DID following the DID Registration specification.DID deactivation options
did: DID to deactivateoptions: Method-specific options
Promise<DidDeactivateResult>
import()
Import an existing DID that was created outside of the agent. Creates a DidRecord and optionally stores keys.The DID to import
DID document. If not provided, will be resolved.
Keys associated with the DID to store in the wallet
Whether to overwrite existing DID record
Promise<void>
Throws: CredoError if DID already exists and overwrite is false
getCreatedDids()
Get a list of all DIDs created by the agent.Filter by DID method
Filter by specific DID
Promise<DidRecord[]>
resolveCreatedDidDocumentWithKeys()
Resolve a created DID document along with its associated keys.The DID to resolve
Promise<{ didDocument: DidDocument, keys: Array<{ didDocumentRelativeKeyId: string, kmsKeyId: string }> }>
Throws: RecordNotFoundError if DID was not created by this agent
resolveVerificationMethodFromCreatedDidRecord()
Resolve a verification method from a created DID record.DID URL referencing the verification method
Filter verification methods by purpose
Promise<{ verificationMethod: VerificationMethod, publicJwk: PublicJwk }>
Properties
supportedResolverMethods
List of DID methods supported for resolution.string[]
supportedRegistrarMethods
List of DID methods supported for registration (creation).string[]