
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
use-github-react
Advanced tools
useGitHub
is a custom React hook that provides an easy way to fetch and manage GitHub user data and repositories in your React applications.
npm install use-github-react axios
import { useGitHub } from 'use-github-react/dist/use-github';
const MyComponent = () => {
const { userInfo, metadata, getRepositories } = useGitHub({
username: 'your-github-username',
personalAccessToken: 'your-github-personal-access-token',
});
// Use the hook's returned data and functions
// ...
};
username
: GitHub usernamepersonalAccessToken
: GitHub personal access token (required for fetching pinned repositories)userInfo
: Object containing user informationmetadata
: Object containing API response metadatagetRepositories
: Function to access and filter repositoriesgetRepositories()
Returns an object with the following methods:
all()
: Returns all repositorieswithLanguage(languages)
: Filters repositories by programming language(s)top(n)
: Returns top N repositoriespinned()
: Returns pinned repositoriesimport { useGitHub } from 'use-github-react/dist/use-github';
const MyGitHubComponent = () => {
const { userInfo, getRepositories } = useGitHub({
username: 'octocat',
personalAccessToken: 'your-token-here',
});
console.log(userInfo);
console.log(getRepositories().all());
console.log(getRepositories().withLanguage(['javascript', 'typescript']));
console.log(getRepositories().top(5));
console.log(getRepositories().pinned());
// Render your component using the data...
};
This hook requires the axios
library. Make sure to install both use-github-react
and axios
before using the hook.
FAQs
React hook for fetching activities and information via GitHub API
We found that use-github-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.