@userback/widget

Overview

The Userback JavaScript package allows you to seamlessly integrate the Userback Widget into your JavaScript or TypeScript application for feedback collection and management.

Prerequisites

Before you begin, ensure the following:

  • Userback Workspace: A workspace is needed to collect and manage feedback.
  • Access Token: Retrieve your token via the Code Icon in your workspace.
  • Plan Requirements: Available on all plans.

Installation

To install the Userback package and embed the widget in your application, use the following command:

NPM Installation

npm i @userback/widget

Quickstart

Embed the Userback Widget in your application using the example below:

JavaScript Example

import Userback from '@userback/widget';

// Optionally identify logged-in users
const options = {
  user_data: {
    id: "123456", // Unique user ID
    info: {
      name: "someone", // User's name
      email: "[email protected]" // User's email
    }
  }
};

Userback('**Userback Access Token**', options);

Examples

Example 1: Delay Showing the Widget

Use a custom button to control when the widget is displayed.

Userback('**Userback Access Token**', { autohide: true }).then(ub => {
    document.querySelector('.my-own-help-button').addEventListener('click', function() {
        ub.show();
    });
});

Example 2: Get a Reference to the Userback Widget

Gain direct access to the widget to customize its behavior.

import { getUserback } from '@userback/widget';

document.querySelector('button.screenshot').addEventListener('click', (event) => {
    getUserback().open('bug', 'screenshot');
});

For advanced customization, refer to the JavaScript SDK Documentation.


πŸ›Ÿ Support

Need help? Here’s how to get assistance:

  1. Log in to your Userback workspace.
  2. Click the Help Center icon in the top-right corner.
  3. Select Contact us to start a chat with our support team.

What’s Next