Skip to main content

Widget

Glime has a widget that can be added to your website to allow users to ask questions and get answers directly from Glime, without leaving your website.

To add the widget to your website, you need to click in "Widget" on the left menu and then follow the installation instructions.

How to install the widget

Add the following code somewhere in your website body tag:

<script
defer
onload="window.glime.init(`YOUR_PROJECT_ID`)"
src="https://cdn.glimelab.ai/widget/1.0.0/widget.js"
></script>

Replace YOUR_PROJECT_ID with your project id.

You can provide an extra configuration object as the second parameter when initializing.

window.glime.init(`YOUR_PROJECT_ID`, glimeOptions})

The glimeOptions object can have the following properties:

glimeOptions = {
styles: {
// Modifies the widget's fonts and images to scale proportionately.
baseFontSize: number,
// Toggle between dark and light themes. In "auto" mode, the widget adapts to the page's current theme.
theme: "light" | "dark" | "auto",
},
// Hides the widget in its collapsed form, allowing it to be opened with a custom button.
hideCollapsedButton: boolean,
};

Expanding the widget programmatically

You can expand the widget programmatically by calling the expand method on the glime object.

window.glime.expand();

Once installed, the widget will appear on your website and users will be able to ask questions and get answers directly from Glime.

Widget Settings

You can configure Glime's widget behavior directly from our dashboard.

  • Widget Image: Change the image that Glime widget will use.
  • Metaprompt: When added these instructions will be use be Glime to answer questions on the widget.

Glime's widget also supports multi-language translations. You can configure the widget to use a different language by clicking the '+' button next to the languages tab and adding the desired language.

For each language you can configure the following settings:

  • Gretting Message: Change the greeting message that Glime will display when users open the widget.
  • Suggested messages: Add suggested questions that Glime will display when users open the widget.

If desired, you can also configure the widget to aumatically siwtch the UI to match user's browser language settings.