Add GetFoxChat to your Astro site
In the shared layout component that holds the page shell (for example src/layouts/BaseLayout.astro), as an is:inline script just before </body>. The line loads the GetFoxChat chat bubble on every page, and the operator behind it answers your visitors from your own public pages.
The line to add
Yours has your own site ID in place of YOUR_SITE_ID.
<script src="https://getfoxchat.com/widget.js" data-site-id="YOUR_SITE_ID" defer></script>
On Astro, this is what goes in src/layouts/BaseLayout.astro:
<script is:inline src="https://getfoxchat.com/widget.js" data-site-id="YOUR_SITE_ID" defer></script>
Add GetFoxChat to Astro, step by step
- In GetFoxChat, open the install step for your site and copy your snippet. It already has your site ID in it. No account yet? Create one free.
- Open the layout component your pages share, usually in src/layouts. source
- Just before </body>, add <script is:inline src="https://getfoxchat.com/widget.js" data-site-id="YOUR_SITE_ID" defer></script>. source
- Replace YOUR_SITE_ID with your site ID.
- If some pages use a different layout, add the same line to that layout too, then rebuild and redeploy. source
- Back in GetFoxChat, press Check my site. The chat switches on once GetFoxChat finds the snippet on your live pages.
Astro's own guide: Astro docs: Scripts and event handling. Checked 2026-09-30; if Astro renames a menu, its guide has the current wording.
Astro gotchas
- Astro does not process a script tag that has attributes other than src, so the tag is output as written; is:inline makes that explicit for a script hosted on another server. source
- If the site uses Astro view transitions, Astro documents that inline scripts can re-execute when a visitor returns to a page; test the chat after moving between pages. source
- Layouts can live anywhere, so check which layout each page imports before assuming one file covers the whole site. source
Removing it later
Delete the GetFoxChat script line from your layout component(s), then rebuild and redeploy.
Checked against the current Astro docs (Astro 5).
Find out what your visitors can't find
See the 5 questions your visitors are likely to ask that your pages don't clearly answer. Free, no account needed.
The chat starts as Foxy. Rename it and change the avatar anytime. Plans and what each includes: pricing.