Add cStar live chat to SvelteKit in two minutes using one script tag in src/app.html, or use @cstar.help/svelte for native Svelte 5 runes ($state and $derived) with zero stores.

Quick facts (Updated Nov 2026): Works with SvelteKit 2+ and Svelte 5+ (SSR-safe). 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 in src/app.html (Fastest)

Open src/app.html and add the cStar script right before the closing </body> tag:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    %sveltekit.head%
  </head>
  <body data-sveltekit-preload-data="hover">
    <div style="display: contents">%sveltekit.body%</div>
    <script 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 (Install Mode set to Script). Because SvelteKit keeps the document shell alive across client-side navigations, the widget stays mounted smoothly as visitors move between pages.

Only Want Chat on Specific Route Groups?

Instead of adding the script to app.html, load it inside a route group layout (like src/routes/(marketing)/+layout.svelte) inside <svelte:head> or an onMount helper so it stays off admin or internal routes.

Option 2: Native Svelte 5 SDK (@cstar.help/svelte)

For full control over your chat UI and embedded Help Center using Svelte 5 runes:

  1. Switch Settings -> Team -> Install to SDK Only.
  2. Install the package:
npm install @cstar.help/svelte
  1. Wrap your layout with CStarChatProvider:
<script>
  import { CStarChatProvider } from '@cstar.help/svelte';

  let { children } = $props();
</script>

<CStarChatProvider teamSlug="YOUR_TEAM_SLUG">
  {@render children()}
</CStarChatProvider>

@cstar.help/svelte is SSR-safe and ships with real-time messaging plus an automatic polling fallback.

See the full Svelte SDK documentation for hooks, library providers, and authenticated customer sessions.

Related guides: Chat Widget Setup · Svelte SDK