
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@dependabit/github-client
Advanced tools
Comprehensive GitHub API wrapper with authentication, rate limiting, and false positive tracking.
This package provides a robust wrapper around the GitHub API with built-in rate limiting, multiple authentication strategies, and specialized features for dependency tracking workflows.
pnpm add @dependabit/github-client
import { createGitHubClient } from '@dependabit/github-client';
const client = createGitHubClient({
auth: process.env.GITHUB_TOKEN,
rateLimitWarningThreshold: 100,
rateLimitMinRemaining: 10
});
// Use with rate limit checking
await client.withRateLimit(async () => {
// Your API calls here
});
import { TokenAuthHandler } from '@dependabit/github-client';
const tokenAuth = new TokenAuthHandler('ghp_yourtoken');
const auth = await tokenAuth.authenticate();
// { type: 'token', token: 'ghp_yourtoken' }
import { OAuthHandler } from '@dependabit/github-client';
const oauth = new OAuthHandler({
clientId: 'your_client_id',
clientSecret: 'your_secret',
redirectUri: 'http://localhost:3000/callback'
});
// Get authorization URL
const authUrl = oauth.getAuthorizationUrl(['repo', 'user']);
// Exchange code for token
const auth = await oauth.authenticate(authorizationCode);
import { BasicAuthHandler } from '@dependabit/github-client';
const basicAuth = new BasicAuthHandler('username', 'password');
const auth = await basicAuth.authenticate();
import { RateLimitHandler } from '@dependabit/github-client';
const rateLimit = new RateLimitHandler(token);
// Check current rate limit
const info = await rateLimit.checkRateLimit();
console.log(`${info.remaining}/${info.limit} requests remaining`);
// Reserve budget before operations
const reservation = await rateLimit.reserveBudget(50, {
safetyMargin: 10,
maxWaitTime: 60000
});
if (!reservation.reserved) {
console.log(`Cannot proceed: ${reservation.reason}`);
}
// Proactive checking
const canProceed = await rateLimit.canProceed(100, {
threshold: 50,
safetyMargin: 20
});
import { IssueManager } from '@dependabit/github-client';
const issues = new IssueManager(token);
// Create issue for dependency update
const issue = await issues.createIssue({
owner: 'user',
repo: 'project',
title: 'Update dependency X',
body: 'New version available',
severity: 'minor',
dependency: {
id: 'dep-123',
url: 'https://github.com/org/dep'
}
});
// Find existing issue
const existing = await issues.findExistingIssue({
owner: 'user',
repo: 'project',
dependencyId: 'dep-123'
});
// Update issue
await issues.updateIssue({
owner: 'user',
repo: 'project',
issueNumber: 42,
body: 'Updated information',
severity: 'major'
});
import { ReleaseManager } from '@dependabit/github-client';
const releases = new ReleaseManager(token);
// Get latest release
const latest = await releases.getLatestRelease('owner', 'repo');
// Get specific release
const release = await releases.getReleaseByTag('owner', 'repo', 'v1.0.0');
// Compare releases
const comparison = await releases.compareReleases(
'owner',
'repo',
'v1.0.0',
'v2.0.0'
);
console.log(`Breaking changes: ${comparison.hasBreakingChanges}`);
import { getCommitsSince } from '@dependabit/github-client';
const commits = await getCommitsSince({
owner: 'user',
repo: 'project',
since: new Date('2024-01-01'),
author: 'username'
});
import { FeedbackListener } from '@dependabit/github-client';
const feedback = new FeedbackListener(issueManager, {
truePositiveLabel: 'true-positive',
falsePositiveLabel: 'false-positive'
});
// Collect feedback from last 30 days
const data = await feedback.getRecentFeedback(30);
console.log(`False positives: ${data.falsePositives.length}`);
console.log(`True positives: ${data.truePositives.length}`);
// Calculate rate
const rate = await feedback.getFeedbackRate();
console.log(`FP rate: ${(rate.falsePositiveRate * 100).toFixed(1)}%`);
// Monitor specific issue
const hasFeedback = await feedback.monitorIssue(123);
createGitHubClient(config): Create client instancegetRateLimit(): Get current rate limit infocheckRateLimit(): Check and warn about rate limitswithRateLimit(fn): Execute function with rate limit checkingTokenAuthHandler: GitHub PAT authenticationOAuthHandler: OAuth 2.0 flowBasicAuthHandler: Basic HTTP authenticationAuthManager: Unified auth managementRateLimitHandler: Rate limit managementreserveBudget(calls, options): Reserve API call budgetcanProceed(calls, options): Check if operation can proceedgetRateLimitStatus(): Get detailed statuscreateIssue(data): Create new issuefindExistingIssue(params): Find existing issueupdateIssue(data): Update issuegetLatestRelease(owner, repo): Get latest releasegetReleaseByTag(owner, repo, tag): Get specific releasecompareReleases(owner, repo, from, to): Compare two releasesFeedbackListener: Monitor false positive feedbackcollectFeedback(options): Collect feedback datagetFeedbackRate(options): Calculate FP rategetRecentFeedback(days): Get recent feedback# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Type check
pnpm type-check
MIT
FAQs
GitHub API wrapper with rate limiting and authentication
The npm package @dependabit/github-client receives a total of 21 weekly downloads. As such, @dependabit/github-client popularity was classified as not popular.
We found that @dependabit/github-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.