0.0.3-alpha.0 • Published 12 months ago

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

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

@debox-global/html

Use debox sdk with HTML

Getting Started

  1. Need to use NPM
npm install @debox-global/html
  1. Insert HTML DOM
<debox-chat style="..."></debox-chat>
  1. Initialize DeBoxChat

Not Support SSR

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

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

setProvider

deboxChat.setProvider()

setTheme

deboxChat.setTheme(opt: Pick<ConfigCtrlState, 'themeColor' | 'themeMode'>)

login

await deboxChat.login(isTip?: boolean)

logout

await deboxChat.logout()

Examples

...