> ## Documentation Index
> Fetch the complete documentation index at: https://wreq.sqdsh.win/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install wreq-js and get ready for development.

## Requirements

* **Node.js** v20.0.0 or higher
* One of the supported platforms (see below)

## Install via package manager

<CodeGroup>
  ```bash npm theme={null}
  npm install wreq-js
  ```

  ```bash yarn theme={null}
  yarn add wreq-js
  ```

  ```bash pnpm theme={null}
  pnpm add wreq-js
  ```

  ```bash bun theme={null}
  bun add wreq-js
  ```
</CodeGroup>

## Supported platforms

Configured native targets in `package.json` include:

| Platform | Architecture          |
| -------- | --------------------- |
| macOS    | Intel (x64)           |
| macOS    | Apple Silicon (arm64) |
| Linux    | x64 (glibc)           |
| Linux    | x64 (musl)            |
| Linux    | arm64 (glibc)         |
| Windows  | x64                   |

## Building from source

<Warning>
  If a prebuilt binary for your platform is unavailable, installation may require building from source. Make sure you have the following installed:
</Warning>

### Prerequisites

1. **Rust toolchain**: install via [rustup](https://rustup.rs/):
   ```bash theme={null}
   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   ```

2. **Build essentials**: C compiler and related tools:

   <Tabs>
     <Tab title="macOS">
       ```bash theme={null}
       xcode-select --install
       ```
     </Tab>

     <Tab title="Ubuntu/Debian">
       ```bash theme={null}
       sudo apt-get install build-essential
       ```
     </Tab>

     <Tab title="Windows">
       Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) with the "C++ build tools" workload.
     </Tab>
   </Tabs>

### Build

After installing prerequisites, the package will automatically build when you run:

```bash theme={null}
npm install wreq-js
```

## Verify installation

```typescript theme={null}
import { fetch, getProfiles } from 'wreq-js';

// Check available browser profiles
console.log('Available profiles:', getProfiles());

// Make a test request
const response = await fetch('https://httpbin.org/get', {
  browser: 'chrome_142',
});
console.log('Status:', response.status);
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Binary not found error">
    If you see an error about missing binaries, ensure you're using a supported platform or have the build prerequisites installed.
  </Accordion>

  <Accordion title="Permission errors on macOS">
    If you encounter permission issues, try:

    ```bash theme={null}
    sudo chown -R $(whoami) ~/.npm
    ```
  </Accordion>
</AccordionGroup>
