Skip to main content
Prerequisites:
  • Node.js version 22.11.00 or higher
  • pnpm 10.9.0 or higher
Follow these steps to install and run Mycelium SDK for your product
1

Create a simple project

Create a simple project to test the SDK
pnpm init -y
2

Install the Mycelium SDK

pnpm install @mycelium-sdk/core
3

Init SDK

Initiate an SDK with basic settings and API key. Get a key
Don’t know what is risk level? Read about it!
import { MyceliumSDK } from "@mycelium-sdk/core";

const sdk = await MyceliumSDK.init({
  apiKey: "sk_...",
  chainId: 8453,
  protocolsSecurityConfig: {
    riskLevel: "low",
  },
});
This will initiate an SDK object that you can use further to manage web3 account and getting DeFi opportunities
4

That's it!

You’re done! Right now you can check which DeFi opportunities are available so far
await sdk.protocols.getBestVaults()

SDK limitations

The SDK is the server only and can’t be used directly on frontend. To use Mycelium for frontend projects you need to create a basic API to access SDK abilities
The React library is currently under development and will be available soon. Stay tuned on our GitHub

SDK settings

There are several parameters that you need to define on the initialization step before using the SDK except of API key. To get more information about which settings can be provided and for what they are responsible to, you can check the SDK settings

Troubleshooting

This may be due to an outdated version of node. Try the following:
  1. Remove the currently-installed version of the CLI: npm remove -g mint
  2. Upgrade to Node v19 or higher.
  3. Reinstall the CLI: npm i -g mint
Solution: Go to the root of your device and delete the ~/.mintlify folder. Then run mint dev again.