Share feedback, ideas and get community help

Home
Members
Melissa
M
Melissa
Offline, last seen 2 months ago
Joined November 15, 2024
How do I keep the preview message from popping up on other pages after someone has closed out the chatbot on one page? Something similar to this:
<div>
<script type="module">
import Typebot from '...';

// Check if the user has closed the bubble before
const hasDismissedBubble = localStorage.getItem('typebotDismissed') === 'true';

Typebot.initBubble({
typebot: "...",
apiHost: "...",
preview message: hasDismissedBubble? null: {
message: "Hello! ",
autoShowDelay: 5000,
avatarUrl: "...",
},
theme: {
button: {
backgroundColor: "#058fa9",
customIconSrc: "...,
size: "75px",
},
chatWindow: { backgroundColor: "#fff" },
},
});

// Listen for the bubble close event and save the dismissal
Typebot.on("bubbleClosed", () => {
localStorage.setItem('typebotDismissed', 'true');
});
</script>
</div>
17 comments
B
M