Skip to main content
Version: near-api-js@1.1.0

Module: browserConnect

Connect to NEAR using the provided configuration.

networkId and nodeUrl are required.

To sign transactions you can also pass: keyStore

Both are passed they are prioritize in that order.

See

ConnectConfig

Example

async function initNear() {
const near = await connect({
networkId: 'testnet',
nodeUrl: 'https://rpc.testnet.near.org'
})
}

Interfaces

Functions

connect

connect(config): Promise<Near>

Initialize connection to Near network.

Parameters

NameType
configConnectConfig

Returns

Promise<Near>

Defined in

browser-connect.ts:33