Add cStar live chat to any Astro site in under five minutes using one script tag in your base layout, or mount the headless React or Svelte SDK inside an Astro island.

Quick facts (Updated Nov 2026): Works on static and SSR Astro sites. cStar is $15/seat/month flat with every feature included, a 14-day free trial (no credit card required), and your first 3 Spectators free.

Option 1: Single Script Tag (Fastest)

Open your shared layout file (usually src/layouts/Layout.astro or src/layouts/BaseLayout.astro) and add this right before the closing </body> tag:

---
// src/layouts/Layout.astro
const { title } = Astro.props;
---
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>{title}</title>
  </head>
  <body>
    <slot />
    <script is:inline src="https://www.cstar.help/cstar.js?team=YOUR_TEAM_SLUG"></script>
  </body>
</html>

Replace YOUR_TEAM_SLUG with your team slug from Settings -> Team -> Install.

Why is:inline matters in Astro

Astro bundles and optimizes regular <script> tags at build time. Adding is:inline tells Astro to leave the external cStar script tag untouched so it loads cleanly from www.cstar.help on every page without blocking static HTML rendering.

Using Astro View Transitions (<ClientRouter />)

If your site uses Astro's <ClientRouter /> (View Transitions), place the script in your persistent layout once so visitors keep their open chat conversation while navigating between pages. If you only want the widget on certain pages (like /pricing or /docs), render the script conditionally in that layout based on Astro.url.pathname.

Option 2: Headless SDK Inside an Astro Island

If you want custom chat UI or an embedded Help Center rendered inside your own Astro components, use cStar's React or Svelte SDK in an island:

  1. Switch Settings -> Team -> Install to SDK Only.
  2. Install either @cstar.help/react or @cstar.help/svelte:
npm install @cstar.help/react
# or
npm install @cstar.help/svelte
  1. Mount your chat component in Astro with client:idle so your page stays fast and interactive first:
---
import SupportWidget from '../components/SupportWidget.tsx';
---
<SupportWidget client:idle teamSlug="YOUR_TEAM_SLUG" />

See the React SDK docs or Svelte SDK docs for full provider and hook examples.

Optional: Open Chat From Any Astro Button

Want a "Chat with us" link in your navbar or pricing section to open the widget? See Trigger the Chat Widget from Custom Buttons.

Verify Your Install

Run npm run dev (or deploy your Astro build), open your site in the browser, and check the bottom corner for the cStar launcher. Send a test message and confirm it appears in your cStar inbox.

Related guides: Chat Widget Setup · All data-cstar-* Attributes