0.0.33-beta.4 • Published 7 months ago

@contember/echo v0.0.33-beta.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
7 months ago

Echo

A lightweight tool for capturing user feedback with screenshots, annotations, and debug information. Built with Solid.js and designed to seamlessly integrate into any web application.

Features

  • 📸 Screenshot Capture: Automatically capture the current page state
  • ✏️ Drawing Tools: Annotate screenshots with various drawing tools
  • 🎨 Customizable UI: Configurable colors, position and text
  • 🌐 Framework Agnostic: Works with any web application
  • 🎯 Easy Integration: Simple setup with NPM or direct script inclusion
  • 🎨 Drawing Features:
    • Multiple colors for annotations
    • WIP: Different shapes and tools
  • 📱 Responsive Design: WIP: Works seamlessly on desktop and mobile devices
  • 🔍 Console tracking: Captures last 1000 console entries

Usage

Using as an NPM Package

import { initEcho } from '@contember/echo';

initEcho({
  onSubmit: async (data) => {
    console.log('Feedback submitted:', data);
    // Handle the feedback data (send to server, etc.)
  }
});

Using Directly in HTML

<script type="module">
  import { initEcho } from "https://esm.sh/@contember/echo";

  initEcho({
    onSubmit: async (data) => {
      console.log('Feedback submitted:', data);
      // Handle the feedback data (send to server, etc.)
    }
  });
</script>

Configuration Options

OptionTypeRequiredDefaultDescription
positionstringNo'bottom-right'WIP: Position on the page. Available positions: 'top-left', 'top-center', 'top-right', 'middle-left', 'middle-right', 'bottom-left', 'bottom-center', 'bottom-right'
primaryColorstringNo'#6227dc'Primary color for UI elements
textConfigobjectNoenglishCustomize all text elements in the interface
onSubmitfunctionYes-Callback function when feedback is submitted

Feedback Payload Structure

The onSubmit callback receives a data object with the following structure:

interface FeedbackPayload {
  comment: string;          // User's written feedback
  screenshot: string;       // Base64 encoded screenshot
  metadata: {
    url: string;            // Current page URL
    userAgent: string;      // Browser user agent
    timestamp: number;      // Submission timestamp
    browserInfo: {
      width: number;            // Width of viewport
      height: number;           // Height of viewport
      screenWidth: number;      // Width of device
      screenHeight: number;     // Height of device 
    };
  };
  console: Array<{                    // Last 1000 console entries (logs, warnings, errors, uncaught errors, unhandled promise rejections)
    type: 'log' | 'warn' | 'error';   // Type of console entry
    message: string;                  // Content of the console message
    timestamp: string;                // When the message was logged
  }>;
}

License

Apache-2.0 - see LICENSE for details.

0.0.33-beta.4

7 months ago

0.0.33-beta.3

7 months ago

0.0.33-beta.2

7 months ago

0.0.33-beta.1

8 months ago

0.0.33

8 months ago

0.0.32

8 months ago

0.0.31

8 months ago

0.0.30

8 months ago

0.0.29

8 months ago

0.0.28

9 months ago

0.0.27

9 months ago

0.0.26

9 months ago

0.0.25

9 months ago

0.0.24

9 months ago

0.0.23

9 months ago

0.0.22

9 months ago

0.0.21

9 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.18

9 months ago