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).

  1. Go to GitHub Settings > Developer Settings > Personal Access Tokens.
  2. Generate a new token (classic).
  3. Select the public_repo scope (or repo for private repositories).
  4. Copy the token and store it in your environment variables.
.env.local
GITHUB_TOKEN=ghp_xxxxxxxxxxxx

Quick 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>