Custom implementation of PLuG widget

PLuG has a completely no-code way of changing the look and interaction of your widget. In case you wish to make your PLuG widget more interactive and customized to how your app is structured, you can use these customization properties to set up your widget.

If you have customized these properties of the widget through the PLuG settings page of DevRev, the values set in the initalization code take priority over those which you have updated in your PLuG settings.

All of these properties have to be passed as parameters while initializing the PLuG widget using plugSDK.init(). For details, refer to the PLuG SDK methods documentation.

CustomizationDescription
custom_launcher_selectorCustomize the widget launcher to best fit your website or app.
widget_alignmentAlign the widget to be placed either on the left or right side, relative to the launcher.
enable_default_launcherShow/hide the default PLuG Widget launcher.
themeSet the theme of the PLuG Widget.

Code sandbox

Properties

PLuG launcher

Customize the widget launcher to best fit your website or app; or show or hide the default PLuG widget launcher.

To customize your PLuG launcher styles, specify the CSS selector in the custom_launcher_selector property. This CSS selector is the reference based on which your PLuG widget opens. This property accepts a string value. The selector can also be configured through the plug settings on app.devrev.ai.

1custom_launcher_selector?: '#my-plug-widget'

Use the enable_default_launcher property only if you are not using the custom launcher selector.

1enable_default_launcher?: boolean;

The default value is true.

Widget alignment

Align the widget to be placed on the left or right of the launcher.

The widget can be set to open to the left or to the right of the custom launcher.

1widget_alignment?: 'left' | 'right';

The default value is right.

Spacing

Adjust spacing of the PLuG widget.

Two properties are available to apply spacing.

  • The bottom property determines the padding from the bottom of the launcher.

    The default value is 10px.

  • The side property determines the spacing of the widget from the launcher icon.

    The default value is 0px.

1spacing?:{
2 bottom?: '10px',
3 side?:'10px',
4}

Light/dark theme

Set the theme of the PLuG widget.

1theme?: 'dark' | 'light';

The default value is light.