{"id":16295449,"url":"https://github.com/bamacharanchhandogi/use-react-gfg","last_synced_at":"2026-01-19T13:32:39.147Z","repository":{"id":228946047,"uuid":"775327014","full_name":"BamaCharanChhandogi/use-react-gfg","owner":"BamaCharanChhandogi","description":"A tiny fully customizable react hook which gives you full profile details of Geeks for Geeks coder.","archived":false,"fork":false,"pushed_at":"2024-08-15T17:54:37.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-26T01:44:06.931Z","etag":null,"topics":["gfg-data","gfg-profile-data","package","react-custom-hook","react-hooks","react-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/use-react-gfg","language":"JavaScript","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/BamaCharanChhandogi.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":"2024-03-21T07:17:23.000Z","updated_at":"2024-08-15T17:54:40.000Z","dependencies_parsed_at":"2024-03-21T09:44:24.913Z","dependency_job_id":"22cd3b0d-7dde-4bc6-9917-365a61b80215","html_url":"https://github.com/BamaCharanChhandogi/use-react-gfg","commit_stats":null,"previous_names":["bamacharanchhandogi/use-react-gfg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BamaCharanChhandogi/use-react-gfg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BamaCharanChhandogi%2Fuse-react-gfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BamaCharanChhandogi%2Fuse-react-gfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BamaCharanChhandogi%2Fuse-react-gfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BamaCharanChhandogi%2Fuse-react-gfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BamaCharanChhandogi","download_url":"https://codeload.github.com/BamaCharanChhandogi/use-react-gfg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BamaCharanChhandogi%2Fuse-react-gfg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28569220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"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":["gfg-data","gfg-profile-data","package","react-custom-hook","react-hooks","react-package"],"created_at":"2024-10-10T20:18:48.251Z","updated_at":"2026-01-19T13:32:39.132Z","avatar_url":"https://github.com/BamaCharanChhandogi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-react-GFG\n\nuse-react-gfg is a lightweight and customizable React hook that fetches and displays a complete profile of any Geeks for Geeks user. This hook makes it easy to integrate GFG profile data into your React applications, offering a straightforward way to access and display coding statistics and achievements\n\n[![NPM](https://img.shields.io/npm/v/use-react-gfg.svg)](https://www.npmjs.com/package/use-react-gfg) \n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Downloads](https://img.shields.io/npm/dm/use-react-gfg.svg)](https://www.npmjs.com/package/use-react-gfg)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bamaCharanChhandogi/use-react-gfg/blob/main/LICENSE)\n\n## Features\n- **Full Profile Data Fetching:** Retrieve detailed profile information including user stats, coding score, solved problem counts, and more.\n\n- **Customizable UI:** The hook allows easy integration into your existing React components with full control over the display of profile data.\n\n- **Error Handling:** Built-in error handling to manage issues with fetching data from the GFG API.\n\n- **Lightweight:** Minimal dependencies ensure quick and easy installation with minimal impact on your app’s performance\n\n## Detailed Blog Posts\n\n- [Introducing React-GFG: Fetch Your Geek for Geeks Profile Details with Ease](https://bamacharan.hashnode.dev/introducing-react-gfg-fetch-your-geek-for-geeks-profile-details-with-ease)\n- [Dev.to: Introducing React-GFG](https://dev.to/bamacharan/introducing-react-gfg-fetch-your-geek-for-geeks-profile-details-with-ease-3ajc)\n\n## Installation\n\n- npm\n\n```bash\nnpm install use-react-gfg\n```\n\n- yarn\n\n```bash\nyarn add use-react-gfg\n```\n\n## Usage\n\nHere's a simple example of how to use the useGFG hook:\n\n```jsx\nimport React, { useEffect } from \"react\";\nimport {useGFG} from \"use-react-gfg\";\n\nfunction ProfileInterface() {\n  const { profile, loading, error } = useGFG(\"bamacharan\");\n\n  useEffect(() =\u003e {\n    console.log(\"Profile Data:\", profile);\n  }, [profile]);\n\n  if (loading) {\n    return \u003cdiv\u003eLoading...\u003c/div\u003e;\n  }\n\n  if (error) {\n    return \u003cdiv\u003e{error}\u003c/div\u003e;\n  }\n\n  if (!profile || !profile.info) {\n    return \u003cdiv\u003eError: Profile data not found.\u003c/div\u003e;\n  }\n\n  const { info, solvedStats } = profile;\n\n  return (\n    \u003cdiv className=\"profile\"\u003e\n      \u003cdiv className=\"basic-info\"\u003e\n        \u003ch1\u003e{info.userName}'s Profile\u003c/h1\u003e\n        {info.profilePicture \u0026\u0026 (\n          \u003cimg src={info.profilePicture} alt=\"Profile Picture\" /\u003e\n        )}\n        \u003cp\u003eInstitute Rank: {info.instituteRank}\u003c/p\u003e\n        \u003cp\u003eCurrent Streak: {info.currentStreak}\u003c/p\u003e\n        \u003cp\u003eMax Streak: {info.maxStreak}\u003c/p\u003e\n        \u003cp\u003eLanguages Used: {info.languagesUsed}\u003c/p\u003e\n      \u003c/div\u003e\n\n      \u003cdiv className=\"solved-stats\"\u003e\n        \u003ch2\u003eSolved Stats\u003c/h2\u003e\n        \u003cul\u003e\n          {Object.entries(solvedStats).map(([difficulty, stats]) =\u003e (\n            \u003cli key={difficulty}\u003e\n              \u003ch3\u003e{difficulty}\u003c/h3\u003e\n              \u003cp\u003eCount: {stats.count}\u003c/p\u003e\n              {/* You can render individual questions here if needed */}\n            \u003c/li\u003e\n          ))}\n        \u003c/ul\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default ProfileInterface;\n```\n\n## API\n### Hook: useGFG\n```javascript\nconst { profile, loading, error } = useGFG(username: string);\n```\n### Parameters:\n- `username (string):` The GeeksforGeeks username to fetch profile data for.\n\n### Returns:\n\n- `profile (object):` The user's profile data (see Profile Interface below).\n- `loading (boolean):` Indicates if the data is being fetched.\n- `error (string | null):` Contains an error message if the fetch fails, otherwise null.\n\n\n## Profile interface\n\n```javascript\n\ninterface Profile {\n  info: {\n    userName: string;\n    profilePicture: string;\n    instituteRank: string;\n    currentStreak: string;\n    maxStreak: string;\n    institution: string;\n    languagesUsed: string;\n    codingScore: string;\n    totalProblemsSolved: string;\n    monthlyCodingScore: string;\n    articlesPublished: string;\n  };\n  solvedStats: {\n    [key: string]: {\n      count: number;\n      questions: Array\u003c{\n        question: string;\n        questionUrl: string;\n      }\u003e;\n    };\n  };\n}\n\n```\n\n## Contributions\nContributions are welcome! If you have suggestions or encounter any issues, please feel free to [open an issue](https://github.com/BamaCharanChhandogi/use-react-gfg) or submit a pull request.\n\n## Authors\n- [Bama Charan Chhandogi](https://linktr.ee/bamacharan)\n\n## License\n\nMIT © [Bama](LICENSE)\n\u003chr\u003e\nIf you find this package helpful, please consider giving it a star on GitHub! ⭐\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamacharanchhandogi%2Fuse-react-gfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbamacharanchhandogi%2Fuse-react-gfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamacharanchhandogi%2Fuse-react-gfg/lists"}