An object containing input parameters for retrieving services.
The DID document from which services are retrieved.
Optional
id?: stringOptional. A string representing the specific service ID to match. If provided, only the service with this ID will be returned.
Optional
type?: stringOptional. A string representing the specific service type to match. If provided, only the service(s) of this type will be returned.
An array of services. If no matching service is found, an empty array is returned.
const didDocument = { ... }; // W3C DID document
const services = getServices({ didDocument, type: 'DecentralizedWebNode' });
Retrieves services from a given DID document, optionally filtered by
id
ortype
.If no
id
ortype
filters are provided, all defined services are returned.The given DID Document must adhere to the W3C DID Core Specification.