{"id":15489584,"url":"https://github.com/pablopunk/auth-fetch","last_synced_at":"2025-08-01T04:43:10.678Z","repository":{"id":57187021,"uuid":"338376130","full_name":"pablopunk/auth-fetch","owner":"pablopunk","description":"Fetch JSON with a Bearer token","archived":false,"fork":false,"pushed_at":"2021-02-12T16:47:37.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T08:59:34.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/pablopunk.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}},"created_at":"2021-02-12T16:45:28.000Z","updated_at":"2025-02-22T08:22:34.000Z","dependencies_parsed_at":"2022-09-14T16:50:59.615Z","dependency_job_id":null,"html_url":"https://github.com/pablopunk/auth-fetch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pablopunk/auth-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fauth-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fauth-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fauth-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fauth-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pablopunk","download_url":"https://codeload.github.com/pablopunk/auth-fetch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fauth-fetch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268024961,"owners_count":24183154,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-02T07:06:32.852Z","updated_at":"2025-08-01T04:43:10.602Z","avatar_url":"https://github.com/pablopunk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auth-fetch\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/pablopunk/miny\"\u003e\u003cimg src=\"https://img.shields.io/badge/made_with-miny-1eced8.svg\" /\u003e \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/auth-fetch\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/auth-fetch.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eFetch JSON with a Bearer token\u003c/i\u003e\n\u003c/p\u003e\n\n\n## Install\n\n```sh\nnpm install auth-fetch\n```\n\n## Usage\n\nWhen you create an instance, you can use every http method and it will automatically fill\nthe API url and the Bearer token. Also, it will request the data as `application/json`,\nand it will unwrap the json result for you (equivalent to `fetch(url).then(r =\u003e r.json())`)\n\n```js\nimport AuthFetch from 'auth-fetch'\n\nconst fetch = new AuthFetch('/api/users', 'secret-token')\n\nawait fetch.get().then(users =\u003e console.log(users))\nawait fetch.put({id: 2, name: 'pablo'})\nawait fetch.put({id: 2, name: 'pablo varela'})\nawait fetch.delete({id: 2})\n```\n\n\n## License\n\nMIT\n\n\n## Author\n\n| ![me](https://gravatar.com/avatar/522e6a2f38c7cb6842edc552800034d6?size=100)           |\n| --------------------------------- |\n| [Pablo Varela](https://pablopunk.com)   |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablopunk%2Fauth-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpablopunk%2Fauth-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablopunk%2Fauth-fetch/lists"}