Install the Provider SDK

Provider SDK works with OneKey Browser Extension ( version >= 2.3.2 ) installed

We provide an SDK named onekey-near-provider as an npm package, which also requires near-api-js installed.

You can check the sdk source code at Github, with full example code here.

# with npm
npm install near-api-js @onekeyfe/onekey-near-provider

# with yarn
yarn add near-api-js @onekeyfe/onekey-near-provider

Then you can create the provider instance.

import { OneKeyNearProvider } from '@onekeyfe/onekey-near-provider';

const provider = new OneKeyNearProvider();

Caution: The Provider SDK is not compatible with SSR.

If you are using next.js including SSR feature, you can check this document about how to dynamic import with no ssr.

Last updated