> For the complete documentation index, see [llms.txt](https://docs.betterbugs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.betterbugs.io/developer-guide/methods-and-event-hooks.md).

# Methods and Event hooks

### Use Methods for the SDK widget  + configure for deeper integrations with Lifecycle Event hooks

#### Available Methods

<table><thead><tr><th width="302.8887939453125">Option</th><th>Description</th></tr></thead><tbody><tr><td><strong>setEmail()</strong></td><td>Update the email of the bug reporter</td></tr><tr><td><strong>setStyles()</strong></td><td>Update the styles of the widget</td></tr><tr><td><strong>getStyles()</strong></td><td>Get the styles of the widget</td></tr><tr><td><strong>show()</strong></td><td>Show the floating widget</td></tr><tr><td><strong>hide()</strong></td><td>Hide the floating widget</td></tr><tr><td><strong>openWidget()</strong></td><td>Open the bug reporting widget</td></tr><tr><td><strong>closeWidget()</strong></td><td>Close the bug reporting widget</td></tr><tr><td><strong>setMetadata()</strong></td><td>Update the attached metadata</td></tr><tr><td><strong>captureScreenshot()</strong></td><td>Trigger screenshot capture</td></tr><tr><td><strong>startRecording()</strong></td><td>Start session recording</td></tr><tr><td><strong>stopRecording()</strong></td><td>Stop the ongoing recording</td></tr><tr><td><strong>on()</strong></td><td>Register an event listener</td></tr><tr><td><strong>off()</strong></td><td>Unregister an event listener</td></tr><tr><td><strong>destroy()</strong></td><td>Destroy the BetterBugs instance</td></tr></tbody></table>

#### Available Lifecycle Event hooks&#x20;

You can also listen to lifecycle events of the SDK widget and use it for deeper integrations in your apps:&#x20;

<table><thead><tr><th width="308.4444580078125">Lifecycle event</th><th>Trigger description</th></tr></thead><tbody><tr><td><strong>emailUpdate</strong></td><td>Triggered when the email is updated</td></tr><tr><td><strong>screenshot</strong></td><td>Triggered after the screenshot is captured</td></tr><tr><td><strong>recordingStart</strong></td><td>Triggered when the recording starts</td></tr><tr><td><strong>recordingStop</strong></td><td>Triggered when the recording stops</td></tr><tr><td><strong>bugSubmit</strong></td><td>Triggered after the bug report/feedback is submitted</td></tr><tr><td><strong>metaDataUpdate</strong></td><td>Triggered when the metadata is updated</td></tr><tr><td><strong>positionUpdate</strong></td><td>Triggered when the widget position changes</td></tr><tr><td><strong>widgetOpen</strong></td><td>Triggered when the widget opens</td></tr><tr><td><strong>widgetClose</strong></td><td>Triggered when the widget closes</td></tr><tr><td><strong>showActionButton</strong></td><td>Triggered when the action button gets displayed</td></tr><tr><td><strong>hideActionButton</strong></td><td>Triggered when the action button hides</td></tr><tr><td><strong>sessionCreated</strong></td><td>Triggered when a new session is created</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.betterbugs.io/developer-guide/methods-and-event-hooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
