-
Notifications
You must be signed in to change notification settings - Fork 0
Visual DevTools
When developing locally or auditing monetization setups, configuring ad coordinates and slot IDs by hand can be tedious.
The companion package adinject-devtools provides an interactive floating overlay directly on your running Next.js application.
Install adinject-devtools as a dev dependency:
# npm
npm install --save-dev adinject-devtools
# bun
bun add -d adinject-devtools
# pnpm
pnpm add -D adinject-devtoolsMount <AdInjectDevTools /> inside <AdInjectProvider />. The component is completely inert and automatically tree-shaken from production builds:
import { AdInjectProvider } from "adinject-react";
import { AdInjectDevTools } from "adinject-devtools";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<AdInjectProvider client="ca-pub-1234567890123456">
{children}
{/* Rendered only in local development */}
{process.env.NODE_ENV !== "production" && <AdInjectDevTools />}
</AdInjectProvider>
</body>
</html>
);
}Hover over any element on your live web page (card grid, article paragraph, sidebar, header). Click to place a mock ad unit and immediately inspect:
- Calculated aspect ratio and min-height bounding box.
- Generated copy-paste ready JSX snippet.
Runs a layout analysis across the current page DOM to identify optimal, high-CTR, zero-CLS insertion points that comply with Google Publisher & Better Ads Standards.
Generates structured Markdown instructions formatted specifically for:
- Antigravity
- Cursor
- Claude Code
- GitHub Copilot
You can copy the generated prompt and paste it into your AI assistant to implement the exact code changes needed.
Audits your live ad slots in real time to catch:
- Unconstrained ad container
<div>tags that cause layout shifts. - Density violations (e.g. ad-to-content ratio
$> 30%$ ). - Proximity violations (ads placed too close to clickable buttons).
Simulate realistic high-resolution ad creatives across 6 industry verticals:
- π³ Food & Cooking
- π» Tech & Hardware
- βοΈ SaaS & Developer Tools
- ποΈ E-Commerce & Fashion
βοΈ Travel & Hospitality- π Finance & Investing
adinject-react is maintained by LinuxCTRL. Distributed under the MIT License.
GitHub β’ npm β’ Live Showcase β’ Report Issue