@dbs-portal/module-chat
v1.0.0
Published
Real-time chat and messaging functionality
Readme
@dbs-portal/module-chat
Real-time chat and messaging functionality
Installation
yarn add @dbs-portal/module-chatUsage
import { Chat, createChat } from '@dbs-portal/module-chat'
// Use the default instance
const result = await defaultChat.process(data)
// Or create a custom instance
const customChat = createChat({
enabled: true,
debug: true,
})
const customResult = await customChat.process(data)API Reference
Classes
Chat
Main class for @dbs-portal/module-chat functionality.
Constructor:
new Chat(config?: ChatConfig)
Methods:
getConfig(): ChatConfig- Get current configurationprocess<T>(data: T): Promise<ChatResult<T>>- Process data
Functions
createChat(config?)
Factory function to create a new Chat instance.
Development
# Build the package
yarn build
# Run tests
yarn test
# Type checking
yarn type-check
# Linting
yarn lint