@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.
- Official NPM Package: @userback/widget
- Official GitHub Repository: Userback JavaScript SDK
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:
- Log in to your Userback workspace.
- Click the Help Center icon in the top-right corner.
- Select Contact us to start a chat with our support team.
Updated about 2 months ago
Whatβs Next