Documentation Index
Fetch the complete documentation index at: https://kit.near.tools/llms.txt
Use this file to discover all available pages before exploring further.
near-kit is designed to work seamlessly in browser environments. The logic for building transactions is identical to the server-side; the only difference is that signing is delegated to the userโs wallet via an Adapter.
New to React? Check out
@near-kit/react for ready-to-use hooks that handle loading states, error handling, and integrate with React Query or SWR.๐ Live Demo
Seenear-kit running in a real React application using NEAR Connect.
- Live App: guestbook.near.tools
- Source Code: github.com/r-near/near-kit-guestbook-demo
The Adapter Pattern
You initialize theNear instance with a wallet object instead of a private key.
near exactly as you would in a backend script. When you call .send(), the library automatically triggers the walletโs popup for the user to approve the transaction.
NEAR Connect
NEAR Connect is the standard wallet connection library for the NEAR ecosystem.Setup
Best Practice: React Context
In a React application, you should create aWalletContext to store the Near instance so it can be accessed by any component.
Here is a simplified pattern from the Guestbook Demo: