Setup Credo Agent

Setup your Credo Agent to get started.

This guide walks you through the setup process for a Credo Agent with support for cheqd DIDs and AnonCreds.

Prerequisites

Before you begin, make sure you have the following:

  • Node.js v16 or v18

  • Yarn or npm installed

  • A working Node.js or React Native project

  • Follow the Getting Started guide if you're new to Credo

Installing Cheqd

To enable cheqd in your agent, install the required package:

yarn add @credo-ts/cheqd
# or
npm install @credo-ts/cheqd

This package provides everything needed to register, resolve, and interact with did:cheqd identifiers and AnonCreds objects.

React Native Support

If you're using React Native, additional steps are needed to support cosmjs:

1. Use cosmjs-rn packages

Update your package.json using npm overrides or Yarn resolutions:

Example (NPM overrides):

Example (Yarn resolutions):

2. Add Buffer Polyfill

Install the buffer package:

Create a shim.js file:

Then, import this shim in your entry point (e.g. before your App.tsx is rendered):

Adding cheqd to the Agent

After installing the dependencies, we can register the cheqd module on the agent by adding the below code snippet to the agent constructor.

The cosmosPayerSeed can be a 32-bit seed value or mnemonic. It can be managed using Leap wallet, which is available as a mobile app or browser extension for Chrome and Safari. Leap enables users to create accounts, exchange tokens, etc. To setup Leap wallet for cheqd follow the tutorial below:

Next steps

Now that your Credo agent is successfully set up to work with cheqd, try following our tutorials for creating a new DID or issuing Verifiable Credentials.

Last updated

Was this helpful?