https://github.com/ultirequiem/use-github
:shipit: React hooks for the GitHub API
https://github.com/ultirequiem/use-github
github react react-hooks
Last synced: 9 months ago
JSON representation
:shipit: React hooks for the GitHub API
- Host: GitHub
- URL: https://github.com/ultirequiem/use-github
- Owner: UltiRequiem
- License: mit
- Created: 2022-03-01T16:55:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T22:40:16.000Z (over 2 years ago)
- Last Synced: 2025-05-09T01:18:06.222Z (9 months ago)
- Topics: github, react, react-hooks
- Language: TypeScript
- Homepage: https://use-github.js.org
- Size: 193 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# `use-github`
### [View Demo](https://codesandbox.io/s/use-github-example-2231zu)
React Hooks for the [GitHub Rest API](https://docs.github.com/en/rest) 😎
It returns an [`SWRHook`](https://swr.vercel.app), but if you don't know what that means, here's an example 👇
```tsx
import { useGitHubUser } from "use-github";
export const UserCard = (username: string) => {
const { data: userData } = useGitHubUser(username);
return <>...>;
};
```
## Installation ∙ [](https://www.npmjs.com/package/use-github)
```console
# npm
npm install use-github
# yarn
yarn add use-github
# pnpm
pnpm add use-github
```
## TODO
Currently this package only exposes `useGitHubUser` and `useGitHubPinnedRepos`, there are a lot more endpoints to cover!
Pull Request and Issues are more than welcome!
## Docs
- For examples you can check [`examples/`](./examples) 📂
- API Docs â–¶ https://use-github.js.org
## Notes
Originally Done for my website 👇
https://ultirequiem.com
[Join my Discord Server!](https://ultirequiem.com/discord)
## License
Licensed under the MIT License.