# cypress-plugin-xhr-toggle

> Turn off xhr requests in Cypress timeline

Latest version **1.3.0** (published 2026-03-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install cypress-plugin-xhr-toggle
pnpm add cypress-plugin-xhr-toggle
yarn add cypress-plugin-xhr-toggle
bun add cypress-plugin-xhr-toggle
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2026-03-22 |
| First published | 2023-02-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Filip Hric |
| Maintainers | filiphric |

## Links

- npm: https://www.npmjs.com/package/cypress-plugin-xhr-toggle
- Repository: https://github.com/filiphric/cypress-plugin-xhr-toggle
- Homepage: https://github.com/filiphric/cypress-plugin-xhr-toggle#readme
- Issues: https://github.com/filiphric/cypress-plugin-xhr-toggle/issues
- npm.io page: https://npm.io/package/cypress-plugin-xhr-toggle

## Recent versions

- 1.3.0 (latest) — 2026-03-22
- 1.2.1 — 2024-02-18
- 1.0.0 — 2023-02-16
- 0.2.0 — 2023-02-15
- 0.1.0 — 2023-02-15

## README

<h2 align=center>Cypress XHR toggle plugin</h2>
<p align="center">
<a href="https://github.com/sponsors/filiphric"><img src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86" /></a>
</p>

<p align="center">
A small Cypress helper that de-clutters your timeline by hiding XHR requests.
</p>

![Toggle XHR in timeline](./images/toggle.gif)

### Installation

Install this package:
```bash
npm i cypress-plugin-xhr-toggle
# or
yarn add cypress-plugin-xhr-toggle
```

Import the plugin into your `cypress/support/e2e.js` file:
```js
import 'cypress-plugin-xhr-toggle'
// or
require('cypress-plugin-xhr-toggle')
```

### Usage
Open Cypress in GUI mode and see a new button. Click on it to hide all your XHR lines to de-clutter your timeline. You can set this up as default behavior by setting up `hideXhr` in your config:

#### Cypress 15+ (using `expose`)

```ts
import { defineConfig } from "cypress";

export default defineConfig({
  fixturesFolder: false,
  e2e: {
    setupNodeEvents(on, config) {},
  },
  expose: {
    hideXhr: true
  },
});
```

#### Cypress 10–14 (using `env`)

```ts
import { defineConfig } from "cypress";

export default defineConfig({
  fixturesFolder: false,
  e2e: {
    setupNodeEvents(on, config) {},
    env: {
      hideXhr: true
    }
  },
});
```

<hr>
<p align="center">
...powered by coffee and love ❤️  <a href="https://filiphric.com">Filip Hric
</p>

---
_Source: https://npm.io/package/cypress-plugin-xhr-toggle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
