Agent Config
The Credo agent is very extensible. These are all the configuration options with a short description:
label
*
The label is seen by other users when creating a connection. This should not be used as a base for authenticity, as it is entirely up to the user to set this.
Type: string
label: 'my-demo-agent'
walletConfig
Configuration for the setup of the wallet. Including this in the agent configuration makes it possible that, when initializing the agent, the wallet will also be initialized. When an application requires the agent without an initialized wallet for any reason, this can be omitted and later on the wallet can be initialized separately.
Type: WalletConfig
import { KeyDerivationMethod } from '@credo-ts/core'
walletConfig: {
id: 'foo',
key: 'testkey000000000000000000000',
keyDerivationMethod: KeyDerivationMethod.Argon2IMod,
storage: {
type: 'postgres_storage',
... // depends on the storage type
}
}
walletConfig.id
*
Identifier string. Using another value here will open a new wallet.
Type: string
walletConfig.key
*
Key to unlock the wallet with. This value MUST be kept as a secret and should be seem like a password.
Type: string
walletConfig.keyDerivationMethod
The method used for key derivation of the
walletConfig.key
.
When using KeyDerivationMethod.Raw
, the key must be a base58-encoded
ChaCha20-Poly1305 key.
For the advanced readers here is the specification of Argon2.
Type: enum KeyDerivationMethod
Default: KeyDerivationMethod.Argon2IMod
Members:
KeyDerivationMethod.Argon2IMod
uses Argon2I modular (most secure option, but slower)
KeyDerivationMethod.Argon2Int
uses Argon2 integer (less secure, but faster)
KeyDerivationMethod.Raw
uses no derivation method and the key must be a base58-encoded ChaCha20-Poly1305 key.
walletConfig.storage
Specify which storage is being used for the wallet. The default is an SQLite database, but a Postgres database could be used as well.
Type: object
Default: An SQLite database
endpoints
A list of endpoints (schema + host + port) used for invitations and where other agents might reach you. This could be used to host a website that would redirect, for example with deep linking, to a wallet where the invitation can be accepted.
Type: string
endpoints: ['https://example.org:3000']
logger
A logger instance that implements the Logger
interface. This can be extremely
helpful for debugging. Credo exposes a ConsoleLogger
that can be used for simple logs. See Logging for more details on creating your own logger instance.
Type: Logger
import { ConsoleLogger, LogLevel } from '@credo-ts/core'
logger: new ConsoleLogger(LogLevel.info)
didCommMimeType
The mime-type used for sending and receiving messages. application/jwe
and
application/json
are used as fallback but are less desirable as they are
much more ambiguous in their specification.
Type: enum DidCommMimeType
Default: DidCommMimeType.V1
Members:
DidCommMimeType.V0
"application/ssi-agent-wire"
DidCommMimeType.V1
"application/didcomm-envelope-enc"
import { DidCommMimeType } from '@credo-ts/core'
didCommMimeType: DidCommMimeType.V1
useDidSovPrefixWhereAllowed
Whether to emit the legacy did:sov prefix did:sov:BzCbsNYhMrjHiqZDTUASHg;spec
in the @type
of messages for messages that allow it. A message can allow emitting the legacy prefix by setting the allowDidSovPrefix
on the message class. This is the case for all core messages that have been defined before the Migration to https://didcomm.org
message type, to allow for the best possible interoperability with other agents.
Type: boolean
Default: false
useDidSovPrefixWhereAllowed: true
useDidKeyInProtocols
Whether to use did:key
in protocols by default as defined in RFC 0360: did:key Usage. Adopting this RFC can break interop with agents that haven't adopted this RFC yet. The framework does it best to automatically detect whether the other agent supports did:key
, however in some cases we can't determine this. In those cases this parameter can be used to force the framework to use did:key
or not.
Type: boolean
Default: true
useDidKeyInProtocols: true
connectionImageUrl
A URL to an image used so that other agents can display this. Like the
Label
this is completely up to the user to define
this. It MUST not be used got any base of authenticity.
Type: string
connectionImageUrl: 'https://picsum.photos/200'
autoUpdateStorageOnStartup
Whether the storage should automatically be updated when a newer version of Credo is used.
Type: boolean
Default: false
autoUpdateStorageOnStartup: true