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

0.0.3-alpha.0 • Public • Published

@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

...

Package Sidebar

Install

npm i @debox-global/html

Homepage

debox.pro/

Weekly Downloads

0

Version

0.0.3-alpha.0

License

LGPL 2.1

Unpacked Size

369 kB

Total Files

9

Last publish

Collaborators

  • muchang06
  • tiechou