Setup Credo Agent
Pre-requisites
Node.js - v16 or v18
Node.js or React Native project.
For more details, check Credo Getting Started guide.
Installing Cheqd
When using cheqd method with Credo, there are a few extra dependencies that need to be installed. We need to install the @credo-ts/cheqd
package, which implements the needed interfaces for the agent.
React Native
To enable react-native support we need to follow the steps below:
In the package.json
file add the below code snippet, which replaces the cosmjs dependencies with the cosmjs-rn packages.
Using NPM overrides
or Yarn resolutions
we can point the cosmjs
packages to cosmjs-rn
.
After that, we need to add a buffer polyfill
Then, create a shim.js file with the below code snippet
import shim.js
file into your file where the App is imported.
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 the Keplr wallet, which is available as a mobile app or browser extension for Chrome and Safari. Keplr enables users to create accounts, exchange tokens, etc. To setup Keplr wallet for cheqd follow this tutorial.
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?