npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-devtools-blocker

v2.0.2

Published

[![npm version](https://img.shields.io/npm/v/react-devtools-blocker.svg?style=flat-square)](https://www.npmjs.com/package/react-devtools-blocker) [![license](https://img.shields.io/npm/l/react-devtools-blocker.svg?style=flat-square)](https://github.com/y

Downloads

37

Readme

🛡️ DevTools Guard

npm version license

A React/Next.js component to detect and block browser DevTools access, with instant redirection to a safe page.

Developed with ❤️ by Pressbuddy Software Solutions


🚀 Grow Your Business with Us

We offer end-to-end digital services to grow your business:

  • 💻 Website & Web App Development
  • 📱 Mobile App Development (React Native / Flutter)
  • 🛒 E-commerce Solutions
  • 🧠 Custom Software & Automation Tools
  • 🎨 UI/UX Design
  • ☁️ Cloud Hosting & DevOps
  • 🧾 Billing & Inventory Software

📞 Contact us for your next project: pressbuddy.in/contact | +91 9922852793


📑 Table of Contents


🚀 Features

  • Detects browser DevTools using multiple methods (window dimensions, debugger traps)
  • Instant redirect to custom URL when DevTools is detected
  • Lightweight and framework compatible (React, Next.js, etc.)
  • Simple plug-and-play implementation
  • TypeScript support included

📦 Installation

Using npm

npm install react-devtools-blocker

Using yarn

yarn add react-devtools-blocker

🧠 Usage

Note for Next.js 13+
This package must be used inside a Client Component.
Add "use client" at the top of your component file.

Basic Implementation

import DevToolsGuard from 'react-devtools-blocker';

function App() {
  return (
    <>
      <DevToolsGuard redirectUrl="/blocked-page" />
      {/* Your app content */}
    </>
  );
}

Next.js App Router (Client Component)

"use client";

import DevToolsGuard from 'react-devtools-blocker';

export default function Layout({ children }) {
  return (
    <>
      <DevToolsGuard />
      {children}
    </>
  );
}

⚙️ Props

| Prop | Type | Required | Default | Description | |----------------|---------|----------|------------------------------|---------------------------------------------| | redirectUrl | string | No | "https://www.google.com" | URL to redirect when DevTools are detected | | debug | boolean | No | false | Enables console logs for debugging |

🔐 Use Cases

Protect sensitive applications like:

  • Online exams/testing platforms
  • Digital product access
  • Game logic protection
  • Client-side business logic
  • Anti-cheat mechanisms

⚠️ Limitations

  • Not 100% foolproof (no client-side solution can be)
  • May trigger on mobile devices with unusual screen ratios
  • Can be bypassed by determined users

🤝 Contributing

Pull requests are welcome! Please open an issue first to discuss changes.

📃 License

MIT © Pressbuddy Software Solutions