Socket
Socket
Sign inDemoInstall

@sentry-internal/feedback

Package Overview
Dependencies
Maintainers
10
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry-internal/feedback

Sentry SDK integration for user feedback


Version published
Weekly downloads
4.1M
decreased by-1.21%
Maintainers
10
Weekly downloads
 
Created
Source

Sentry

Sentry Integration for Feedback

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 GitHub if you have any feedback/concerns.

Pre-requisites

@sentry/feedback currently can only be used by browsers with Shadow DOM support.

Installation

Feedback can be imported from @sentry/browser, or a respective SDK package like @sentry/react or @sentry/vue. You don't need to install anything in order to use Feedback. The minimum version that includes Feedback is <>.

For details on using Feedback when using Sentry via the CDN bundles, see CDN bundle.

Setup

To set up the integration, add the following to your Sentry initialization. Several options are supported and passable via the integration constructor. See the configuration section below for more details.

import * as Sentry from '@sentry/browser';
// or e.g. import * as Sentry from '@sentry/react';

Sentry.init({
  dsn: '__DSN__',
  integrations: [
    new Sentry.Feedback({
      // Additional SDK configuration goes in here, for example:
      // See below for all available options
    })
  ],
  // ...
});

Lazy loading Feedback

Feedback will start automatically when you add the integration. If you do not want to start Feedback immediately (e.g. if you want to lazy-load it), you can also use addIntegration to load it later:

import * as Sentry from "@sentry/react";
import { BrowserClient } from "@sentry/browser";

Sentry.init({
  // Do not load it initially
  integrations: []
});

// Sometime later
const { Feedback } = await import('@sentry/browser');
const client = Sentry.getCurrentHub().getClient<BrowserClient>();

// Client can be undefined
client?.addIntegration(new Feedback());

Identifying Users

If you have only followed the above instructions to setup session feedbacks, you will only see IP addresses in Sentry's UI. In order to associate a user identity to a session feedback, use setUser.

import * as Sentry from "@sentry/browser";

Sentry.setUser({ email: "jane.doe@example.com" });

Loading Feedback as a CDN Bundle

As an alternative to the NPM package, you can use Feedback as a CDN bundle. Please refer to the Feedback installation guide for CDN bundle instructions.

Configuration

General Integration Configuration

The following options can be configured as options to the integration, in new Feedback({}):

keytypedefaultdescription
tbdbooleantruetbd

Manually Sending Feedback Data

Connect your own feedback UI to Sentry's You can use feedback.flush() to immediately send all currently captured feedback data. When Feedback is currently in buffering mode, this will send up to the last 60 seconds of feedback data, and also continue sending afterwards, similar to when an error happens & is recorded.

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc