Integrating Contracts
To integrate NEAR to your frontend, you will leverage two tools:
Wallet Selector: Enables the user to select their preferred NEAR wallet in your dApp.NEAR API JS: A suite of tools to interact with the NEAR RPC.
Using those tools you will implement the following flow:
- Setup a wallet selector.
- Load the wallet selector on start-up.
- Ask the user to sign-in using a NEAR wallet.
- Call methods in the contract.
Naxios
You can optionally use Naxios. A promise-based NEAR Contract and NEAR Wallet Client for browser.
Naxios was designed to facilitate the React / Next.js integration with NEAR Blockchain and avoid the boilerplate of setting up a wallet and contract.