The `eth-phishing-detect` utility is a JavaScript library designed to identify and block domains known for targeting Ethereum users with phishing attacks. Maintained by MetaMask, it provides an up-to-date list of malicious websites, actively evolving its blocking policy to include sites that impersonate established services or attempt to collect cryptocurrency keys. The package is currently at version `1.2.0` and was last published about 4 years ago (as of April 2026), with prior versions indicating a more active cadence for configuration updates. It differentiates itself through its direct integration and maintenance by a major wallet provider, offering a robust and proactive defense mechanism against specific web3-related threats. Developers can use it to integrate real-time phishing detection into their applications, enhancing user security by preventing access to known harmful sites.
npm install eth-phishing-detectVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing the `PhishingDetector` with custom lists and checking various domains for phishing status, including legitimate, blacklisted, and fuzzy-matched examples.
Review the documentation for `PhishingDetector` constructor when passing an array of configurations. Adjust code to handle the new return value structure (e.g., an array of results instead of a single object).
For CommonJS, use the documented `require('eth-phishing-detect/src/detector')` if you must, but be aware of potential instability. For ESM, prefer `import { PhishingDetector } from 'eth-phishing-detect/detector'` for potentially better stability and compatibility.Integrators should be aware that the underlying blocklist is dynamic. Avoid hardcoding assumptions about specific blocked or whitelisted domains. Regularly check the interactive page or library updates for policy changes.
For CommonJS: `const checkForPhishing = require('eth-phishing-detect')`. For ESM: `import checkForPhishing from 'eth-phishing-detect'`.For ESM, try `import { PhishingDetector } from 'eth-phishing-detect/detector'`. If using CJS and facing this issue, ensure your build system supports direct `src/` imports or check for an alternative, stable path in the package's `package.json` `exports` field.