Credo TypeScript Framework

repository·main·Indexed 43 days ago

https://github.com/openwallet-foundation/credo-ts

A TypeScript-based framework for building interoperable decentralized identity solutions. It supports various DID methods, credential formats such as W3C VCs and AnonCreds, and exchange protocols including OpenID4VC and DIDComm across Node.js and React Native platforms. The ecosystem includes modules for DIDComm, AnonCreds, Askar secure storage, Drizzle ORM storage, and cheqd network integration.

Tokens
117.2K
Snippets
408
Records
844
Agent score
55%

What's inside Credo

  1. Overview of Credo features

    main

    Credo provides a wide range of identity capabilities:

    • Platform Agnostic: Supports both Node.JS and React Native environments.
    • DIDComm and AIP: Supports DIDComm v1 and both v1 and v2 of the Aries Interop Profile (AIP).
    • Extendable DID Support: Out-of-the-box support for resolvers and registrars including did:web, did:webvh, did:key, did:jwk, did:peer, did:sov, did:indy, did:cheqd, and did:hedera.
    • OpenID4VC: Support for OpenID for Verifiable Credential Issuance, OpenID for Verifiable Presentations, and Self-Issued OpenID Provider v2.
    • Multiple Credential Formats: Supports W3C Verifiable Credential Data Model v1.1, SD-JWT VCs, and AnonCreds.
    • Multi-tenant: Includes an optional module for managing multiple tenants under a single agent.
  2. Register Drizzle storage bundles

    main

    Bundles provide the agent with context about record types. You must include the coreBundle and any other bundles corresponding to the modules you have enabled.

    Ordering Rule: Always order bundles to account for dependencies. For example, actionMenuBundle depends on connection records from didcommBundle. A safe practice is to follow the order provided by the package and place custom bundles last.

    Available bundles include:

    • coreBundle from @credo-ts/drizzle-storage/core (core)
    • didcommBundle from @credo-ts/drizzle-storage/didcomm (didcomm)
    • actionMenuBundle from @credo-ts/drizzle-storage/action-menu (action-menu)
    • anonCredsBundle from @credo-ts/drizzle-storage/anoncreds (anoncreds)
    • openid4vcBundle from @credo-ts/drizzle-storage/openid4vc (openid4vc)
    • drpcBundle from @credo-ts/drizzle-storage/drpc (drpc)
    • tenantsBundle from @credo-ts/drizzle-storage/tenants (tenants)
    • questionAnswerBundle from @credo-ts/drizzle-storage/question-answer (question-answer)

    Example for an agent using didcomm and anoncreds:

    const bundles = [coreBundle, didcommBundle, actionMenuBundle, anoncredsBundle, questionAnswerBundle] as const;
  3. How extension modules work in Credo

    main

    An extension module is a way to add custom functionality to a Credo Agent instance without modifying the core package. They can be used for tasks like:

    • Storing custom data in an Identity Wallet.
    • Supporting custom protocols over DIDComm.
    • Implementing new Aries RFCs.

    Extension modules are injected into the Agent via the modules property in AgentOptions. Once injected, they have access to core modules, services, and the EventEmitter, allowing them to function similarly to statically included modules.

    Warning: The custom module API is currently an experimental feature in heavy development and is subject to breaking changes.