@debox-global/react
TypeScript icon, indicating that this package has built-in type declarations

0.0.3-alpha.0 • Public • Published

@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

...

Package Sidebar

Install

npm i @debox-global/react

Homepage

debox.pro/

Weekly Downloads

0

Version

0.0.3-alpha.0

License

LGPL 2.1

Unpacked Size

9.64 kB

Total Files

8

Last publish

Collaborators

  • muchang06
  • tiechou