🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@userback/widget

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@userback/widget

Userback.io widget for Javascript and Typescript

0.2.1
Source
npm
Version published
Weekly downloads
15K
1.16%
Maintainers
2
Weekly downloads
 
Created
Source

@userback/widget

The official NPM module for embedding the Userback.io widget into your Javascript or Typescript application.

Edit in CodeSandbox

Installation

npm i @userback/widget or yarn add @userback/widget

Quickstart

import Userback from '@userback/widget'
Userback('**USERBACK_TOKEN**')

Examples

Show the Userback Widget immediately after loading on the bug screen.

Userback(..).then(ub => {
    ub.show('bug')
})

Or delay showing it until later:

Userback(.., { autohide: true }).then(ub => {
    document.querySelector('button.show-feedback').addEventListener('click', function(){
        ub.show()
    })
})

Using the options object to enable native screenshots while binding screenshots to a HTML button:

const userback = await Userback(..., { navtive_screenshot: true })
document.querySelector('button.screenshot').addEventListener('click', (event) => {
    event.preventDefault()
    userback.open('bug', 'screenshot')
})

After initialisation, you can use the named function getUserback to get a reference to the UserbackWidget.

import { getUserback } from '@userback/widget'

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

For more information about available configuration settings and and functions available, see our Javascript API

Keywords

userback

FAQs

Package last updated on 21 Jan 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