{"id":21806692,"url":"https://github.com/hungtcs/react-axios","last_synced_at":"2026-04-24T12:32:50.829Z","repository":{"id":158480150,"uuid":"633682656","full_name":"hungtcs/react-axios","owner":"hungtcs","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-09T01:15:25.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T16:39:25.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hungtcs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-28T03:39:55.000Z","updated_at":"2023-04-29T06:25:35.000Z","dependencies_parsed_at":"2024-11-27T12:39:43.503Z","dependency_job_id":null,"html_url":"https://github.com/hungtcs/react-axios","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/hungtcs/react-axios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Freact-axios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Freact-axios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Freact-axios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Freact-axios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hungtcs","download_url":"https://codeload.github.com/hungtcs/react-axios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Freact-axios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32223971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T12:29:18.377Z","updated_at":"2026-04-24T12:32:50.787Z","avatar_url":"https://github.com/hungtcs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Axios\n\nReact Axios is a React library based on Axios that aims to provide better HTTP request handling\ncapabilities for React applications. The library provides an AxiosProvider component that makes\nit easy to use Axios throughout your entire React application, and includes a useAxios hook\nand some customizable interceptors.\n\n## Installation\n\n```shell\nnpm install @cicara/react-axios\n```\n\n## Usage\n\nTo use Axios in your React components, you need to provide an AxiosProvider component in your\napplication. In the AxiosProvider component, you can set the configuration for the Axios instance,\nand add interceptors for custom handling.\n\n```tsx\nimport { useEffect } from \"react\";\nimport { useAxios, AxiosProvider } from \"@cicara/react-axios\";\n\nfunction TestAxios() {\n  const axios = useAxios();\n\n  useEffect(\n    () =\u003e {\n      const ac = new AbortController();\n\n      // GET request to `/base/url/test?_t=1682750920279`\n      axios.get(\"/test\", { signal: ac.signal })\n        .catch((err) =\u003e {\n          console.error(err);\n        });\n\n      return () =\u003e {\n        ac.abort();\n      };\n    }, \n    [axios],\n  );\n\n  return (\n    \u003cdiv\u003eAxios Test\u003c/div\u003e\n  );\n}\n\nexport default function App() {\n  return (\n    \u003cAxiosProvider\n      config={{\n        baseURL: \"/base/url\"\n      }}\n      interceptors={[\n        {\n          name: \"timestamp\",\n          request: {\n            onFulfilled(request) {\n              request.params = {\n                _t: Date.now(),\n                ...request.params,\n              };\n              return request;\n            }\n          }\n        }\n      ]}\u003e\n      \u003cTestAxios /\u003e\n      \u003cAxiosProvider\n        config={{\n          baseURL: \"/base/url2\"\n        }}\n        interceptors={[\n          {\n            name: \"auth\",\n            request: {\n              onFulfilled(request) {\n                request.headers.Authorization = `Bearer ${localStorage.getItem('token')}`;\n                return request;\n              }\n            }\n          }\n        ]}\u003e\n        \u003cTestAxios /\u003e\n      \u003c/AxiosProvider\u003e\n    \u003c/AxiosProvider\u003e\n  );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungtcs%2Freact-axios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhungtcs%2Freact-axios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungtcs%2Freact-axios/lists"}