Skip to content

Docs follow-ups: recipes page, GenUI sequence diagram, EventBus reference #18

Description

@AimTune

Three small additions to the docs/ tree to round out the reference set.

Tasks

docs/recipes.md

A "common recipes" page with copy-paste examples for the three frameworks people actually integrate Chativa with, plus the most-asked DirectLine setup question.

  • Embed in React (with the useEffect-based registration of the connector + chatStore.setConnector call).
  • Embed in Vue (Vue 3 / <script setup>).
  • Embed in Wordpress (script tag in the theme + window.chativaSettings).
  • DirectLine with a custom token endpoint — backend endpoint contract + how to wire tokenGeneratorUrl.

Linked from the README under "Documentation".

Sequence diagram for GenUI round-trip

docs/genui/streaming.md describes the chunk types and the round-trip from component event → connector → bot's response chunk. A mermaid sequence diagram makes the timing instantly readable.

  • Mermaid sequenceDiagram with: User → GenUIComponent → ChatEngine → IConnector → bot backend → connector emits event chunk → component's listenEvent callback fires.

docs/events.md

packages/core/src/application/EventBus.ts defines a typed EventBusPayloadMap with 10 events. There is no central reference for them — devs have to read the source.

  • One-page table: event name | payload type | when it fires.
  • Cross-link from docs/extensions.md ("for read-only analytics, prefer EventBus") and docs/architecture.md.

Acceptance criteria

  • All three pages link from README.md → Documentation table.
  • All three pages render without errors on GitHub (mermaid diagrams included).

Spun out of todos.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions