{"id":46904,"library":"allure-fetch","title":"Allure Fetch","description":"Allure Fetch is an integration library for Allure reporting framework that instruments the Fetch API to capture HTTP request/response data and attach it to Allure test reports. Current stable version is 3.9.0, with monthly releases. It is part of the Allure JS ecosystem and provides seamless integration for test frameworks using Fetch (e.g., Playwright, Cypress). Key differentiator: automatic recording of network interactions without manual interception, supporting both Node.js and browser environments.","status":"active","version":"3.9.0","language":"javascript","source_language":"en","source_url":"https://github.com/allure-framework/allure-js","tags":["javascript","allure","fetch","html","http","report","testing","testops","typescript"],"install":[{"cmd":"npm install allure-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add allure-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add allure-fetch","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Allure runtime dependency for report generation","package":"allure-js-commons","optional":false}],"imports":[{"note":"AllureFetch is a named export, not a default export.","wrong":"import AllureFetch from 'allure-fetch'","symbol":"AllureFetch","correct":"import { AllureFetch } from 'allure-fetch'"},{"note":"Alternative name for AllureFetch, same named export.","symbol":"AllureNetworkRecorder","correct":"import { AllureNetworkRecorder } from 'allure-fetch'"},{"note":"Alias for the main recorder class.","symbol":"FetchRecorder","correct":"import { FetchRecorder } from 'allure-fetch'"}],"quickstart":{"code":"import { AllureFetch } from 'allure-fetch';\nimport { AllureRuntime } from 'allure-js-commons';\n\nconst runtime = new AllureRuntime({ resultsDir: './allure-results' });\nconst fetchRecorder = new AllureFetch(runtime, { request: true, response: true });\n\n// Record a fetch call\nfetchRecorder.runWithRecording(async () => {\n  const response = await fetch('https://api.example.com/data');\n  const data = await response.json();\n  console.log(data);\n});\n\nfetchRecorder.stop();","lang":"typescript","description":"Shows how to instantiate AllureFetch with an AllureRuntime, record HTTP requests via Fetch, and attach them to Allure reports."},"warnings":[{"fix":"Call .stop() or use runWithRecording callback to ensure flush.","message":"AllureFetch must be stopped before test completion; otherwise, requests may not be flushed to the report.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update instantiation: `new AllureFetch(runtime, { request: true, response: true })`.","message":"In v3.0.0, the AllureFetch constructor changed from (runtime, options) to (runtime, options?) with altered default options.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Call .clear() before each test to reset the recorder.","message":"Duplicate recordings occur if fetch is called multiple times without clearing previous state.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'3.9.0':34 'allur':1,3,10,27,43,75 'api':17 'attach':24 'automat':60 'browser':72 'captur':19 'current':30 'cypress':57 'data':22 'differenti':59 'e.g':55 'ecosystem':45 'environ':73 'fetch':2,4,16,54,76 'framework':12,52 'html':77 'http':20,78 'instrument':14 'integr':7,49 'interact':64 'intercept':67 'javascript':74 'js':44 'key':58 'librari':8 'manual':66 'month':36 'network':63 'node.js':70 'part':40 'playwright':56 'provid':47 'record':61 'releas':37 'report':11,29,79 'request/response':21 'seamless':48 'stabl':31 'support':68 'test':28,51,80 'testop':81 'typescript':82 'use':53 'version':32 'without':65","created_at":"2026-06-07T16:48:10.158044+00:00","updated_at":"2026-06-07T16:48:10.158044+00:00","problems":[{"fix":"Ensure you call .stop() before initializing a new recording.","cause":"AllureFetch is not stopped before a new recording starts, leaving internal state inconsistent.","error":"TypeError: Cannot read properties of undefined (reading 'append')"},{"fix":"Use `import { AllureFetch } from 'allure-fetch'` (curly braces).","cause":"Using a default import instead of a named import.","error":"AllureFetch is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://allurereport.org/","github":"https://github.com/allure-framework/allure-js","docs":null,"changelog":null,"pypi":null,"npm":"allure-fetch","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}