Modes

Lay has two modes, each designed for a different job. The mode changes how comments are treated, who can leave them, and what AI enrichment produces.

Review mode

Job: Your team reviews prototypes and staging builds. Designers, PMs, and engineers point at what needs changing and say why.

  • Comments are threaded — reply, discuss, resolve
  • AI context cards describe the element and suggest fixes
  • All commenters are identified team members
  • Best for: staging URLs, design reviews, QA passes
tsx
<LayProvider projectId="..." mode="review">
  <StagingApp />
</LayProvider>

Support mode

Job: Your users tell you what's confusing or broken on your live site. They point at the element and describe the problem in their own words.

  • Comments are standalone — no threading or resolution UI for end users
  • AI detects intent (bug report, confusion, feature request, praise)
  • Commenters can be anonymous or identified via identifyUser()
  • Best for: production apps, beta programs, user research

Support mode works without identity — comments are anonymous by default. Add identifyUser to attach user info to each comment. This requires a server-side LAY_SECRET_KEY.

tsx
import { identifyUser } from '@uselay/sdk/server';
import { LayProvider } from '@uselay/sdk';

export default async function Layout({ children }: { children: React.ReactNode }) {
  const user = await getUser();
  return (
    <LayProvider
      projectId="your-project-id"
      mode="support"
      {...identifyUser(
        user ? { id: user.id, name: user.email ?? user.name } : null
      )}
    >
      {children}
    </LayProvider>
  );
}

See Quick Start for full setup.

Choosing a mode

i
You can set the mode from the dashboard without deploying code changes. The mode prop is an override for when you need programmatic control (e.g., review on staging, support on production).
ReviewSupport
AudienceYour teamYour users
ThreadingYes — reply, resolve, archiveNo — standalone comments
AI contextElement description + fix suggestionsIntent detection + pattern signals
IdentityTeam members (always identified)Anonymous or verified via identifyUser()
Typical useStaging, design review, QAProduction, beta, user research