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 Axios configuration ​

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

All options are passed as the second argument to instrumentAxios():

ts
instrumentAxios(client, {
  // options here
});

instrumentAxios() validates its first argument and throws "allure-axios requires an Axios instance" immediately if it is not a valid Axios instance.

Customize the attachment name ​

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

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

By default, each attachment is named after the request method and full URL — for example, GET https://api.example.com/orders. The URL used here is the raw, resolved URL, including any query parameters in their original (unredacted) form. Redaction only applies to the structured fields inside the attachment (query, headers, cookies, form), not to the URL string in the attachment name or in exchange.request.url.

To use the same static name for all attachments, pass a string:

ts
instrumentAxios(client, {
  attachmentName: "API request",
});

To derive the name dynamically from the exchange data, pass a function:

ts
instrumentAxios(client, {
  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 Axios captures both the request and response body. Set captureRequestBody or captureResponseBody to false to skip one or both:

ts
instrumentAxios(client, {
  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
instrumentAxios(client, {
  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 Axios reference.

Redaction ​

Allure Axios 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 Axios reference for the full RedactionMatcher and RedactionContext type documentation.

  • redactHeaders: RedactionMatcher[]
  • redactQueryParams: RedactionMatcher[]
  • redactCookies: RedactionMatcher[]
  • redactFormFields: RedactionMatcher[]
ts
instrumentAxios(client, {
  // 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, a cancellation, or an HTTP error response — Allure Axios records the error's name and message in the attachment. Set includeErrorStack to true to also capture the stack trace:

ts
instrumentAxios(client, {
  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
instrumentAxios(client, {
  throwAttachmentErrors: true,
});

INFO

throwAttachmentErrors only takes effect when the HTTP request itself succeeds. If the request fails (due to a network error, cancellation, or HTTP error response) 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/axios-configuration.md