Install PlotUI
One command. Works with Next.js, Vite, Remix, and CRA. No config files. No API keys in source code.
One command (recommended)
npx plotui-cli init
Paste into Lovable / Bolt / Cursor / Claude
Copy this prompt and paste it into your AI coding tool. It will handle the injection automatically. Replace YOUR_ORG_ID with the value from your dashboard → Settings.
You are installing PlotUI — an AI support-chat widget — into this codebase. Do all four steps below in order. Do NOT ask me for confirmation between steps. ═══ PREREQUISITES ═══ The user must give you these two values (ask once at the start if missing): • PLOTUI_ORG_ID — looks like a UUID, e.g. 7c2a1e4f-... • PLOTUI_API_KEY — starts with "plotui_" Both come from https://www.plotui.com/dashboard/settings ═══ STEP 1 — Embed the widget script ═══ Find the root layout file. Search this order, use the first that exists: 1. app/layout.tsx (Next.js App Router) 2. src/app/layout.tsx (Next.js App Router in src/) 3. pages/_document.tsx (Next.js Pages Router) 4. index.html (Vite / CRA / static) Add this script tag as the LAST child of <body>: <script src="https://www.plotui.com/widget.js" data-org="PASTE_ORG_ID_HERE" async></script> In Next.js layout.tsx, use the <Script> component from next/script with strategy="lazyOnload" if you prefer, but a plain <script> in <body> works too. ═══ STEP 2 — Save the API key ═══ Add this line to .env.local (create the file if it doesn't exist): PLOTUI_API_KEY=plotui_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx If .env.local is gitignored already, good. If not, add it to .gitignore. ═══ STEP 3 — Run the scanner ═══ Run this command from the project root (PlotUI auto-detects subdirectory apps in monorepos and auto-loads .env.local): npx plotui-cli@latest scan --yes Expected output: ✓ Knowledge graph generated and saved! Pages: N nodes mapped If it errors with "Framework not detected", the suggestion line tells you which subdirectory to point at — re-run with --dir. ═══ STEP 4 — Tell the user the final manual step ═══ Print this message to the user (DO NOT do it for them — they must approve in the dashboard): PlotUI is installed. One last step: → Open https://www.plotui.com/dashboard/review → Click "Publish All" to make the widget live for your users After that, the widget bubble appears in the bottom-right of every page. Test it by asking "How do I sign up?" or any feature question. ═══ NOTES ═══ • Source code is never stored by PlotUI — only page structure (route names, button labels, headings) is sent to Gemini for description generation. • Re-run "npx plotui-cli@latest scan" any time you ship new pages — only changed files trigger updates (hash-based incremental scan). • Free tier: 100 queries/month, "Powered by PlotUI" badge. Paid tiers remove the badge.
Manual (3 steps)
Step 1 — Add the widget to your layout (before </body>)
<script src="https://www.plotui.com/widget.js" data-org="YOUR_ORG_ID" async ></script>
Step 2 — Scan your codebase
npx plotui-cli@latest scan --api-key YOUR_API_KEY
Monorepo? If your Next.js app lives in a subdirectory, run from that folder or pass --dir ./apps/web.
Step 3 — Approve nodes in the Review queue
New nodes start as draft for safety. Open Dashboard → Review, check the AI descriptions, and click Publish All (or per-node). Re-scans of unchanged pages skip the queue automatically.
Where to find your keys
data-org="..."Re-scan on every deploy (optional)
Add this to your GitHub Actions workflow so the knowledge graph stays in sync with your codebase automatically.
- name: Sync PlotUI knowledge graph
run: npx plotui-cli@latest scan --api-key ${{ secrets.PLOTUI_API_KEY }} --yes