initConfig

initConfig is a function that init the configuration for the JoyID SDK. You should call config function in your app's entry file to set the configuration.

After init the config, all the following functions will use the config as default value:

Types

function initConfig (
  config?: DappConfig
): DappConfig

interface DappConfig {
  /**
   * The name of your app
   */
  name?: string
  /**
   * The logo of your app
   */
  logo?: string
  /**
   * The RPC URL of the AXON node that your app is using, defaults to https://axon-rpc.internal.joyid.dev
   */
  rpcURL?: string
  /**
   * The network that your app is using, defaults to JoyID AXON devnet
   */
  network?: Network
  /**
   * The URL of JoyID app url that your app is integrated with, defaults to https://app.joyid.dev
   */
  joyidAppURL?: string
  /**
   * The URL of JoyID server url that your app is integrated with
   */
  joyidServerURL?: string
}

Example

React App
import ReactDOM from 'react-dom'
import { initConfig } from '@joyid/evm'
initConfig({
  name: 'My App',
  logo: 'https://myapp.com/logo.png',
})

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 { initConfig } from '@joyid/evm'
initConfig({
  name: 'My App',
  logo: 'https://myapp.com/logo.png',
})

const app = createApp(App)
Table of Contents