JSPM

  • Created
  • Published
  • Downloads 1724
  • Score
    100M100P100Q118428F

Package Exports

  • @paramms/chat-widget
  • @paramms/chat-widget/react

Readme

@paramms/chat-widget

Embeddable guest chat client. Pure ChatStore (state) + ConnectionManager (ws/reconnect/outbox/cursor) + thin Renderer, wired by mount().

src/protocol/ is a vendored copy of the wire contract (only what the widget uses).

Run

npm install
npm run dev           # Vite demo at http://localhost:5173/ (expects the server on ws://localhost:3000)
npm run build         # tsc → dist/ (library: importable by the dashboard)
npm run build:bundle  # vite → standalone browser bundle
npm test              # vitest (store, connection, jsdom render)

Embed

<script type="module">
  import { mount } from '@paramms/chat-widget'
  mount({ el: document.getElementById('chat'), url: 'wss://your-host', profileId: 'p_hotel', subjectId: 'room-101' })
</script>