Credo DIDComm Module
Base DIDComm package for Credo. Adds all DIDComm v1 Core protocols, such as Connections, Out-of-Band, Discover Features, Mediation Coordination, Message Pickup, Proofs and Credentials as defined in Aries RFCs.
Quick start
In order for this module to work, we have to inject it into the agent to access agent functionality. See the example for more information.
Note: At the moment, for a basic DIDComm agent to work, it is required to instantiate at least 3 modules besides the basic DidCommModule
: OutOfBandModule
, ConnectionsModule
and MessagePickupModule
Example of usage
import type { DidCommModuleConfigOptions } from '@credo-ts/didcomm'
import { agentDependencies, HttpInboundTransport } from '@credo-ts/node'
import {
ConnectionsModule,
ProofsModule,
CredentialsModule,
HttpOutboundTransport,
getDefaultDidcommModules,
} from '@credo-ts/didcomm'
const agent = new Agent({
config: {
},
dependencies: agentDependencies,
modules: {
...getDefaultDidcommModules(didcommConfig),
connections: new ConnectionsModule({
}),
credentials: new CredentialsModule({
}),
proofs: new ProofsModule({
}),
},
})
agent.modules.didcomm.registerInboundTransport(new HttpInboundTransport({ port }))
agent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport())
await agent.initialize()
const outOfBand = await this.agent.modules.oob.createInvitation()
In this example, by using the convenient method getDefaultDidcommModules
you can easily instantiate the basic DIDComm protocols: out-of-band, connections, message pickup, discover features, proof exchange, issue credentials, basic message and mediation coordination. You can of course instantiate only the ones you need for your particular implementation.