Automatic Installation
The easiest way to install React Grab in your Next.js project:Run the CLI
Navigate to your project root (where The CLI will automatically detect your Next.js setup and router type.
next.config.ts is located) and run:Manual Installation
If you prefer to set up React Grab manually or the automatic installation doesn’t work for your setup:Router Detection
The CLI automatically detects your Next.js router type:- App Router: Looks for
app/layout.tsxorapp/layout.js - Pages Router: Looks for
pages/_document.tsxorpages/_document.js
Verification
After installation, verify React Grab is working:Common Issues
Script not loading in App Router
Script not loading in App Router
Ensure you’re adding the Script component inside the
<head> tag, not in the <body>. The strategy="beforeInteractive" ensures it loads before your app hydrates.TypeScript errors with _document.tsx
TypeScript errors with _document.tsx
Make sure you’re importing Script from
next/script, not next/document. The Script component in Pages Router should still be imported from next/script.Not working in production
Not working in production
React Grab is designed for development only. The
process.env.NODE_ENV === "development" check prevents it from loading in production builds.Next Steps
Connect to Your Agent
Set up React Grab with Cursor, Claude, or other AI coding agents
Configure Options
Customize activation keys, context limits, and more
