Skip to main content

Installation

Credo is distributed as multiple npm packages. This guide covers how to install and configure Credo for your platform.

Package overview

Credo consists of a core package, platform-specific packages, and optional module packages:

Core packages

@credo-ts/core

The main framework package (required)

@credo-ts/node

Node.js platform dependencies

@credo-ts/react-native

React Native platform dependencies

@credo-ts/askar

Secure storage implementation (required)

Module packages

@credo-ts/openid4vc

OpenID for Verifiable Credentials

@credo-ts/anoncreds

AnonCreds credential format

@credo-ts/didcomm

DIDComm messaging protocol

@credo-ts/indy-vdr

Indy ledger integration

@credo-ts/cheqd

Cheqd DID method and AnonCreds

@credo-ts/hedera

Hedera DID method and AnonCreds

@credo-ts/tenants

Multi-tenant support

@credo-ts/action-menu

Action menu protocol

@credo-ts/question-answer

Question-answer protocol

@credo-ts/drpc

Distributed RPC

Node.js installation

Prerequisites

Node.js 20.19 or higher is required

Basic installation

Install the core packages for a basic Node.js agent:
npm install @credo-ts/core @credo-ts/node @credo-ts/askar @openwallet-foundation/askar-nodejs

With DIDComm support

To enable DIDComm messaging, add the DIDComm module:
npm install @credo-ts/core @credo-ts/node @credo-ts/askar @credo-ts/didcomm @openwallet-foundation/askar-nodejs

With AnonCreds support

To work with AnonCreds credentials:
npm install @credo-ts/core @credo-ts/node @credo-ts/askar @credo-ts/anoncreds @openwallet-foundation/askar-nodejs @hyperledger/anoncreds-nodejs

With OpenID4VC support

To use OpenID for Verifiable Credentials:
npm install @credo-ts/core @credo-ts/node @credo-ts/askar @credo-ts/openid4vc @openwallet-foundation/askar-nodejs

React Native installation

Prerequisites

React Native 0.71.4 or higher is required

Required dependencies

Install the core packages for React Native:
npm install @credo-ts/core @credo-ts/react-native @credo-ts/askar react-native-fs react-native-get-random-values

Platform-specific Askar

For React Native, you need the platform-specific Askar package:
npm install @openwallet-foundation/askar-react-native

Setup polyfills

Add this to the top of your app entry file (e.g., index.js):
index.js
import 'react-native-get-random-values'
The react-native-get-random-values polyfill must be imported before any Credo imports.

Storage options

Credo requires a storage module for secure key and data management. The recommended option is Askar:
An alternative storage implementation using Drizzle ORM.
npm install @credo-ts/drizzle-storage
Drizzle Storage is less mature than Askar. Use Askar for production applications.

Peer dependencies

Some packages have peer dependencies that must be installed:

AnonCreds

When using @credo-ts/anoncreds:
npm install @hyperledger/anoncreds-nodejs  # for Node.js
npm install @hyperledger/anoncreds-react-native  # for React Native

Askar

When using @credo-ts/askar:
npm install @openwallet-foundation/askar-nodejs  # for Node.js
npm install @openwallet-foundation/askar-react-native  # for React Native

Indy VDR

When using @credo-ts/indy-vdr:
npm install @hyperledger/indy-vdr-nodejs  # for Node.js
npm install @hyperledger/indy-vdr-react-native  # for React Native

TypeScript configuration

Credo requires the following TypeScript compiler options:
tsconfig.json
{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}
The experimentalDecorators and emitDecoratorMetadata options are required for dependency injection to work correctly.

Version compatibility

All Credo packages should use the same version. For example:
package.json
{
  "dependencies": {
    "@credo-ts/core": "^0.6.2",
    "@credo-ts/node": "^0.6.2",
    "@credo-ts/askar": "^0.6.2",
    "@credo-ts/anoncreds": "^0.6.2"
  }
}
Mixing different versions of Credo packages can lead to compatibility issues. Always use the same version for all @credo-ts/* packages.

Next steps

Now that you have Credo installed, follow the quickstart guide to create your first agent:

Quickstart

Build your first Credo agent

Build docs developers (and LLMs) love