Skip to content
Skillpedia
Websites & UI (frontend)7.0k · #13653

near-dapp

What it does

This skill helps you create a new NEAR web app from a starter template, or add wallet sign-in to an app you already have. It covers the React hooks approach and a plain JavaScript option, for web developers building on NEAR.

When to use it

  • ✓When you want to start a new NEAR web app from a template.
  • ✓When you want to add NEAR wallet sign-in and contract calls to an existing React app.
  • ✓When you need to connect a NEAR wallet from plain JavaScript.

Skill link

https://github.com/internet-court/internet-court-skill/blob/main/vendored/near/near-dapp/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/internet-court/internet-court-skill/blob/main/vendored/near/near-dapp/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“I want to add NEAR wallet sign-in to my existing React app.”

5 new skills a week. 1 minute to read.

How it works

For a new project, the agent runs the create-near-app tool with your chosen framework and contract language. For an existing app, it installs the connection packages, wraps the app in a provider, and uses hooks to sign in and call contracts.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

NEAR dApp

Decision Router

Determine which path to follow:

Path A: New Project

User wants to create a new NEAR dApp from scratch.

  1. Read references/create-near-app.md
  2. Run scaffolding:
npx create-near-app@latest

Or with arguments:

npx create-near-app my-app --frontend vite-react --contract rs --install

Framework options: vite-react | next-app | next-page Contract options: rs (Rust) | ts (TypeScript)

  1. If user needs wallet connection in the scaffolded app, also follow Path B.

Path B: Existing Project

User wants to add NEAR wallet connection to an existing React app.

  1. Read references/near-connect-hooks.md — React hooks API and patterns
  2. If user needs low-level wallet API or non-React integration, also read references/near-connect.md

Quick setup:

npm install near-connect-hooks @hot-labs/near-connect near-api-js
// 1. Wrap app root with NearProvider
import { NearProvider } from 'near-connect-hooks';

<NearProvider config={{ network: 'mainnet' }}>
  <App />
</NearProvider>

// 2. Use hook in components
import { useNearWallet } from 'near-connect-hooks';

const { signedAccountId, signIn, signOut, viewFunction, callFunction } = useNearWallet();

Path C: Non-React or Vanilla JS

Use @hot-labs/near-connect directly without React hooks.

  1. Read references/near-connect.md
npm install @hot-labs/near-connect
import { NearConnector } from "@hot-labs/near-connect";

const connector = new NearConnector({ network: "mainnet" });
connector.on("wallet:signIn", async (t) => {
  const wallet = await connector.wallet();
  const address = t.accounts[0].accountId;
});
await connector.connect();

Key Patterns

  • Read contract state (no wallet): viewFunction({ contractId, method, args })
  • Write to contract (wallet required): callFunction({ contractId, method, args, deposit })
  • Transfer NEAR: transfer({ receiverId, amount })
  • NEAR ↔ yoctoNEAR: Use nearToYocto() / yoctoToNear() from near-api-js
  • 1 NEAR = "1000000000000000000000000" yoctoNEAR
  • Default gas: "30000000000000" (30 TGas)
FAQ

Which frameworks can the starter use?

Vite with React, Next.js with the app router, or Next.js with pages.

Which contract languages are supported?

Rust and TypeScript.

Can I use it without React?

Yes. The skill has a separate path for plain JavaScript using the lower-level wallet library.

Details

Original description by the author

Build NEAR Protocol dApps. Use for: (1) creating new NEAR dApps with `create-near-app` (Vite+React, Next.js), (2) adding NEAR wallet connection to existing apps with `@hot-labs/near-connect` and `near-connect-hooks`, (3) building frontend UI for NEAR smart contracts, (4) integrating wallet sign-in/sign-out, contract calls, and transaction signing into web applications.

repo: internet-court/internet-court-skill

Popularity

GitHub stars
7.0k
Ranking position
#13653
License
—
Updated
10/26/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills