Install the widget
The widget is a small launcher that opens the messenger. Once it loads, customers can write to you, search your help articles and vote on ideas, depending on which modules are on.
Add the script
- In Tirver open Settings, Messenger, Install.
- Choose your language: HTML, React, Vue or Next.js.
- Select Copy snippet.
- Paste it before the closing
bodytag on every page where the widget should appear.
The HTML version is a single tag. It carries your public widget id, which is safe to show in page source.
<script async src="https://app.tirver.com/tirver.js" data-widget-id="YOUR_WIDGET_ID"></script>
The React, Vue and Next.js snippets do the same thing from a component, so the script loads once and is removed when the component goes away.
Check that it works
- Open your product in a new tab.
- Look for the launcher in the bottom corner. Its colour and side come from your widget settings.
- Open it and send a test message.
- In Tirver, open the inbox. The message appears under Unassigned, and the install page shows Receiving data.
Until the first visitor arrives, the install page says Waiting for the first visitor.
Control the widget from code
The script adds a Tirver object to the page.
Tirver.open(); // open the messenger
Tirver.close(); // close it
Tirver.toggle(); // open or close
Tirver.shutdown(); // remove the widget, for example on sign out
If the launcher does not appear
- Check that the script is on the page and the widget id is yours.
- If you set allowed domains, the page’s domain must be on the list.
- Make sure a content security policy on your site allows scripts and frames from app.tirver.com.
Next: identify signed-in customers so conversations follow them across devices.
Did this answer your question?