Skip to content

Commit 7c8f6d4

Browse files
committed
Merge branch 'develop' into feat/prioritize-component-name
2 parents fc3a7ce + ad4f2d1 commit 7c8f6d4

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ concurrency:
3232
jobs:
3333
analyze:
3434
name: Analyze
35-
runs-on: ubuntu-20.04
35+
runs-on: ubuntu-latest
3636

3737
strategy:
3838
fail-fast: false
@@ -51,6 +51,7 @@ jobs:
5151
uses: github/codeql-action/init@v2
5252
with:
5353
config-file: ./.github/codeql/codeql-config.yml
54+
queries: security-extended
5455
languages: ${{ matrix.language }}
5556
# If you wish to specify custom queries, you can do so here or in a config file.
5657
# By default, queries listed here will override any specified in a config file.

packages/feedback/README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
# Sentry Integration for Feedback
88

9-
This SDK is **considered experimental and in an alpha state**. It may experience breaking changes, and may be discontinued at any time. Please reach out on
9+
This SDK is **considered experimental and in a beta state**. It may experience breaking changes, and may be discontinued at any time. Please reach out on
1010
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback/concerns.
1111

12+
To view Feedback in Sentry, your [Sentry organization must be an early adopter](https://docs.sentry.io/product/accounts/early-adopter-features/).
13+
1214
## Pre-requisites
1315

1416
`@sentry-internal/feedback` currently can only be used by browsers with [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM) support.
@@ -210,7 +212,7 @@ import {BrowserClient, getCurrentHub} from '@sentry/react';
210212
import {Feedback} from '@sentry-internal/feedback';
211213

212214
function MyFeedbackButton() {
213-
const client = hub && getCurrentHub().getClient<BrowserClient>();
215+
const client = getCurrentHub().getClient<BrowserClient>();
214216
const feedback = client?.getIntegration(Feedback);
215217

216218
// Don't render custom feedback button if Feedback integration not installed
@@ -228,22 +230,40 @@ function MyFeedbackButton() {
228230

229231
### Bring Your Own Widget
230232

231-
You can also bring your own widget and UI and simply pass a feedback object to the `sendFeedback()` function.
233+
You can also bring your own widget and UI and simply pass a feedback object to the `sendFeedback()` function. The `sendFeedback` function accepts two parameters:
234+
* a feedback object with a required `message` property, and additionally, optional `name` and `email` properties
235+
* an options object
236+
237+
```javascript
238+
sendFeedback({
239+
name: 'Jane Doe', // optional
240+
email: '[email protected]', // optional
241+
message: 'This is an example feedback', // required
242+
}, {
243+
includeReplay: true, // optional
244+
})
245+
```
246+
247+
Here is a simple example
232248

233249
```html
234250
<form id="my-feedback-form">
235251
<input name="name" />
236252
<input name="email" />
237253
<textarea name="message" placeholder="What's the issue?" />
238254
</form>
255+
```
256+
257+
```javascript
258+
import {BrowserClient, getCurrentHub} from '@sentry/react';
259+
import {Feedback} from '@sentry-internal/feedback';
239260

240-
<script>
241261
document.getElementById('my-feedback-form').addEventListener('submit', (event) => {
262+
const feedback = getCurrentHub().getClient<BrowserClient>()?.getIntegration(Feedback);
242263
const formData = new FormData(event.currentTarget);
243-
Feedback.sendFeedback(formData);
264+
feedback.sendFeedback(formData);
244265
event.preventDefault();
245266
});
246-
</script>
247267
```
248268
249269
## Alerting on User Feedback Reports

0 commit comments

Comments
 (0)