New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wreq-js

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wreq-js

Node.js/TypeScript HTTP client with browser TLS fingerprint impersonation (JA3/JA4). Bypass Cloudflare and anti-bot detection. Rust-powered, fetch()-compatible.

latest
Source
npmnpm
Version
2.2.2
Version published
Weekly downloads
7.8K
11.07%
Maintainers
1
Weekly downloads
 
Created
Source

wreq-js

npm CI Ask DeepWiki

wreq-js is a Node.js and TypeScript HTTP client that helps you bypass TLS fingerprinting checks used by services like Cloudflare and DataDome, powered by native Rust bindings from wreq.

If your requests work in a browser but get blocked from Node.js because your network fingerprint looks wrong, this is for you. You keep a fetch style API and get browser profile level network behavior without running a full browser.

  • Built in browser TLS and HTTP fingerprint profiles across Chrome, Firefox, Safari, Edge, Opera, and OkHttp families
  • Native Rust engine for high throughput traffic with no browser process overhead
  • Fetch style API with sessions, cookies, proxies, and transport controls
  • WebSocket helper and constructor APIs with session cookie and transport reuse
  • TypeScript first developer experience with generated definitions
  • Native targets for macOS, Linux, and Windows

Common search terms: cloudflare bypass, datadome bypass, tls fingerprinting, ja3, ja4, browser impersonation, nodejs fetch, typescript http client.

Alternatives comparison

LibraryApproachAPINotes
wreq-jsRust native bindings (wreq)Fetch style, TypeScript firstProfile labels and network behavior come from the native layer
CycleTLSGo subprocess bridgePromise basedSubprocess model
got-scrapingJavaScript HTTP client customizationgot basedHeader and request customization
node-tls-clientNative shared library bindingsCustomBehavior depends on upstream native layer
curl-impersonatecurl based toolingCLI and bindingsBinary/tooling workflow

Documentation

All guides, concepts, and API reference live at:

(If you're looking for examples, sessions/cookies, proxy usage, streaming, WebSockets, or the full API surface - it's all there.)

Quick links:

Installation

npm install wreq-js
# or
yarn add wreq-js
pnpm add wreq-js
bun add wreq-js

Current configured native target matrix in package.json includes:

  • macOS (Intel and Apple Silicon)
  • Linux (x64 glibc and musl, arm64 glibc)
  • Windows (x64)

If a matching prebuilt artifact is unavailable for your environment, installation may build from source (requires a Rust toolchain).

Quick start

import { fetch } from 'wreq-js';

const res = await fetch('https://example.com/api', {
  browser: 'chrome_142',
  os: 'windows',
});

console.log(await res.json());

By default, standalone fetch() calls use isolated ephemeral cookie storage. Use createSession() when you want cookie persistence across requests.

For most real-world workloads, start with a session and reuse it across requests. This keeps one cookie and request context for multi step flows.

import { createSession } from 'wreq-js';

const session = await createSession({ browser: 'chrome_142', os: 'windows' });

try {
  const a = await session.fetch('https://example.com/a');
  const b = await session.fetch('https://example.com/b');
  console.log(a.status, b.status);
} finally {
  await session.close();
}

More session patterns: https://wreq.sqdsh.win

WebSockets

Use the helper for a connected socket from one await.

import { websocket } from 'wreq-js';

const ws = await websocket('wss://example.com/ws', {
  browser: 'chrome_142',
  headers: {
    Authorization: 'Bearer token',
  },
});

ws.onmessage = (event) => {
  console.log(event.data);
};

ws.send('hello');
ws.close(1000, 'done');

Use the constructor when you want browser like CONNECTING behavior.

import { WebSocket } from 'wreq-js';

const ws = new WebSocket('wss://example.com/ws', {
  browser: 'chrome_142',
  os: 'windows',
});

ws.onopen = () => {
  void ws.send('connected');
};

Use session.websocket(...) to reuse cookies and transport settings from session HTTP calls.

import { createSession } from 'wreq-js';

const session = await createSession({ browser: 'chrome_142' });

try {
  await session.fetch('https://example.com/login', {
    method: 'POST',
    body: new URLSearchParams({ user: 'name', pass: 'secret' }),
  });

  const ws = await session.websocket('wss://example.com/ws');
  ws.onmessage = (event) => {
    console.log(event.data);
  };
} finally {
  await session.close();
}

When to use

Use wreq-js when your Node.js HTTP or WebSocket traffic gets blocked because of TLS fingerprinting or browser profile mismatches. It is a good fit when you want Cloudflare bypass and DataDome bypass style network behavior with a familiar fetch style API. It handles transport and fingerprint level behavior, not CAPTCHA solving and not in page JavaScript execution.

If you need DOM/JS execution, CAPTCHA solving, or full browser automation, use Playwright/Puppeteer instead.

FAQ

  • Why use sessions? Use sessions for multi-step flows where cookie and request context should be shared.

  • Why does install compile from source on some machines? If a matching prebuilt native artifact is unavailable, npm may build from source.

  • Can I use per-request proxy overrides inside a session? Yes, by passing a transport on that specific session.fetch(...) call. The proxy field itself remains session-scoped.

Contributing

See CONTRIBUTING.md.

Origins

This is a maintained fork of will-work-for-meal/node-wreq (originally named node-wreq), with ongoing updates, compatibility fixes, and performance work.

Acknowledgments

  • wreq - Rust HTTP client with browser impersonation
  • wreq-util - related browser profile tooling in the upstream ecosystem
  • NAPI-RS - Rust ↔ Node.js bindings

Keywords

cloudflare

FAQs

Package last updated on 19 Mar 2026

Did you know?

Socket

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.

Install

Related posts