Full configuration
A complete example of all configuration options is provided below with comments.
Happi.init({
// Required config:
// Your publishable key as found on happi.team/settings/widget
publishableKey: "my-publishable-key",
// Optional config:
// Signed JWT identifier your customer to prefill their details
customerData: "eyJbGci...",
// Background colour for the support icon
iconBg: "hotpink",
// Text colour for the support icon
iconTextColor: "white",
// Text displayed beside the support icon
iconText: "Support",
// Main title displayed when widget is open
headline: "Ask for help...",
// Subheading displayed when widget is open
subheading: "Our team usually reponds within 1-2 working days.",
// Placeholder text in the main message input field
messagePlaceholder: "Please help me with...",
// Submit button text
submitText: "Get in touch",
// Displayed when message has sent successfully
successText: "Your message has been sent, we’ll get back to you soon!",
// Displayed when message fails to send
errorText: "Failed to send your message, please try again",
// Listens for clicks on the provided selector and opens the widget when clicked
launchSelector: ".launch-messenger",
// Print additional debug logs to console
debug: true,
// Form label for category dropdown
categoryHeader: "Category",
// List of categories for a dropdown above the message box
categories: [
"Technical support",
"Pricing enquiry",
"Other"
],
// Various colour customisations, accepts browser colour names or hex colour codes
styles: {
headerBgColor: "hotpink",
headerTextColor: "white",
buttonBgColor: "purple",
buttonTextColor: "#fff"
},
})