Skip to main content

Getting Started

info

Once your're approved, you're all set to explore the whole platform and integrate DripVerse in your DApp. This guide will step your through your first utility creation and integration in your own platform through Drip SDK.

Step 1: Mint your first NFT

Step 2: Add Utility

If the transation goes through and your NFT is successfully minted, you'll be redirected to the NFT details page.

  • To add a utility, click on Create new, fill the relevant details and click Submit and sign the transaction.

Step 3: Generate project key

  • Hover over your created utility, click on ⚙️ after the card unlocks to go to your utility dashboard.
  • Click on Generate Key and copy the key to your clipboard from the side menu.
  • Also note down your UTILITY ID, we'll use it in our SDK.

Step 4: Integrating DripVerse SDK

Install the DripVerse SDK.

npm install dripverse

Import the library in your project.

import { DripSDK } from "dripverse";

Paste the constants and initialize the drip object with your project key.

const PROJECT_KEY = "<YOUR-PROJECT-KEY>";
const UTILITY_ID = "<YOUR-UTILITY-ID>";
const USER_ADDRESS = "<YOUR-WALLET-ADDRESS>";

const drip = new DripSDK(PROJECT_KEY, "alpha");

You can use the hasAccess method to verify whether the user has access, if the user is unauthorized then it throws an error, you can wrap the method in a try...catch block to handle it accordingly.

const allowed = await drip.hasAccess(USER_ADDRESS, UTILITY_ID);

if (allowed) {
// YOUR SUCCESS CODE HERE
} else {
// YOUR FAILURE CODE HERE
}
tip

View SDK docs for more features and detailed usage.