Skip to content

Resolving DID Documents

To resolve a DID Document, you must have the DID that the document is associated with. You can obtain a DID by resolving a handle using the methods described in Resolving Handles to DIDs.

DID Documents are resolved depending on the method of the DID. For example, did:plc DIDs are resolved by making a request to the PLC directory, while did:web DIDs are resolved by fetching a JSON file from a web server.

ts
import {
	AtprotoWebDidDocumentResolver,
	PlcDidDocumentResolver,
	XrpcDidDocumentResolver,
	CompositeDidDocumentResolver,
} from "@atcute/identity-resolver";

const doc = await didResolver.resolve("did:plc:z72i7hdynmk6r22z27h6tvur");
// -> { "@context": [...], id: "did:plc:...", service: [...], ... }