Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

derbysoft-all-in-one-help-widget

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derbysoft-all-in-one-help-widget

Derbysoft All In One Help Widget

  • 1.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
3
Weekly downloads
 
Created
Source

All In One Help Widget

NPM Version

中文文档

Installation

Using NPM:

$ npm install derbysoft-all-in-one-help-widget

Documentation

Basic usage

You can use AllInOneHelpWidget constructor to initial all the widgets and render the action button.

import AllInOneHelpWidget from 'derbysoft-all-in-one-help-widget';

new AllInOneHelpWidget({
    [AllInOneHelpWidget.GoogleAnalytics]: {
        id: 'GOOGLE_ANALYTICS_ID',
        enabled: true
    },
    [AllInOneHelpWidget.Smartlook]: {
        id: 'SMART_LOOK_ID',
        enabled: true
    },
    [AllInOneHelpWidget.ProductTours]: {
        id: 'PRODUCT_TOURS_ID',
        enabled: true
    },
    [AllInOneHelpWidget.KnowledgeBase]: {
        id: 'KNOWLEDGE_BASE_ID',
        enabled: true
    },
    [AllInOneHelpWidget.Feedback]: {
        id: 'FEED_BACK_ID',
        enabled: true
    }
}).render();

Or you can create an instance and call methods to initial widgets.

// Import AllInOneHelpWidget
import AllInOneHelpWidget from 'derbysoft-all-in-one-help-widget';

// Create an instance
const allInOneHelpWidget = new AllInOneHelpWidget();

// Initial GoogleAnalytics
allInOneHelpWidget.initGoogleAnalytics({
    id: 'GOOGLE_ANALYTICS_ID',
    enabled: true
});

// Initial Smartlook
allInOneHelpWidget.initSmartlook({
    id: 'SMART_LOOK_ID',
    enabled: true
});

// Initial Feedback
allInOneHelpWidget.initFeedback({
    id: 'FEED_BACK_ID',
    enabled: true
});

// Initial KnowledgeBase
allInOneHelpWidget.initKnowledgeBase({
    id: 'KNOWLEDGE_BASE_ID',
    enabled: true
});

// Initial ProductTours
allInOneHelpWidget.initProductTours({
    id: 'PRODUCT_TOURS_ID',
    enabled: true
});

// Render action button
allInOneHelpWidget.render();

Options

You can pass an object type options to config AllInOneHelpWidget.

const allInOneHelpWidget = new AllInOneHelpWidget({
    parentEl: document.body,
    position: AllInOneHelpWidget.Position.BOTTOM_RIGHT,
    locale: "en-US"
});
OptionDescriptionDefault value
parentElParent container of the component buttondocument.body
positionLocation of component buttonsAllInOneHelpWidget.Position.BOTTOM_RIGHT
localeLanguages applied within components"en-US"

Widget options

You can config the widget when initialing.

OptionDescriptionDefault value
idInjected into the id of the pluginundefined
enabledIf true, the plugin will be injected into the pagefalse
activatedOnly KnowledgeBase has this option, if it is false, the KnowledgeBase option button will be disabled.false

Other instance methods

activateKnowledgeBase

Activate the KnowledgeBase option button.

const allInOneHelpWidget = new AllInOneHelpWidget();
allInOneHelpWidget.activateKnowledgeBase();
deactivateKnowledgeBase

Disable the KnowledgeBase option button.

const allInOneHelpWidget = new AllInOneHelpWidget();
allInOneHelpWidget.deactivateKnowledgeBase();
replaceParentEl

Replace the parent container of a component button.

const allInOneHelpWidget = new AllInOneHelpWidget();
allInOneHelpWidget.replaceParentEl(ducument.body);
updatePosition

Replace the position of the component button.

const allInOneHelpWidget = new AllInOneHelpWidget();
allInOneHelpWidget.updatePosition(AllInOneHelpWidget.Position.BOTTOM_RIGHT);
updateLocale

Replace the language applied within the component.

const allInOneHelpWidget = new AllInOneHelpWidget();
allInOneHelpWidget.updateLocale('en-US');

FAQs

Package last updated on 18 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc