chatscope / use-chat

React hook for state management in chat applications.
https://chatscope.io
MIT License
147 stars 23 forks source link

Add metadata to ChatMessage #22

Open aledeloss opened 1 year ago

aledeloss commented 1 year ago

We need to add metada to messages, so we can use it in the frontend for custom styling, for example. Is it possible? If not, do you think that it is feasible? I think that an optional metadata attribute in ChatMessage would work. Thanks!

supersnager commented 1 year ago

@aledeloss Could you try the version from this branch https://github.com/chatscope/use-chat/tree/v4.0.0-alpha.9 ? https://www.npmjs.com/package/@chatscope/use-chat/v/4.0.0-alpha.9 There is a generic parameter for additional data property https://github.com/chatscope/use-chat/blob/c9977f286dee9d6ba2ece1d986c942a180b907f9/src/ChatMessage.ts#L63

If it works, I can release a new major version based on the alpha branch.

singpolyma commented 12 months ago

that version working well for me