expandChatOverlay()
This function does the opposite of collapseChatOverlay. You can supply some optional parameters to either have a prefilled message or automatically send a prefilled message. You can experiment with this by going to the dev sandbox and pressing the buttons 'Expand SDK', 'Prefilled message "I need help with my phone"', and 'delayed auto-sent message "Help me with my phone"' to trigger the different functionality. Here is the function API and some example usage:
export type ExpandPayload = {
message?: string;
autoSend?: boolean
};
/**
* Will open the chat bubble to display a ChatOverlay that allows the customer to send messages
* @param payload - includes an optional message that will prefill the input box
*/
export const expandChatOverlay = async (payload: ExpandPayload): Promise<void>;
// Example usage:
const someFunction = () => {
// Just open the chat bubble
expandChatOverlay();
// Open the chat bubble with a message prefilled
expandChatOverlay({ message: 'Hi I need help with my phone!' });
// Open the chat bubble with a message auto sending
expandChatOverlay({ message: 'Hi I need help with my phone!', autoSend: true });
}