Newer Version Available
Customize the Pre-Chat Page UI with Lightning Components
Before you start, make sure that you have a Snap-ins deployment with pre-chat already set up. Next, go to the Developer Console and click . Enter a name and description for your component and click Submit.
-
Implement the pre-chat interface.
Change the opening aura component tag to:
This code implements the lightningsnapin:prechatUI interface, which makes the component available to select as your pre-chat page from Snap-ins Setup.
-
Create the pre-chat API component.
This code provides an API that you can use to customize the user interface for the pre-chat page.
-
Add an initialize aura handler.
This action gets called when the component is initialized.
-
Add your markup.
Create your buttons, images, validation, or whatever else you want to create. You have full control over the layout using the fields you specified in Snap-ins Setup.
-
Add an initialize action in your component controller.
-
Add a handler for starting a chat.
Add a click handler to a button element. The customer uses this button to request a chat.
-
Save your component and select it from Snap-ins Setup.
After you save your component, go to Snap-ins Setup and navigate to your chat settings. Your component should be available to select as a custom component for your pre-chat page.