Getting Started with the SDK
The simplest way to start using the vaults.fyi API is with our SDK.
See below for installation instructions and find detailed documentation here: SDK Reference
Using npm
npm install @vaultsfyi/sdk
Using Yarn
yarn add @vaultsfyi/sdk
Using pnpm
pnpm add @vaultsfyi/sdk
Using Bun
bun add @vaultsfyi/sdk
Using jspm
jspm install @vaultsfyi/sdk
export VAULTS_FYI_API_KEY="your_api_key_here"
To start using the SDK you'll need to obtain an API key. The fastest way is to fill this form.
import pkg from '@vaultsfyi/sdk';
const { VaultsSdk } = pkg;
const vaultsFyi = new VaultsSdk({
apiKey: process.env.VAULTS_FYI_API_KEY,
});
- To take it for a spin, use one of the SDK functions:
example:
getDepositOptions
to get multiple relevant yield opportunities for a specific blockchain address.Find more in SDK Reference
const depositOptions = await vaultsFyi.getDepositOptions({
path: { userAddress: '0xdB79e7E9e1412457528e40db9fCDBe69f558777d' },
query: { allowedAssets: ['USDC', 'USDS'] }
});
For more detailed example implementation check out our lightning tutorials (<5 mins!)
Last updated