{"id":19732215,"url":"https://github.com/lifeomic/axios-fetch","last_synced_at":"2025-05-15T07:07:18.409Z","repository":{"id":43004432,"uuid":"121446874","full_name":"lifeomic/axios-fetch","owner":"lifeomic","description":"A WebAPI Fetch implementation backed by an Axios client","archived":false,"fork":false,"pushed_at":"2024-11-18T23:00:41.000Z","size":1130,"stargazers_count":174,"open_issues_count":11,"forks_count":31,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-07T05:03:48.732Z","etag":null,"topics":["axios","fetch-api","team-infra"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lifeomic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-02-13T23:00:55.000Z","updated_at":"2025-04-03T11:09:42.000Z","dependencies_parsed_at":"2023-11-11T00:21:40.426Z","dependency_job_id":"3d11ad8b-ece4-4445-a561-895400e7bf7e","html_url":"https://github.com/lifeomic/axios-fetch","commit_stats":{"total_commits":134,"total_committers":22,"mean_commits":6.090909090909091,"dds":0.7686567164179104,"last_synced_commit":"87f9c7ce968ff423a6a3a470648957349b42d693"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Faxios-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Faxios-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Faxios-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Faxios-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifeomic","download_url":"https://codeload.github.com/lifeomic/axios-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["axios","fetch-api","team-infra"],"created_at":"2024-11-12T00:25:17.810Z","updated_at":"2025-05-15T07:07:13.377Z","avatar_url":"https://github.com/lifeomic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Axios-Fetch\n\n[![npm](https://img.shields.io/npm/v/@lifeomic/axios-fetch.svg)](https://www.npmjs.com/package/@lifeomic/axios-fetch)\n[![Build Status](https://github.com/lifeomic/axios-fetch/actions/workflows/release.yaml/badge.svg)](https://github.com/lifeomic/axios-fetch/actions/workflows/release.yaml)\n[![Coverage Status](https://coveralls.io/repos/github/lifeomic/axios-fetch/badge.svg?branch=master)](https://coveralls.io/github/lifeomic/axios-fetch?branch=master)\n![Dependabot Badge](https://flat.badgen.net/dependabot/lifeomic/axios-fetch?icon=dependabot)\n\nThis library exposes a Fetch WebAPI implementation backed by an Axios client\ninstance. This allows a bridge between projects that have pre-configured Axios\nclients already to other libraries that require Fetch implementations.\n\n## Global Response object\n\nIt is expected that the global Response object will be available. For testing we use the [node-fetch\n](https://www.npmjs.com/package/node-fetch) library.\n\n```typescript\nimport { Response } from 'node-fetch';\n// @ts-expect-error node-fetch doesn't exactly match the Response object, but close enough.\nglobal.Response = Response;\n```\n\n## Example\n\nOne library that wants a Fetch implementation is the [Apollo Link\nHTTP](https://www.apollographql.com/docs/link/links/http.html) library. If your\nproject has an existing Axios client configured, then this project can help you\nuse that client in your apollo-link-http instance. Here is some sample code:\n\n```javascript\nconst { buildAxiosFetch } = require(\"@lifeomic/axios-fetch\");\nconst { createHttpLink } = require(\"apollo-link-http\");\nconst link = createHttpLink({\n  uri: \"/graphql\",\n  fetch: buildAxiosFetch(yourAxiosInstance)\n});\n```\n\n## Transforming requests\n\nIt is possible to transform requests before they reach your Axios client by providing\nan optional argument to `buildAxiosFetch`. For example, if you wanted a fetch implementation\nthat always set the request timeout to 1 second, you could use code like:\n\n```javascript\nconst { buildAxiosFetch } = require(\"@lifeomic/axios-fetch\");\nconst fetch = buildAxiosFetch(yourAxiosInstance, function (config) {\n  config.timeout = 1000;\n  return config;\n});\n```\n\n## Support for IE11\n\nTo Support IE11 add following dependencies\n\n```\n npm install --save isomorphic-fetch\n npm install --save es6-promise\n```\n\nAfter adding these dependencies import in index.jsx file at top (Need to import before React)\n\n```javascript\nimport * as es6Promise from 'es6-promise';\nimport 'isomorphic-fetch';\n\nes6Promise.polyfill(); // below all import end\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeomic%2Faxios-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifeomic%2Faxios-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeomic%2Faxios-fetch/lists"}