Introduction
Devtrackr is a comprehensive, type-safe SDK for fetching normalized GitHub data. It simplifies the complexity of the GitHub API into easy-to-use methods for modern web applications.
Installation
npm install devtrackr
Requirements: Node.js >= 18.0.0
Authentication
To use Devtrackr, you need a GitHub Personal Access Token (PAT).
- Go to GitHub Settings > Developer Settings > Personal Access Tokens.
- Generate a new token (classic).
- Select the
public_reposcope (orrepofor private repositories). - Copy the token and store it in your environment variables.
.env.local
GITHUB_TOKEN=ghp_xxxxxxxxxxxxQuick Start
index.ts
import { createDevTrackr } from 'devtrackr'; // Initialize the client const client = createDevTrackr({ token: process.env.GITHUB_TOKEN }); async function main() { const profile = await client.getProfile('raghaverma'); console.log(profile.name); }
API Reference
createDevTrackr(config)
Creates a new instance of the DevTrackr client.
config: { token?: string, baseUrl?: string }
getProfile(username)
Fetches detailed profile information for a user.
username: string
Returns: Promise<Profile>