This file provides an overview of the project, installation steps, usage, and development instructions.
Rich Canvas is a reusable JavaScript library for rendering rich media content (text, audio, video) in chat interfaces. Designed for flexibility and scalability, this library can be easily integrated into any project.
- Render text, audio, and video content.
- Simple API for importing and using the library.
- Modular and extensible design.
- Compatible with React and modern JavaScript frameworks.
To install Rich Canvas via npm: bash npm install rich-canvas
javascript import { display } from 'rich-canvas'; const messages = [ { role: 'user', content: 'Hello!', contentType: 'text' }, { role: 'assistant', content: 'Hi there!', contentType: 'text' }, { role: 'assistant', content: 'https://youtu.be/dQw4w9WgXcQ', contentType: 'video' }, ]; display({ target: '#chat-window', messages, isTyping: true, });
html
<script src="https://cdn.your-hosted-rich-canvas.com/rich-canvas.js"></script> <script> RichCanvas.display({ target: '#chat-window', messages: [...], isTyping: true, }); </script>To build the project: bash npm run build
To run tests: bash npm test
You can deploy Rich Canvas on AWS or use npm for package management.