0.0.33-beta.4 • Published 9 months ago

@contember/echo v0.0.33-beta.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 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

9 months ago

0.0.33-beta.3

9 months ago

0.0.33-beta.2

9 months ago

0.0.33-beta.1

9 months ago

0.0.33

9 months ago

0.0.32

9 months ago

0.0.31

9 months ago

0.0.30

9 months ago

0.0.29

10 months ago

0.0.28

10 months ago

0.0.27

10 months ago

0.0.26

10 months ago

0.0.25

10 months ago

0.0.24

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago