Skip to content
Allure report logoAllure Report
Main Navigation ModulesDocumentationStarter Project

English

Español

English

Español

Appearance

Sidebar Navigation

Allure 3

Install & Upgrade

Install Allure

Upgrade Allure

Configure

Create Reports

How to generate a report

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Reading Allure charts

Migrate from Allure 2

Allure 2

Install & Upgrade

Install for Windows

Install for macOS

Install for Linux

Install for Node.js

Upgrade Allure

Create Reports

How to generate a report

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Features

Test steps

Attachments

Test statuses

Assertion diffs

Sorting and filtering

Environments

Multistage Builds

Categories

Visual analytics

Test stability analysis

History and retries

Quality Gate

Global Errors and Attachments

Timeline

Export to CSV

Export metrics

Guides

JUnit 5 parametrization

JUnit 5 & Selenide: screenshots and attachments

JUnit 5 & Selenium: screenshots and attachments

Setting up JUnit 5 with GitHub Actions

Pytest parameterization

Pytest & Selenium: screenshots and attachments

Pytest & Playwright: screenshots and attachments

Pytest & Playwright: videos

Playwright parameterization

Publishing Reports to GitHub Pages

Allure Report 3: XCResults Reader

How it works

Overview

Glossary

Test result file

Container file

Categories file

Environment file

Executor file

History files

Test Identifiers

Integrations

Azure DevOps

Bamboo

GitHub Action

Jenkins

JetBrains IDEs

TeamCity

Visual Studio Code

Frameworks

Axios

Getting started

Configuration

Reference

Behat

Getting started

Configuration

Reference

Behave

Getting started

Configuration

Reference

Bun

Getting started

Configuration

Reference

Chai

Getting started

Reference

Codeception

Getting started

Configuration

Reference

CodeceptJS

Getting started

Configuration

Reference

Cucumber.js

Getting started

Configuration

Reference

Cucumber-JVM

Getting started

Configuration

Reference

Cucumber.rb

Getting started

Configuration

Reference

Cypress

Getting started

Configuration

Reference

Fetch

Getting started

Configuration

Reference

Jasmine

Getting started

Configuration

Reference

JBehave

Getting started

Configuration

Reference

Jest

Getting started

Configuration

Reference

JUnit 4

Getting started

Configuration

Reference

JUnit 5

Getting started

Configuration

Reference

Mocha

Getting started

Configuration

Reference

Newman

Getting started

Configuration

Reference

NUnit

Getting started

Configuration

Reference

PHPUnit

Getting started

Configuration

Reference

Playwright

Getting started

Configuration

Reference

pytest

Getting started

Configuration

Reference

Pytest-BDD

Getting started

Configuration

Reference

Reqnroll

Getting started

Configuration

Reference

REST Assured

Getting started

Configuration

Robot Framework

Getting started

Configuration

Reference

Rust Cargo Test

Getting started

Configuration

Reference

RSpec

Getting started

Configuration

Reference

SpecFlow

Getting started

Configuration

Reference

Spock

Getting started

Configuration

Reference

TestNG

Getting started

Configuration

Reference

Vitest

Getting started

Configuration

Reference

WebdriverIO

Getting started

Configuration

Reference

xUnit.net

Getting started

Configuration

Reference

On this page

Allure Fetch configuration ​

This page describes the options that affect the behavior of the Allure Fetch integration.

All options are passed as the second argument to withAllure() or instrumentGlobalFetch():

ts
withAllure(fetch, {
  // options here
});

instrumentGlobalFetch({
  // options here
});

withAllure() validates its first argument and throws "allure-fetch requires a fetch implementation" immediately if it is null, undefined, or otherwise falsy.

instrumentGlobalFetch() throws "allure-fetch can't instrument global fetch because globalThis.fetch is not defined" if globalThis.fetch is absent — for example, in Node.js environments without a fetch polyfill.

Customize the attachment name ​

  • attachmentName: string | ((exchange: HttpExchange) => string)

Specify the name under which Allure Fetch creates the attachment for each HTTP exchange. For the shape of the HttpExchange argument, see Allure Fetch reference.

By default, each attachment is named "HTTP Exchange". To use a different static name for all attachments, pass a string:

ts
withAllure(fetch, {
  attachmentName: "API request",
});

To derive the name dynamically from the exchange data, pass a function. The URL available in exchange.request.url is the raw, unredacted URL. Redaction only applies to the structured fields inside the attachment (query, headers, cookies, form), not to the URL string used in exchange.request.url.

ts
withAllure(fetch, {
  attachmentName: (exchange) =>
    `${exchange.request.method} ${new URL(exchange.request.url).pathname}`,
});

Control body capture ​

  • captureRequestBody: boolean (default: true)
  • captureResponseBody: boolean (default: true)
  • maxBodySize: number (default: 65536)

By default, Allure Fetch captures both the request and response body. Set captureRequestBody or captureResponseBody to false to skip one or both:

ts
withAllure(fetch, {
  captureRequestBody: false,
  captureResponseBody: false,
});

maxBodySize sets the maximum number of bytes to capture from any single body. Bodies that exceed this limit are captured up to the limit and flagged as truncated in the attachment. The default is 64 KiB (65 536 bytes).

ts
withAllure(fetch, {
  maxBodySize: 1024 * 1024, // 1 MiB
});

Any value less than 1 is treated as 0, which captures body metadata but stores an empty value.

For details on how captured bodies are encoded and what the attachment fields contain, see Allure Fetch reference.

Redaction ​

Allure Fetch replaces sensitive values with the sentinel string __ALLURE_REDACTED__ before writing the attachment. The defaults are:

CategoryRedacted by default
Headersauthorization, cookie, set-cookie, and any header whose name contains token, password, passwd, secret, api-key/api_key/apikey (one pattern), or session
Query parametersAny parameter whose name contains the same patterns listed above
CookiesAll cookies
URL-encoded form fieldsAny field whose name contains the same patterns listed above

The following options let you override the defaults for each category. Each accepts an array of RedactionMatcher values — strings, regular expressions, or functions. Providing an array replaces the defaults for that category entirely. See Allure Fetch reference for the full RedactionMatcher and RedactionContext type documentation.

  • redactHeaders: RedactionMatcher[]
  • redactQueryParams: RedactionMatcher[]
  • redactCookies: RedactionMatcher[]
  • redactFormFields: RedactionMatcher[]
ts
withAllure(fetch, {
  // Only redact headers explicitly listed, nothing else
  redactHeaders: ["authorization", "x-api-key"],
  // Allow cookies through unredacted
  redactCookies: [],
});

Error options ​

  • includeErrorStack: boolean (default: false)

When a request fails — whether due to a transport error, an abort, or a response body stream error — Allure Fetch records the error's name and message in the attachment. Set includeErrorStack to true to also capture the stack trace:

ts
withAllure(fetch, {
  includeErrorStack: true,
});
  • throwAttachmentErrors: boolean (default: false)

By default, if writing the attachment fails — for example, because no Allure runtime is active during the request — the error is silently ignored. Set throwAttachmentErrors to true to have such errors rethrow instead. This is useful when debugging why attachments are not appearing:

ts
withAllure(fetch, {
  throwAttachmentErrors: true,
});

INFO

throwAttachmentErrors only takes effect when the HTTP request itself succeeds. If the request fails (due to a transport error, abort, or response body stream error) and writing the attachment also fails, the attachment error is still silently ignored so the original request error propagates cleanly.

Pager
Previous pageGetting started
Next pageReference
Powered by

Subscribe to our newsletter

Get product news you actually need, no spam.

Subscribe
Allure TestOps
  • Overview
  • Why choose us
  • Cloud
  • Self-hosted
  • Success Stories
Company
  • Documentation
  • Blog
  • About us
  • Contact
  • Events
© 2026 Qameta Software Inc. All rights reserved.
A Markdown version of this page is available at /docs/fetch-configuration.md