{"id":20519438,"url":"https://github.com/atomic-state/http-react","last_synced_at":"2026-02-18T01:51:01.878Z","repository":{"id":37990076,"uuid":"395506258","full_name":"atomic-state/http-react","owner":"atomic-state","description":"React hooks for data fetching","archived":false,"fork":false,"pushed_at":"2025-11-09T08:22:17.000Z","size":782,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-09T10:18:18.936Z","etag":null,"topics":["axios","deduplication","fetch","fetch-api","gql","graphql","hook","hooks","http","javascript","react","react-hooks","requests","server","server-actions","ssr","suspense","swr"],"latest_commit_sha":null,"homepage":"https://httpr.vercel.app/","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/atomic-state.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-08-13T03:10:00.000Z","updated_at":"2025-11-09T08:22:21.000Z","dependencies_parsed_at":"2023-12-20T17:44:35.665Z","dependency_job_id":"71d7ac4f-a2fa-4ed6-8356-f960e2053044","html_url":"https://github.com/atomic-state/http-react","commit_stats":null,"previous_names":["atomic-state/http-react-fetcher"],"tags_count":162,"template":false,"template_full_name":null,"purl":"pkg:github/atomic-state/http-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Fhttp-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Fhttp-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Fhttp-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Fhttp-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomic-state","download_url":"https://codeload.github.com/atomic-state/http-react/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Fhttp-react/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29566366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"ssl_error","status_checked_at":"2026-02-18T00:45:26.718Z","response_time":100,"last_error":"SSL_read: 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":["axios","deduplication","fetch","fetch-api","gql","graphql","hook","hooks","http","javascript","react","react-hooks","requests","server","server-actions","ssr","suspense","swr"],"created_at":"2024-11-15T22:13:42.123Z","updated_at":"2026-02-18T01:51:01.872Z","avatar_url":"https://github.com/atomic-state.png","language":"TypeScript","readme":"### HTTP React\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/http-react\" target=\"_blank\"\u003e\u003cimg src=\"https://badge.fury.io/js/http-react.svg\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" /\u003e\n\u003cimg src=\"https://github.com/atomic-state/http-react/actions/workflows/test.yml/badge.svg?event=push\" /\u003e\n\u003c/p\u003e\n\nHttp React is a React hooks library for data fetching. It's built on top of the native `Fetch` API.\n\n### Overview\n\nWith one hook call, you get all the information about a request that you can use to build UIs that are consistent and performant:\n\n```jsx\nimport useFetch from 'http-react'\n\n// This is the default fetcher.\nconst fetcher = (url, config) =\u003e fetch(url, config)\n\nexport default function App() {\n  const { data, loading, error, responseTime } = useFetch('/api/user-info', {\n    refresh: '30 sec',\n    fetcher\n  })\n\n  if (loading) return \u003cp\u003eLoading\u003c/p\u003e\n\n  if (error) return \u003cp\u003eAn error ocurred\u003c/p\u003e\n\n  return (\n    \u003cdiv\u003e\n      \u003ch2\u003eWelcome, {data.name}\u003c/h2\u003e\n      \u003csmall\u003eProfile loaded in {responseTime} miliseconds\u003c/small\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\nIt also works with Next.js' server functions:\n\n```tsx\n// actions.ts\n'use server'\n\nimport { actionData } from 'http-react'\n\nexport async function getData({ id }: { id: number }) {\n  return actionData({\n    foo: 'bar'\n  })\n}\n```\n\n```tsx\n// page.tsx\n'use client'\nimport { useAction } from 'http-react'\n\nimport { getData } from '@/actions'\n\nexport default function Page() {\n  // data has static typing inferred from the action result\n  const { data, isPending, error } = useAction(getData, {\n    params: {\n      id: 1 // This will show an error if id is not a number\n    }\n  })\n\n  return isPending ? (\n    \u003cp\u003eLoading...\u003c/p\u003e\n  ) : error ? (\n    \u003cp\u003eSomething went wrong\u003c/p\u003e\n  ) : (\n    \u003cdiv\u003e\n      \u003ch2\u003eWelcome\u003c/h2\u003e\n      \u003cp\u003e{data.foo}\u003c/p\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\nIt supports many features that are necessary in modern applications, while giving developers full control over the request configuration:\n\n- Server-Side Rendering\n- Server actions\n- React Native\n- Request deduplication\n- Suspense\n- Refresh\n- Retry on error\n- Pagination\n- Local mutation (Optimistic UI)\n- qraphql\n\nand [more](https://httpr.vercel.app/docs/api)!\n\n#### Installation:\n\n```bash\nnpm install --save http-react\n```\n\nOr\n\n```bash\nyarn add http-react\n```\n\n[Getting started](https://httpr.vercel.app/docs)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomic-state%2Fhttp-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomic-state%2Fhttp-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomic-state%2Fhttp-react/lists"}