Time to read: 1 min
Sample dApp RNS Integration
This guide helps to quickly get started with setting up your environment to use RNS Javascript SDK and also use the sample dApp to test how RNS SDK works.
1. Project Setup
Before we begin, make sure you have a React app set up. If not, you can create one with:
npx create-react-app rns-dApp
cd rns-dApp
Then install the required dependencies:
npm install web3 @rsksmart/rns
2. Import the Required Modules
Open your main component file and import the following:
import { useEffect, useState } from "react";
import Web3 from "web3";
import RNS from "@rsksmart/rns";
import { ChainId } from "@rsksmart/rns/types";