-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
How to get the typed Feedback integration? #10941
Copy link
Copy link
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
@sentry/nextjs 7.105.0
Framework Version
18.2.0
Link to Sentry event
No response
SDK Setup
import * as Sentry from '@sentry/nextjs';
const feedback = Sentry.feedbackIntegration({
autoInject: false,
colorScheme: 'light',
buttonLabel: 'Give Feedback',
messagePlaceholder: '',
submitButtonLabel: 'Send Feedback',
formTitle: 'Give Feedback',
showBranding: false,
isEmailRequired: false,
submitBackground: 'rgba(72, 16, 193, 1)',
submitBackgroundHover: 'rgb(172, 152, 254, 1)',
submitBorder: 'rgb(172, 152, 254, 1)',
fontFamily: 'Inter',
showEmail: false,
showName: false,
});
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
ignoreErrors: ['ResizeObserver loop completed with undelivered notifications'],
integrations: [feedback],
});
### Steps to Reproduce
Create a custom component as per the documentation (doc is not up to date with latest change of interface from the SDK)
```jsx
import { BrowserClient, getClient } from '@sentry/react';
const SentryFeedbackButton = () => {
const client = getClient<BrowserClient>();
const feedback = client?.getIntegrationByName('Feedback');
if (!feedback) {
return null;
}
return(
<button type="button" onClick={() => feedback.openDialog()}>
Give me feedback
</button>,
);
};
export default SentryFeedbackButton;
Expected Result
- The documentation should be up to date.
- The method
getIntegrationByNameshould return the appropriateIntegrationtype with its own methods defined.
Actual Result
Not sure how to import the type FeedbackWidget.
The error are:
Property 'return' does not exist on type 'Integration'.
Property 'openDialog' does not exist on type 'Integration'.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
No status