You can add cStar to a Next.js app in two ways: drop in next/script for the prebuilt floating widget in two minutes, or install @cstar.help/react for full headless control with React hooks.

Quick facts (Updated Nov 2026): Supports Next.js App Router (RSC) and Pages Router with React 18+. 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: Prebuilt Widget via next/script (Fastest)

In your root layout (app/layout.tsx for App Router, or pages/_app.tsx for Pages Router), load cStar with strategy="afterInteractive" so it never blocks page hydration:

// app/layout.tsx
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://www.cstar.help/cstar.js?team=YOUR_TEAM_SLUG"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}

Replace YOUR_TEAM_SLUG with your slug from Settings -> Team -> Install (make sure Install Mode is set to Script).

Content Security Policy (CSP) Note

If your Next.js app sets a strict Content-Security-Policy header in next.config.js or middleware.ts, allow https://www.cstar.help in script-src and connect-src.

Option 2: Headless React SDK (@cstar.help/react)

Want your chat widget or Help Center rendered natively with your own Tailwind or design system components?

  1. Set Settings -> Team -> Install to SDK Only.
  2. Install the package:
npm install @cstar.help/react
  1. Create a Client Component wrapper ('use client') for CStarChatProvider:
'use client';

import { CStarChatProvider } from '@cstar.help/react';

export function SupportProvider({ children }: { children: React.ReactNode }) {
  return (
    <CStarChatProvider teamSlug="YOUR_TEAM_SLUG">
      {children}
    </CStarChatProvider>
  );
}

Wrap your app layout with <SupportProvider>, and use the hooks from @cstar.help/react for real-time conversations, messages, and your public knowledge base.

Next.js 16 + Turbopack note: In local dev you may see a Turbopack HMR console warning (ws://127.0.0.1:3000/_next/webpack-hmr). That comes from Next's dev HMR client and does not affect cStar or production builds.

See the full React SDK documentation and Customer Identity Verification for signed-in user auth.

Related guides: Chat Widget Setup · React SDK