Patris Chat Integration Guide
The Patris.ai chat provides an easy way to embed a dynamic chat interface to your website. This guide will show you how to integrate the Patris.ai chat into your website using the provided JavaScript script.
Requirements
– Access to your website’s source code or CMS (Content Management System).
– A valid Patris.ai module `id` which will be used to interact with the chat.
Integration Steps
1. Load the Script:
First, you need to load the Patris.ai script in your HTML. Place the following line of code before the closing `</body>` tag:
<script src="https://test.patris.ai/public/patris-chat.js"></script>
<script>
patrisAI({
id: 'b22b26ce74b91278dfgreec7fce2b790f81', // Insert your module ID here
text: 'Chat',
color: '#79baff',
uniqueId: 'patrisChat'
});
</script>
2. Initialize the Chat:
After loading the script, you can initialize the chat by calling the `patrisAI` function. The only mandatory parameter is `id`, which should be the `id` of the Patris.ai module you wish to interact with.
You can also provide optional parameters to adjust the chat bubble appearance and behavior:
– `text`: An optional label for the chat bubble.
– `color`: An optional color for the chat bubble.
– `uniqueId`: The element id prefix to add custom stylings through CSS
Here’s a sample initialization:
„`javascript
<script>
patrisAI({
id: ‚b22b26ce74b91278dfgreec7fce2b790f81‘, // Insert your module ID here
text: ‚Chat‘,
color: ‚#79baff‘,
uniqueId: ‚patrisChat‘
});
</script>
„`
## Optional Configuration Parameters:
– `id` (required): The Patris.ai module id you wish to interact with.
– `text` (optional): The text label for the chat bubble.
– `color` (optional): The color of the chat bubble. Default is blue.
– `uniqueId` (optional): The element id prefix to add custom stylings through CSS
## Notes:
– Ensure you replace `b22b26ce74b91278dfgreec7fce2b790f81` with your actual Patris.ai module id.
– If the chat bubble’s appearance does not fit your website’s design, you can adjust the `text` and `color` properties to suit your needs.
– The chat bubble will dynamically adapt its size and position based on the viewport’s width.
## Support
For any issues or further customization requirements, please reach out to Patris.ai support.
## Conclusion
By following this guide, you can seamlessly integrate the Patris.ai chat interface into your website, offering your visitors an interactive and dynamic chat experience.