@credo-ts/core package provides the foundational functionality for all Credo agents. This is a required dependency that includes essential services, APIs, and protocols.
Installation
What’s Included
The core package provides:Agent Framework
- Agent - Main agent class and lifecycle management
- Module system - Plugin architecture for extending functionality
- Dependency injection - Container for managing services
- Event system - Event emitter for agent events
DID Management
- DID resolver - Resolve DIDs across multiple methods
- DID registrar - Create and update DIDs
- Supported DID methods:
did:key- Cryptographic key-based DIDsdid:peer- Peer DIDs for pairwise relationshipsdid:web- Web-based DIDs- Extensible via modules (did:indy, did:cheqd, etc.)
Verifiable Credentials
- W3C Verifiable Credentials - Data Integrity and JWT formats
- SD-JWT VC - Selective disclosure JWT credentials
- mDocs/mDL - Mobile document credentials (ISO 18013-5)
- Presentation Exchange - DIF Presentation Exchange v2
- DCQL - Digital Credentials Query Language
Cryptography
- Key types: Ed25519, X25519, P-256, P-384, P-521, RSA
- JWS/JWT - JSON Web Signatures and Tokens
- Data Integrity - Linked Data Proofs
- Key Management - Abstract KMS interface (implemented by modules)
Storage
- Abstract storage interface - Implemented by storage modules
- Record management - Generic record storage
- Migrations - Version-based storage updates
- Caching - Optional caching layer
Basic Usage
Creating an Agent
Working with DIDs
Issuing W3C Verifiable Credentials
Verifying Credentials
Using SD-JWT Credentials
Agent Configuration
Config Options
Events
Subscribe to agent events:API Structure
Core services available:agent.dids- DID operationsagent.genericRecords- Generic record storageagent.wallet- Wallet operationsagent.w3cCredentials- W3C credential operationsagent.sdJwtVc- SD-JWT VC operationsagent.mdoc- mDoc operationsagent.x509- X.509 certificate operationsagent.cache- Caching operations
Storage Service
The core requires a storage implementation. Use one of:@credo-ts/askar- Aries Askar (recommended)@credo-ts/drizzle-storage- Drizzle ORM based storage- Custom implementation of
StorageService