
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@apihero/browser
Advanced tools
npm install @apihero/browser
This library uses a Service Worker approach to capture and proxy API requests performed in the browser, so the setup is slightly different from Node.
You'll first need to add the Service Worker code to your public directly, using the apihero-cli
cli:
npm exec apihero-cli init public/ --save
Next, create a file to setup the worker, for example in src/apihero.js
:
// src/apihero.js
import { setupWorker } from "@apihero/browser";
export const worker = setupWorker({
// You MUST supply the allow option for setupWorker, to ensure too many requests are not sent to the API Hero proxy
allow: ["api.github.com", "api.twitter.com/users/*"],
deny: ["myprivateapi.dev/*"],
projectKey: "hero_123abc",
url: "https://proxy.apihero.run",
});
Finally, will need to start the worker in your application code. For example, in a React app
// src/index.js
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import { worker } from "./apihero";
worker.start();
ReactDOM.render(<App />, document.getElementById("root"));
You could also restrict proxying to only local dev like so:
// src/index.js
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
if (process.env.NODE_ENV === "development") {
const { worker } = require("./apihero");
worker.start();
}
ReactDOM.render(<App />, document.getElementById("root"));
FAQs
## Installation
The npm package @apihero/browser receives a total of 2 weekly downloads. As such, @apihero/browser popularity was classified as not popular.
We found that @apihero/browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.