Skip to main content

Prerequisites

Before starting to work with Mycelium SDK in a Cloud version you need to have an API key. If you don’t have it, please refer to the section:

API key

Get a key to start using Mycelium Cloud

Installation

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
**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()