Widget
Increase the amount of feedback you get and process it faster.
By going to Settings > Widget
, you can easily add a feedback and changelog widget to your site. It only takes a few lines of JavaScript to set up, providing you with a simple way to send feedback, indicate its priority, provide custom links and display your changelog.
This widget allows users to directly connect with the engineering team, in addition to the usual support channels.
You can customize the widget’s appearance to fit your site’s design, listen to events & more.
Setting up the widget
Embed & initialize the widget
Head to the widget settings page, there you’ll find a copy/pastable snippet that looks like the snippet below. Or simply copy the code below and replace <your-widget-key />
with your workspaces’ widget key.
That’s it!
While this is all you have to do, let’s briefly unwrap what happens in the snippet.
The first script
sets up the global Productlane
object used to communicate with the widget. It also initializes the widget via Productlane.init()
with your corresponding widget key.
The second script
tag loads the widget from Productlane’s CDN.
API
Settings
widgetKey
(required)
Your workspace’s widget key. Can be found on your widget settings page.
user
(optional)
An object containing information about the current user for simple authentication. Will hide the email
field in the feedback form if provided.
theme
(optional)
To make the widget properly align with your brand guidelines, you can heavily customize each aspect of it. We support the following theme options:
The widget will automatically apply either the regular or -dark
variants, based on the user’s current system preference.
Note: Make sure Custom CSS is enabled
in the widget
settings to apply custom themes.
Methods
Once the widget is initialized, you can use some of the following methods to interact with it.
-
Productlane.open()
Opens the widget. -
Productlane.close()
Closes the widget. -
Productlane.toggle()
Toggles the widget. -
Productlane.set()
For setting certain widget properties. Equal to the settings object inProductlane.init()
.
Note: Make sure to call any methods after the widget is initialized, e.g. like
so: Productlane.on('loaded', () => {/* Your code here */})
.
Events
You can listen to the following events:
-
Productlane.on("loaded", () => {})
Fires when the widget is fully loaded. Make sure to call any methods in the callback of this event. -
Productlane.on("opened", () => {})
Fires after the widget is opened. -
Productlane.off("opened", () => {})
Removes the event listener for theopened
event. -
Productlane.on("closed", () => {})
Fires after the widget is closed. -
Productlane.off("closed", () => {})
Removes the event listener for theclosed
event. -
Productlane.on("toggled", () => {})
Fires after the widget is toggled. -
Productlane.off("toggled", () => {})
Removes the event listener for thetoggled
event. -
Productlane.on("customLinkClicked", (link) => {})
Productlane.off("customLinkClicked", () => {})
Removes the event listener for the customLinkClicked
event.