GitHub stats in a bento grid for React applications
npm install github-bento-statssh
npm i github-bento-stats
`
Usage
`tsx
'use client';
import { GitHubBento } from 'github-bento-stats';
const Page = () => {
const gitToken = process.env.NEXT_PUBLIC_GITHUB_TOKEN;
if (!gitToken) {
console.log("GitHub Token is not found");
return null;
}
return (
username='idityaGE'
githubToken={gitToken}
showGraph
/>
);
};
export default Page;
`
Props
| Prop | Type | Description |
|-------------|---------|--------------------------------|
| username | string | GitHub username. |
| githubToken | string | GitHub personal access token (PAT). |
| showGraph | boolean | Show contribution graph (optional). |
Environment Variables
Make sure to set up your GitHub token as an environment variable:
`sh
NEXT_PUBLIC_GITHUB_TOKEN=your_github_token
``