{"id":47057,"library":"axios-har-tracker","title":"axios-har-tracker","description":"A library for capturing HTTP Archive (HAR) files from axios requests. v0.8.0 supports axios 0.x/1.x. Tracks all requests made through axios and builds a HAR object that can be exported to a .har file. Inspired by request-har, differentiates by working specifically with axios. TypeScript types included. Not frequently updated.","status":"active","version":"0.8.0","language":"javascript","source_language":"en","source_url":"https://github.com/BeataKr/axios-har-tracker","tags":["javascript","axios","HTTP Archive format","archive file","typescript"],"install":[{"cmd":"npm install axios-har-tracker","lang":"bash","label":"npm"},{"cmd":"yarn add axios-har-tracker","lang":"bash","label":"yarn"},{"cmd":"pnpm add axios-har-tracker","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the library wraps axios to intercept requests","package":"axios","optional":false}],"imports":[{"note":"Default export is not available; only named export.","wrong":"import AxiosHarTracker from 'axios-har-tracker'","symbol":"AxiosHarTracker","correct":"import { AxiosHarTracker } from 'axios-har-tracker'"},{"note":"CommonJS requires destructuring because there is no default export.","wrong":"const AxiosHarTracker = require('axios-har-tracker')","symbol":"AxiosHarTracker","correct":"const { AxiosHarTracker } = require('axios-har-tracker')"},{"note":"Also exports types for HAR entries. Available as a named export.","wrong":"","symbol":"HarEntry","correct":"import { HarEntry } from 'axios-har-tracker'"}],"quickstart":{"code":"import axios from 'axios';\nimport { AxiosHarTracker } from 'axios-har-tracker';\n\nconst tracker = new AxiosHarTracker(axios);\n\n(async () => {\n  await axios.get('https://httpbin.org/get');\n  await axios.post('https://httpbin.org/post', { key: 'value' });\n\n  const har = tracker.getGeneratedHar();\n  console.log(JSON.stringify(har, null, 2));\n})();","lang":"typescript","description":"Creates a tracker, makes GET and POST requests, then retrieves the HAR object."},"warnings":[{"fix":"Ensure the tracker is created before calling axios.get/post/etc.","message":"AxiosHarTracker must be instantiated before any axios requests are made; otherwise requests are not captured.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a single tracker instance per session or call a reset method if available (not provided).","message":"The library intercepts axios globally; avoid creating multiple trackers without clearing previous ones.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use axios >=1.0.0 and verify compatibility.","message":"axios 0.x is not officially supported in later versions of this library; check peer dependency.","severity":"deprecated","affected_versions":">=0.8.0"},{"fix":"Use import { AxiosHarTracker } instead of import AxiosHarTracker from 'axios-har-tracker'.","message":"In v0.7.0, the export changed from default to named export \"AxiosHarTracker\".","severity":"breaking","affected_versions":">=0.7.0"}],"env_vars":null,"search_vec":"'0':19 'archiv':10,60,62 'axio':2,14,18,26,50,58 'axios-har-track':1 'build':28 'captur':8 'differenti':45 'export':35 'file':12,39,63 'format':61 'frequent':55 'har':3,11,30,38,44 'http':9,59 'includ':53 'inspir':40 'javascript':57 'librari':6 'made':24 'object':31 'request':15,23,43 'request-har':42 'specif':48 'support':17 'track':21 'tracker':4 'type':52 'typescript':51,64 'updat':56 'v0.8.0':16 'work':47 'x/1.x':20","created_at":"2026-06-07T16:49:33.408208+00:00","updated_at":"2026-06-07T16:49:33.408208+00:00","problems":[{"fix":"Pass the default axios export or create an instance using axios.create().","cause":"AxiosHarTracker expects an axios instance, but a custom instance with missing method was passed.","error":"TypeError: axios.create is not a function"},{"fix":"Ensure you pass the axios module itself: new AxiosHarTracker(axios).","cause":"AxiosHarTracker received a value that is not an axios instance (e.g., undefined).","error":"Cannot read property 'interceptors' of undefined"},{"fix":"Move tracker instantiation before any axios calls.","cause":"Tracker was created after requests were already made.","error":"No HAR entries generated"}],"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://github.com/BeataKr/axios-har-tracker","github":"https://github.com/BeataKr/axios-har-tracker","docs":null,"changelog":null,"pypi":null,"npm":"axios-har-tracker","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}}