Installing the widget
To include the Freeday chat into your website, paste the code below before the
closing </body> tag and replace the channelId.
<script type="module" async>
// The channel id will be provided to you by Freeday
const channelId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
const response = await fetch(`https://api.freeday.ai/webchat/v1/widget/${channelId}`);
const freedayConfiguration = await response.json();
const freedayWidget = await import(freedayConfiguration.cdnUrl);
freedayWidget.bootstrap(freedayConfiguration);
</script>
Security and URLs
If your webpage is implementing a Content Security Policy or you need to whitelist urls, our widget accesses the following urls. Here is a full Content Security Policy that you need to adjust on your side.
connect-src https://api.freeday.ai https://eu.i.posthog.com wss://webchat.freeday.chat https://webchat.freeday.chat https://realtime.freeday.ai wss://realtime.freeday.ai;
img-src https://cdn.freeday.ai https://attachments.freeday.ai;
script-src https://cdn.jsdelivr.net/npm/@freeday-ai/ https://eu-assets.i.posthog.com;