JavaScript Embed Features

Custom Initial Messages

Default welcome comes from your dashboard config. Override it from JavaScript when the page or user warrants a different opener — ‘Need help with checkout?’ on the cart page, ‘Welcome back, Alex!’ for returning customers.

Today: dashboard config

Set the welcome message under Settings → Chat Interface → Welcome message. Every visitor sees the same opener; updates propagate to live widgets immediately.

Coming: runtime override

The intended API mirrors the common chat-widget pattern — call setInitialMessages() before the embed renders the first turn:

js
const user = getCurrentUser();
window.chatmount.setInitialMessages([
  `Hi ${user.name}!`,
  "I remember our last conversation about your project.",
  "How can I help you today?",
]);

// Context-aware variant
const path = window.location.pathname;
const messages = path.includes("/pricing")
  ? ["Looking at our pricing?", "I can help you choose the right plan."]
  : ["Hello! I'm here to help."];

window.chatmount.setInitialMessages(messages);

Custom initial messages will only display once per session. Total message length will be capped (around 1,000 characters).

Related