Add the script to Starlight's head, then put the box on any page.
astro.config.mjs
starlight({
head: [{ tag: "script", attrs: { src: "https://askthissite.com/embed.js", async: true } }],
}),
Any .md or .mdx page
<div data-everypage-site="YOUR-SITE-ID"></div>
Your site id is on your site's page after you sign up.