Install guide: Gatsby

Add GetFoxChat to your Gatsby site

As of November 3, 2026, to add GetFoxChat to Gatsby, in gatsby-ssr.js at the root of the site, using onRenderBody and setPostBodyComponents so the tag is added after the body content of every page (Gatsby's own guide, September 30, 2026). The video on this page shows GetFoxChat installed, tested and running in 4 minutes (watch it).

Before you start: Access to the project's code and a rebuild and redeploy.

Watch it first

GetFoxChat being installed, tested and run on a real site▶ Watch how
Install, test and run GetFoxChat in 4 minutes

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 Gatsby, this is what goes in gatsby-ssr.js:

const React = require("react")

exports.onRenderBody = ({ setPostBodyComponents }) => {
  setPostBodyComponents([
    <script
      key="getfoxchat"
      src="https://getfoxchat.com/widget.js"
      data-site-id="YOUR_SITE_ID"
      defer
    />,
  ])
}

How do you add GetFoxChat to Gatsby, step by step?

  1. 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.
  2. Create gatsby-ssr.js in the root of your site if it does not exist yet (gatsby-ssr.jsx or .tsx also work). source
  3. Export an onRenderBody function; Gatsby calls it for every page it renders while building HTML. source
  4. Inside it, call setPostBodyComponents with an array holding the GetFoxChat script element, giving it a key. source
  5. Replace YOUR_SITE_ID with your site ID, then run a new build and redeploy. source
  6. Back in GetFoxChat, press Check my site. The chat switches on once GetFoxChat finds the snippet on your live pages.

Gatsby's own guide: Gatsby docs: Gatsby Server Rendering APIs. Checked 2026-09-30; if Gatsby renames a menu, its guide has the current wording.

Gatsby gotchas

How do you remove it later?

Remove the script element from setPostBodyComponents in gatsby-ssr.js, then rebuild and redeploy.

Checked against the current Gatsby reference docs (Gatsby 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.

Your AI Operator starts as Foxy. Rename it and give it your own avatar in Settings. Plans and what each includes: pricing.