Skip to main content
Credo is built with a modular architecture that allows you to include only the functionality you need. Modules extend the core agent with additional capabilities like credential formats, storage backends, and ledger integrations.

Core Architecture

The Credo agent is composed of:
  • @credo-ts/core - The required foundation providing essential functionality
  • Extension modules - Optional modules that add specific capabilities
  • Platform modules - Platform-specific implementations (Node.js, React Native)

Module Registration

Modules are registered when creating an agent:
import { Agent } from '@credo-ts/core'
import { AskarModule } from '@credo-ts/askar'
import { AnonCredsModule } from '@credo-ts/anoncreds'

const agent = new Agent({
  config: {
    label: 'My Agent',
    walletConfig: {
      id: 'my-wallet',
      key: 'my-secret-key',
    },
  },
  dependencies: agentDependencies,
  modules: {
    askar: new AskarModule({
      ariesAskar,
    }),
    anoncreds: new AnonCredsModule({
      registries: [indyVdrAnonCredsRegistry],
      anoncreds,
    }),
  },
})

await agent.initialize()

Available Modules

Core

Essential framework functionality - required for all agents

OpenID4VC

OpenID for Verifiable Credentials support (issuer, holder, verifier)

AnonCreds

Privacy-preserving AnonCreds credential format

DIDComm

DIDComm v1 protocols for connections, credentials, and proofs

Tenants

Multi-tenancy support for hosting multiple agent instances

Askar

Secure storage and cryptographic operations using Aries Askar

Indy VDR

Hyperledger Indy ledger integration for AnonCreds

Cheqd

Cheqd network integration for DIDs and resources

Hedera

Hedera network integration (experimental)

Node

Node.js platform dependencies and utilities

React Native

React Native platform dependencies and utilities

Drizzle Storage

SQL-based storage using Drizzle ORM

Redis Cache

Redis-based caching for improved performance

Action Menu

DIDComm action menu protocol support

Question Answer

DIDComm question-answer protocol support

DRPC

Distributed RPC for agent communication

WebVH

did:webvh DID method support

Module Categories

Credential Formats

  • AnonCreds - Privacy-preserving credentials with selective disclosure
  • OpenID4VC - OpenID for Verifiable Credentials (OID4VCI, OID4VP)

Communication Protocols

  • DIDComm - Secure, privacy-preserving messaging based on DIDs

Storage & Cryptography

  • Askar - Secure storage and key management (recommended)

Ledger Integration

  • Indy VDR - Hyperledger Indy networks
  • Cheqd - Cheqd network
  • Hedera - Hedera network (experimental)

Infrastructure

  • Tenants - Multi-tenancy for SaaS applications

Choosing Modules

For AnonCreds Credentials

If you’re working with AnonCreds (Hyperledger Indy style credentials):
modules: {
  askar: new AskarModule({ ariesAskar }),
  anoncreds: new AnonCredsModule({ registries, anoncreds }),
  indyVdr: new IndyVdrModule({ indyVdr, networks }),
}

For OpenID4VC Credentials

If you’re working with W3C Verifiable Credentials via OpenID4VC:
modules: {
  askar: new AskarModule({ ariesAskar }),
  openId4VcIssuer: new OpenId4VcModule({
    issuer: { baseUrl: 'https://issuer.example.com' },
    verifier: { baseUrl: 'https://verifier.example.com' },
  }),
}

For DIDComm Messaging

If you need peer-to-peer credential exchange:
modules: {
  askar: new AskarModule({ ariesAskar }),
  didcomm: new DidCommModule({
    connections: { autoAcceptConnections: true },
  }),
}

Module Lifecycle

Modules participate in the agent lifecycle:
  1. Registration - register() called to register dependencies
  2. Initialization - initialize() called when agent starts
  3. Runtime - Module APIs available via agent.modules.moduleName
  4. Shutdown - shutdown() called when agent stops

Next Steps

Explore individual module documentation to learn about specific capabilities and configuration options.

Build docs developers (and LLMs) love