Install Userback Code
Install the Userback widget using the method that fits your stack.
Before you startYou'll need your Userback access token. Click Install Userback on the main menu of your workspace to find it.
Which method should I use?
| Method | Best for |
|---|---|
| Method 1: JavaScript snippet | Static websites and simple web apps |
| Method 2: Script tag | Apps where console log capture from page load matters |
| Method 3: npm package | React, Vue, Next.js, Angular, or any npm-based project |
Method 1: JavaScript snippet
Use this method for static websites or web apps. Note that the script loads asynchronously, so early console logs and errors may not be captured — use Method 2 if that matters to you.
- Copy your JavaScript snippet from the Install Userback page.
- Paste it before the closing
</body>tag in your HTML.
<script>
window.Userback = window.Userback || {};
Userback.access_token = 'YOUR_ACCESS_TOKEN';
// identify your logged-in users (optional)
Userback.user_data = {
id: "123456", // example data
info: {
name: "someone", // example data
email: "[email protected]" // example data
}
};
(function(d) {
var s = d.createElement('script');s.async = true;
s.src = 'https://static.userback.io/widget/v1.js';
(d.head || d.body).appendChild(s);
})(document);
</script>Method 2: Script tag
Use this method if you need console log synchronization. It loads the script in <head> so all logs and errors are captured from page load.
- Insert the script as early as possible in the
<head>of your HTML. - Initialize with
Userback.init().
<head>
<script src="https://static.userback.io/widget/v1.js"></script>
</head>
<body>
<script>
Userback.init('YOUR_ACCESS_TOKEN', {
user_data: {
id: "123456", // example data
info: {
name: "someone", // example data
email: "[email protected]" // example data
}
}
});
</script>
</body>Method 3: NPM package
Use this method for React, Vue, Next.js, Angular, or any JavaScript application using a package manager.
Verify it's working
Load your app in a browser. The Userback widget button should appear on the page. Submit a test piece of feedback, then check your feedback dashboard — it should appear there within a few seconds.
That's it.Userback is installed and collecting feedback. Head to your feedback dashboard to see submissions, manage workflows, and configure your widget.
FAQ
Which installation method should I use?
Use Method 1 for static websites. Use Method 2 if you need console logs captured from page load. Use Method 3 if you're using React, Vue, Next.js, Angular, or any npm-based project.
The widget isn't showing on my website. What should I check?
Make sure your domain is added to the correct project in Userback — see Managing Domains for help. Also check that the access token in your code matches the one shown in your workspace.
Can I hide the widget button and trigger it programmatically?
Yes — use the JavaScript SDK to control widget visibility. See Bind Widget to Button for a step-by-step guide.
Need help? Visit the Help Center or use the chat bubble on this page to contact our support team.
Updated 18 days ago