@debox-global/html
v0.0.3-alpha.0
Published
Use `debox sdk` with `HTML`
Downloads
6
Readme
@debox-global/html
Use debox sdk
with HTML
Getting Started
- Need to use
NPM
npm install @debox-global/html
- Insert HTML DOM
<debox-chat style="..."></debox-chat>
- 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
...