0.0.33 β€’ Published 9 months ago

@bb-test/web-sdk v0.0.33

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

BetterBugs Web SDK

Simplify bug reporting within your web apps with the BetterBugs Web SDK.

The BetterBugs Web SDK allows you to include bug reporting capabilities in your application with minimal settings and effort.

Now, you can enhance your apps with user-friendly and easy-to-implement issue reporting capabilities, such as media capturing, log tracking, getting the two-minute Rewind session video, and real-time hooks to help you and your team report, diagnose, and fix issues effectively.


πŸ” Breaking it down

Using the BetterBugs Web SDK, you can enhance your web apps with bug reporting features that allow you to capture useful data about the issues. Here’s more on it.


πŸš€ Key Features of the SDK

  • Seamless integration β€” Quick installation and easy to use with a few lines of code.
  • Configurable params β€” Tweak settings for the parameters, such as metaData, recordType, enableAnnotation, and many others.
  • Use Methods β€” Control the SDK with programmatic methods, such as show(), hide(), startRecording(), and many others.
  • Event hooks β€” For deeper integration, listen for specific lifecycle events with hooks, such as:
    • after a screenshot is captured (screenshot)
    • a bug is submitted (bugSubmit)
    • a recording starts (recordingStop)
    • and many others.
  • Session Rewind (coming soon) – Automatically records the last 2 minutes of a session to capture all user interactions.
  • Floating widget customization – Control the widget’s look and placement.

πŸ“¦ Quick Installation

NPM install

npm install @bb-test/web-sdk

Yarn install

yarn add @bb-test/web-sdk

🧩 BetterBugs Web SDK Initialization: Usage Example

import { Betterbugs } from '@bb-test/web-sdk';

const bb = new Betterbugs({
  email: 'john@example.com',
  apiKey: process.env.TEST_API_KEY || '',
  disableScreenshot: true,
  disableRecording: true,
  mode: 'production',
});

βœ… Quick Overview of the Example Code

  1. Imports the Betterbugs SDK β€” Pulls in Betterbugs from the @bb-test/web-sdk package.
  2. Creates a new instance (bb) β€” The configuration object sets options for:
    • apiKey: Get value from environment variable.
    • email: Email of the user who is reporting bug.
    • mode: Production mode for customer support.
    • disableScreenshot: Enables screenshot.
    • disableRecording: Enables recording.

βš™οΈ Configurable Options

OptionTypeDescription
apiKeystringProject-specific API* (required)
emailstringEmail of the user who is reporting bug. Works in production mode only. (e.g., john@example.com)
mode"development" \| "production"Mode of operation (debugging or live use)
enableRewindbooleanEnable rewind session capturing (coming soon)
disableScreenshotbooleanEnable screenshot capturing
disableRecordingbooleanEnable recording screen
metaDataarray<object>Custom metadata (e.g., { userId: 123 })
recordType"recordVideo" \| "domRecord"Recording type: media (recordVideo) or DOM (domRecord)
enableAnnotationbooleanEnable annotation tools
showActionButtonbooleanToggle visibility of floating action button
position{ top?: string, left?: string, right?: string, bottom?: string }Widget position
theme"dark" \| "light"Dark or light theme
primaryColorstringPrimary color(branding color)
primaryTextColorstringPrimary text color for buttons
actionButtonComponentReact.ReactNode \| stringComponent for action button (React component or html string accpted)
bugSuccessComponentReact.ReactNode \| stringWill be visible when bug is created successfully (React component or html string accpted)
maxRecordingMinutesnumberMaximum recording length

πŸ§ͺ Programmatic Methods

MethodDescription
setEmail()Update email of bug reporter
changeTheme()Update theme
changePrimaryColor()Update primary color
changePrimaryTextColor()Update primary text color
show()Show the floating widget
hide()Hide the floating widget
openWidget()Open the bug report widget
closeWidget()Close the bug report widget
updateMetadata()Update the attached metadata
captureScreenshot()Trigger screenshot capture
startRecording()Start session recording
stopRecording()Stop the ongoing recording
on()Register an event listener
off()Unregister an event listener
destroy()Destroy the BetterBugs instance

πŸ”„ Lifecycle Event Hooks

EventTrigger Description
emailUpdateTriggered when email updated
screenshotTriggered after the screenshot is captured
recordingStartTriggered when the recording starts
recordingStopTriggered when the recording stops
bugSubmitTriggered after a bug is submitted
metaDataUpdateTriggered when metadata is updated
positionUpdateTriggered when widget position changes
widgetOpenTriggered when the widget is opened
widgetCloseTriggered when the widget is closed
showActionButtonTriggered when the action button is shown
hideActionButtonTriggered when the action button is hidden
sessionCreatedTriggered when a new session is created

🧱 Floating Widget Customization Options

  • Positioning β€” Define widget position using { top, left, right, bottom }
  • UI Customization β€” Modify dark or light theme, primary color, primary text color, custom action button component and custom bug created successfully compenent

Note: Session Rewind feature is coming soon.

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

9 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

0.0.17

9 months ago

0.0.16

9 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago