Custom Domain
Serve the Chat Widget from your own domain
Serve the Chat Widget from a domain you own, such as chat.example.com, instead of a Pylon domain. With a custom domain, the widget script, its requests to Pylon, its real-time connection, and Pylon-hosted images, fonts, and attachments all load through your domain.
One custom domain covers every chat widget in your organization. Existing embed snippets that don't use the custom domain keep working.
Set up a custom domain
Add the DNS records
Under DNS records, Pylon lists two records. Add both with your DNS provider.
The status shows Pending verification until the records are found. Verification can take up to 30 minutes after the records are in place, and the page updates on its own.
If the status changes to Verification failed, check the records, including any CAA policy on your domain, then click Retry.
Update your embed snippet
Once the domain shows Verified, an Embed snippet section appears. Pick the chat widget you're installing and copy its snippet. It loads the widget from https://<your-domain>/widget/embed/<APP_ID>.
Use this snippet in place of the one in Chat Setup step 2. The rest of the setup, including window.pylon.chat_settings, stays the same.
Content Security Policy
If your site has a CSP, start from the policy in Chat Setup and add your custom domain. For chat.example.com:
Content-Security-Policy:
connect-src 'self' https://*.usepylon.com wss://*.pusher.com https://*.pusher.com https://chat.example.com wss://chat.example.com;
script-src 'self' https://widget.usepylon.com https://chat.example.com;
font-src 'self' https://*.usepylon.com https://chat.example.com;
style-src 'self' 'unsafe-inline' https://*.usepylon.com;
img-src 'self' https://*.usepylon.com https://pylon-avatars.s3.us-west-1.amazonaws.com https://chat.example.com;Keep the Pylon entries: some widget requests still go directly to Pylon. If you use EU data hosting, start from the EU policy instead.
Change or remove the domain
To use a different domain, enter it and click Update, then add the new DNS records.
To stop using a custom domain, click Remove. Embeds that use the custom-domain snippet stop working, so switch them back to the standard snippet first. Embeds that use the standard snippet aren't affected.
Last updated
Was this helpful?

