JavaScript library to interact with NEAR Protocol via RPC API
NEAR JavaScript API is a complete library to interact with the NEAR blockchain. You can use it in the browser, or in Node.js runtime.
Learn how to use the library in your project
Read the TypeDoc API documentation
Cookbook with common use cases
To quickly get started with integrating NEAR in a web browser, read our Web Frontend integration article.
Install dependencies
pnpm install
Run continuous build with:
pnpm -r compile -w
Prepare dist
version by running:
pnpm dist
Start the node by following instructions from nearcore, then
pnpm test
Tests use sample contract from near-hello
npm package, see https://github.com/nearprotocol/near-hello
From the root directory, run the following commands:
cd e2e
pnpm install --ignore-workspace
pnpm test
The --ignore-workspace
flag is required because the e2e
project is intentionally excluded from the workspace.
This setup ensures that packages are installed just like a real application would — as standalone builds. Workspace linking would not allow this, as it forces symlinks instead of proper package installations.
Follow next steps:
node fetch_error_schema.js
pnpm build
and pnpm test
to check tests still workpnpm changeset
to generate a changeset with a minor bump for the @near-js/utils packageTo help you get started quickly, we have prepared example templates for popular frameworks:
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE and LICENSE-APACHE for details.