Skip to content

Add Next.js framework adapter to install CLI #3

Open

Description

@rossres

Goal

Teach scripts/jetti-install.mjs to detect Next.js projects and patch the right entry file, so install jetti from https://jetti.co/install.md Just Works on Next.js apps.

Today the install CLI auto-detects plain HTML and Vite/React only. Next.js is the highest-traffic framework in agent-driven workflows, so this is the most-requested adapter.

Scope

  • App router — patch app/layout.tsx (or app/layout.jsx) by injecting the <Script src='…/snippet.js' data-jetti-session='…' /> tag inside the <head>. Use next/script with strategy='beforeInteractive' so the snippet runs before hydration.
  • Pages router — patch pages/_document.tsx (or pages/_document.jsx) by injecting the same <Script> inside <Head>.
  • Detect which router is in use by the presence of app/ vs pages/ (and don't get tripped up by App Router projects that still have a legacy pages/api/ directory).
  • Update the framework matrix in README.md — flip Next.js rows from 🔜 to ✅.

Out of scope

  • Server-side reviewer-link rendering. The snippet is client-side only.
  • Edge runtime detection. The snippet runs in the browser regardless.
  • Turbopack-specific tweaks. Standard Next.js handles this.

Acceptance

  • Running install jetti in a fresh npx create-next-app@latest project (both --app and --no-app) patches the correct entry file and the reviewer flow works end-to-end.
  • A short test fixture lives in scripts/__tests__/ covering both router shapes.

Useful pointers

Activity

  1. pinned this issue on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions