Signifly Docs
Integrate with Signifly

Feedback widget

Install the Signifly feedback widget on your site, and learn how reviewers activate it and what it sends.

The feedback widget lets invited reviewers report a bug or a feature request from your site. Each report has a title, a description and an annotated screenshot. The report goes to Signifly against the service that your site runs.

The widget is invisible to your visitors. It shows only on a device that a reviewer activated with a personal activation link. Thus you can install it in production.

The package is @signiflydev/feedback-widget on the public npm registry. The current version is 0.5.0.

We usually do this for you

For most sites, we open a pull request in your repository. The pull request adds the package and a small module with your site key. You then call the module once from your client entry point, and merge.

Before you start

You need two values from us:

ValueWhat it is
Site keyA public key that starts with sfk_. It connects the install to your service. It is not a secret.
API basehttps://operations.signifly.io

The site key is public by design. It routes each report to your service. It also lets the server check the origin of each request against the origins allowed for your site.

Install

Add the package

Install an exact version. Do not use a version range: each new version of the widget comes to your repository as its own pull request, so your CI and your preview test it first.

npm install --save-exact @signiflydev/feedback-widget@0.5.0

Initialise the widget

Call initFeedbackWidget once, in code that runs in the browser. Put the call where your app does its browser-only setup, for example the root layout or main.ts.

import { initFeedbackWidget } from "@signiflydev/feedback-widget"

initFeedbackWidget({
  siteKey: "sfk_…",
  apiBase: "https://operations.signifly.io",
})

Call it once for each page load. The call does nothing on the server. On a device that is not activated, it shows nothing.

Deploy and test

Deploy to a preview. Ask us for an activation link for the preview origin. Open the link, and the launcher shows.

The script-tag option

If your site has no JavaScript build, use the IIFE build. The package contains it at @signiflydev/feedback-widget/iife (the file dist/feedback-widget.iife.js). Copy the file into your static files, and add a script tag:

<script
  src="/vendor/feedback-widget.iife.js"
  data-site-key="sfk_…"
  data-api-base="https://operations.signifly.io"
  defer
></script>

If data-site-key or data-api-base is missing, the widget does not start. It writes a warning to the console.

Options

initFeedbackWidget takes one object:

OptionTypeRequiredDescription
siteKeystringYesThe public site key of your service.
apiBasestringYeshttps://operations.signifly.io. A trailing slash is removed.
placementcorner or offsetsNoWhere the launcher sits. The default is "bottom-right".

The function returns a promise. The promise gives { destroy } when the widget mounts, and null when it does not mount. Call destroy() to remove the widget from the page.

Placement

Give a corner: "top-left", "top-right", "bottom-left" or "bottom-right".

initFeedbackWidget({
  siteKey: "sfk_…",
  apiBase: "https://operations.signifly.io",
  placement: "bottom-left",
})

If your site uses all four corners, give CSS lengths for a free position. A number is in pixels. A string can be any CSS length, for example %, rem, vh or calc().

initFeedbackWidget({
  siteKey: "sfk_…",
  apiBase: "https://operations.signifly.io",
  placement: { bottom: "50%", left: 24 },
})

Give one side of each pair only. If you give both, top wins over bottom and left wins over right. If the widget does not accept a length, it uses the default corner.

The panel opens next to the launcher. On a screen narrower than 640 px, the panel opens as a full-screen sheet.

With the script tag, use data-placement for a corner. For a free position, use data-top, data-right, data-bottom and data-left. A side wins over a corner.

How activation works for a reviewer

We, or an admin of your organization, create a personal activation link for the reviewer in our operations platform. The link is your site address with a signifly-feedback parameter, for example https://www.example.com/?signifly-feedback=…. The reviewer must have an account in our operations platform.

The widget sends the token to our server. The server checks the token, the site key and the request origin. Then it signs the reviewer in, without a password. The widget removes the token from the address bar, so that it does not stay in the browser history.

The launcher shows on that device

The widget sets a cookie that marks the device as activated, and keeps the reviewer's session in local storage. The launcher shows on each page of the site, on that device only.

A link is personal. It signs in as the person it was created for. Do not share it, and do not paste it into a ticket or a chat.

An activation link expires 30 days after we create it. The reviewer's access continues while they hold a link that has not expired and they are a member of your organization. When this stops, the widget removes the session and hides itself at the next session refresh. The reviewer then needs a new link.

Signifly staff can also activate a device with the Signifly Feedback browser extension. The extension uses the same kind of token as a link.

How a reviewer files a report

  1. The reviewer opens the launcher.
  2. The reviewer takes a screenshot. On a desktop browser, the widget asks the browser to share the current tab and captures one frame. The reviewer can also attach an image file, on any device.
  3. The reviewer marks the screenshot with arrows, boxes, circles, freehand lines and text.
  4. The reviewer selects the kind (bug or feature request) and writes a title and a description.
  5. The reviewer sends the report.

The title, the description and the screenshot are all required.

What the widget sends

The widget sends data only to the API base that you configure. It calls three endpoints:

EndpointWhen
POST /api/widget/activateWhen a reviewer opens an activation link.
POST /api/widget/session/refreshWhen the session is about to expire.
POST /api/widget/feedbackWhen a reviewer sends a report.

A report contains:

  • the kind, the title and the description;
  • the page URL, without the activation token;
  • the screenshot, as a PNG or the image that the reviewer attached;
  • browser facts: user agent, language, platform, viewport and screen size, time zone, referrer, page title, widget version and the time of capture;
  • the last 100 warnings and errors of the browser console, and uncaught errors on the page, each cut at 500 characters.

The widget starts to record console output only on an activated device, when the launcher shows. It records nothing for your other visitors.

Console output can contain data

If your site writes personal data or tokens to console.warn or console.error, a report can contain them. Do not log such data.

If a request has no valid session, the server can still accept the report with the site key alone. It marks the report as unverified. The server limits the rate of reports for each reviewer and for each site key.

Browser and CSP notes

The widget renders inside a closed shadow root. Its styles do not affect your page, and your styles do not affect the widget.

If your site sets a Content Security Policy, check these directives:

DirectiveValue to allowWhy
connect-srchttps://operations.signifly.ioThe widget calls the three endpoints above.
style-src'unsafe-inline'The widget adds a <style> element to its shadow root.
img-srcdata:The widget shows the screenshot from a data URL.
script-srcyour own originOnly if you use the script tag. Serve the file from your origin.

Tab capture uses the browser's screen capture API. If your site sends a Permissions-Policy header that blocks display-capture, tab capture does not work. The reviewer can still attach an image file.

The activation cookie is signifly_feedback_activated. The session is in the local storage key signifly-feedback-session. Both are on your site's origin.

On this page