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

# plugin-breadcrumbs-network

The `@appsignal/javascript` plugin for automatically adding a breadcrumb on every network request. Works with both `XMLHttpRequest` and `fetch`.

## Installation

Add the `@appsignal/plugin-breadcrumbs-network` and `@appsignal/javascript` packages to your `package.json`. Then, run `yarn install`/`npm install`.

You can also add these packages to your `package.json` on the command line:

```bash Bash theme={null}
yarn add @appsignal/javascript @appsignal/plugin-breadcrumbs-network
npm install @appsignal/javascript @appsignal/plugin-breadcrumbs-network
```

## Usage

```js JavaScript theme={null}
import Appsignal from "@appsignal/javascript";
import { plugin } from "@appsignal/plugin-breadcrumbs-network";

const appsignal = new Appsignal({
  key: "YOUR FRONTEND API KEY",
});

appsignal.use(plugin(options));
```

### `plugin` options

The `plugin` can be initialized with the following options:

| Param | Type | Description |
| - | - | - |
| xhrEnabled | Boolean | (optional) A boolean value representing whether the plugin should bind to `XMLHttpRequest`. Defaults to `true`. |
| fetchEnabled | Boolean | (optional) A boolean value representing whether the plugin should bind to `fetch`. Defaults to `true`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.