1. Go to Messaging Settings in Salesforce Setup.
2. Enable Messaging.
3. Click New Channel.
4. Click Start.
5. Select “Messaging for In-App and Web”.
6. Enter the Channel Name and click Save.
Note: For Routing Type, I have used Omni-Queue and selected a Queue with Routing Configuration and Messaging Session as the supported Object.
7. Go to Embedded Service Deployments in Salesforce Setup.
8. Click New Deployment.
9. Select Messaging for In-App and Web and click Next.
10. Select Web and click Next.
11. Enter Name, use your domain URL in the Domain as we are going to use Visualforce Page to test the Chat and select the Messaging channel.
12. Click Publish to publish the Embedded Service Deployment. Click “Install code Snippet”. Copy the Code Snippet.
13. Create a Visualforce page with the Code Snippet.
14. Add your domain URL to CORS.
15. Add SCRT URL in CSP.
16. Also, add https://*.visualforce.com to the CORS.
17. Preview the VF Page to test.