Skip to main content

Widget Configuration

Customize the appearance and behavior of the BugPin widget.

Configuration Methods

Widget settings can be configured in three ways (in order of priority):

  1. Script data attributes - Highest priority, set in HTML
  2. Admin panel - Configure in project settings
  3. Default values - Built-in defaults

Position

Control where the widget button appears on the screen.

ValueDescription
bottom-rightBottom right corner (default)
bottom-leftBottom left corner
top-rightTop right corner
top-leftTop left corner
<script
src="https://bugs.example.com/widget.js"
data-api-key="your-api-key"
data-position="bottom-left"
async
></script>

Button Appearance

Button Shape

ValueDescription
rectangleRectangular button (default)
roundCircular button

Button Text

Set custom text to display on the button. If not set, only the icon is shown.

Button Icon

Choose from available icons or use the default bug icon. The icon is displayed alongside any button text.

Icon Customization

OptionDefaultDescription
buttonIconSize18Icon size in pixels
buttonIconStroke2Icon stroke width

Theme

The widget supports light and dark modes.

ValueDescription
autoMatch user's system preference (default)
lightAlways use light mode
darkAlways use dark mode
<script
src="https://bugs.example.com/widget.js"
data-api-key="your-api-key"
data-theme="dark"
async
></script>

Colors

Customize colors for both light and dark modes. All colors should be valid CSS color values (hex, rgb, etc.).

Launcher Button Colors (Light Mode)

OptionDefaultDescription
lightButtonColor#6366f1Button background color
lightTextColor#ffffffButton text/icon color
lightButtonHoverColor#4f46e5Button background on hover
lightTextHoverColor#ffffffText/icon color on hover

Launcher Button Colors (Dark Mode)

OptionDefaultDescription
darkButtonColor#818cf8Button background color
darkTextColor#1e1b4bButton text/icon color
darkButtonHoverColor#a5b4fcButton background on hover
darkTextHoverColor#1e1b4bText/icon color on hover

Dialog Colors

The dialog (popup) has separate color settings for its buttons:

Light Mode Dialog:

OptionDefaultDescription
dialogLightButtonColor#ebebebDialog button background
dialogLightTextColor#575757Dialog button text
dialogLightButtonHoverColor#ebebebDialog button hover background
dialogLightTextHoverColor#575757Dialog button hover text

Dark Mode Dialog:

OptionDefaultDescription
dialogDarkButtonColor#3c3c3cDialog button background
dialogDarkTextColor#c3c3c3Dialog button text
dialogDarkButtonHoverColor#3c3c3cDialog button hover background
dialogDarkTextHoverColor#c3c3c3Dialog button hover text

Tooltip

Show a tooltip when users hover over the widget button.

OptionDefaultDescription
tooltipEnabledfalseShow tooltip on hover
tooltipTextnullCustom tooltip text

Hover Effects

OptionDefaultDescription
enableHoverScaleEffecttrueScale button slightly on hover

Feature Toggles

Enable or disable specific widget features.

OptionDefaultDescription
enableScreenshottrueAllow screenshot capture
enableAnnotationtrueAllow screenshot annotation
enableConsoleCapturetrueCapture browser console logs

Screenshot Settings

Capture Method

ValueDescription
visibleCapture only the visible viewport (default)
fullpageCapture the entire scrollable page
elementCapture a specific element

Screen Capture API

OptionDefaultDescription
useScreenCaptureAPIfalseUse browser's Screen Capture API

The Screen Capture API provides higher quality screenshots but requires user permission.

Maximum Screenshot Size

OptionDefaultDescription
maxScreenshotSize5242880Maximum size in bytes (5MB)

Complete Configuration Example

Here's an example using programmatic initialization with all options:

BugPin.init({
apiKey: 'your-api-key',
serverUrl: 'https://bugs.example.com',

// Position
position: 'bottom-right',

// Button appearance
buttonText: 'Report Bug',
buttonShape: 'rectangle',
buttonIcon: 'bug',
buttonIconSize: 18,
buttonIconStroke: 2,

// Theme
theme: 'auto',

// Light mode colors
lightButtonColor: '#6366f1',
lightTextColor: '#ffffff',
lightButtonHoverColor: '#4f46e5',
lightTextHoverColor: '#ffffff',

// Dark mode colors
darkButtonColor: '#818cf8',
darkTextColor: '#1e1b4b',
darkButtonHoverColor: '#a5b4fc',
darkTextHoverColor: '#1e1b4b',

// Tooltip
tooltipEnabled: true,
tooltipText: 'Found a bug? Click here!',

// Effects
enableHoverScaleEffect: true,

// Features
enableScreenshot: true,
enableAnnotation: true,
enableConsoleCapture: true,

// Screenshot settings
captureMethod: 'visible',
useScreenCaptureAPI: false,
maxScreenshotSize: 5 * 1024 * 1024
});

Admin Panel Configuration

Most settings can be configured through the BugPin admin panel:

  1. Go to Projects and select your project
  2. Click on Widget Settings
  3. Configure appearance, colors, and features
  4. Changes apply immediately to all sites using that project's API key

Settings configured via script data attributes will override admin panel settings.