{"id":25716340,"url":"https://github.com/interledgerjs/ilp-fetch","last_synced_at":"2025-05-05T20:49:54.302Z","repository":{"id":72490477,"uuid":"120040910","full_name":"interledgerjs/ilp-fetch","owner":"interledgerjs","description":"Paid HTTP client using Interledger and node-fetch","archived":false,"fork":false,"pushed_at":"2018-12-03T22:28:01.000Z","size":64,"stargazers_count":2,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T23:31:35.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/interledgerjs.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":"2018-02-02T23:06:05.000Z","updated_at":"2023-09-01T02:39:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"39052c66-6286-46ed-b004-d7236f7c6e55","html_url":"https://github.com/interledgerjs/ilp-fetch","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interledgerjs","download_url":"https://codeload.github.com/interledgerjs/ilp-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252575820,"owners_count":21770632,"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":[],"created_at":"2025-02-25T14:53:05.167Z","updated_at":"2025-05-05T20:49:54.298Z","avatar_url":"https://github.com/interledgerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ILP Fetch\n\u003e Simple paid HTTP request library for Interledger. Based on [node-fetch](https://www.npmjs.com/package/node-fetch).\n\n- [Usage](#usage)\n  - [Example](#example)\n- [Test](#test)\n- [Browser Support](#in-the-browser)\n\n## Usage\n\nThe ILP Fetch API supports all the options that are present in the [node-fetch\nAPI](https://github.com/bitinn/node-fetch#api).\n\nTwo additional fields are added:\n\n- `plugin`: The ILP plugin used to make payments.\n- `maxPrice`: The maximum, in the plugin's base units, which ILP fetch will send.\n\n### Example\n\nThe below example will upload a file containing `hello world` to Unhash\n(content-addressed storage on top of ILP).\n\n```js\nconst plugin = require('ilp-plugin')()\nconst fetch = require('.')\n\nfetch('https://alpha.unhash.io', {\n  plugin,\n  maxPrice: 100,\n  method: 'POST',\n  body: 'hello world'\n})\n  .then(r =\u003e r.json())\n  .then(json =\u003e {\n    console.log('json response:', json)\n    process.exit(0)\n  })\n  .catch(e =\u003e {\n    console.error(e)\n    process.exit(1)\n  })\n```\n\n## Test\n\nFirst run [Moneyd](https://github.com/interledgerjs/moneyd) on your machine. Then:\n\n```\ngit clone https://github.com/interledgerjs/ilp-fetch.git\ncd ilp-fetch\nnpm install\nDEBUG=* node test.js\n```\n\n## In the Browser\n\nBecause ILP fetch is based around Fetch, it is possible for it to run in the\nbrowser. Because of the restricted use of headers and cross-origin requests\n(and because it is not possible to access moneyd from within a webpage), it may\nnot be useful in an ordinary webpage.\n\nHowever, in the evironment of an extension it can be useful to make\npayment-enabled requests. Additionally, an extension should have no problems\nmaking cross-origin requests or accessing moneyd.\n\nJust add the following block to your webpack config:\n\n```\n  externals: {\n    'node-fetch': 'fetch'\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledgerjs%2Filp-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterledgerjs%2Filp-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledgerjs%2Filp-fetch/lists"}