Get started

In order to interact with JoyID App, we provide different packages to meet different requirements.

  • @joyid/core: the core JoyID SDK, which includes core functions such as authentication/sign message/verify signature, etc.
  • @joyid/ckb: SDK for manipulating Nervos CKB assets, including transferring CKB/mNFT/CoTA NFT, signing Raw Transaction, etc.
  • @joyid/evm: SDK for manipulating Ethereum assets.

Install @joyid/core

For modern Frontend projects, we recommend using @joyid/core with Yarn or NPM.

Yarn
yarn add @joyid/core
NPM
npm install @joyid/core

Using JoyID SDK from CDN

You can use JoyID SDK directly from a CDN via a script tag, a global variable joyID will be exposed.

<script src="https://unpkg.com/@joyid/core"></script>
<script>
    joyID.authWithPopup().then((res) => {
        console.log(res)
    })
</script>

Configuration

You will need to set global configuration in your app before using JoyID SDK.

React App
import ReactDOM from 'react-dom'
import { config } from '@joyid/core'
config.setNetwork('mainnet') // or 'testnet'

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<h1>Hello, world!</h1>);
Vue App
import { createApp } from 'vue'
import App from './App.vue'
import { config } from '@joyid/core'
config.setNetwork('mainnet') // or 'testnet'

const app = createApp(App)

Install @joyid/ckb

TODO.

Install @joyid/evm

Yarn
yarn add @joyid/evm
NPM
npm install @joyid/evm