0.0.3-alpha.0 • Published 12 months ago

@debox-global/react v0.0.3-alpha.0

Weekly downloads
-
License
LGPL 2.1
Repository
-
Last release
12 months ago

@debox-global/react

...

Getting Started

  1. Need to use NPM
npm install @debox-global/react
  1. Initialize DeBoxChat

Not Support SSR

import { DeBoxChat } from '@debox-global/react'

const APP = () => {
  return (
    <DeBoxChat
      config={{
        dao: {
          contractAddress: '0x...',
          chainId: 1 | 56,
          source: 0 | 1
        },
        projectId: 'DeBox projectId ...',
        themeMode: 'dark' | 'light',
        themeColor: 'default' | 'green'
      }}
      client={window.ethereum} // Currently only standard providers are supported. (For example: metamask, walletconnect...)
    />
  )
}

API

useLogin

import { useLogin } from '@debox-global/react'

const {
  data: { chainId, address, isConnected, ... },
  login,
  logout
} = useLogin()

useTheme

import { useTheme } from '@debox-global/react'

const { theme, setTheme } = useTheme()

Examples

...