SDK Documentation
The GitHub Contribution Staking SDK provides developers with programmatic access to contribution tracking, staking management, and NFT verification features through a simple JavaScript interface.
This SDK simplifies integration with the GitHub Contribution Staking platform, enabling developers to easily implement contribution verification, staking operations, and reward management within their applications. It supports both browser and Node.js environments.
Core Features
- Contribution Verification API
- Staking Management
- NFT Management Tools
- Authentication Helpers
Installation
CDN
<script src="https://contribution-staking.com/sdk.js"></script>
Getting Started
Basic Example
const client = new ContributionStakingClient({ apiKey: 'YOUR_API_KEY', githubToken: 'GITHUB_OAUTH_TOKEN' }); // Verify contribution const contribution = await client.contributions.verify('github_username', 'repo_name', 'commit_sha'); // Stake contribution const stake = await client.staking.initiate({ contributionId: contribution.id, lockPeriod: '90d' });
Verify Contribution
Authenticates GitHub commits, PRs, and issues as verifiable records
Stake Contributions
Lock verified contributions for reward generation across specified durations
Access NFTs
Generate and manage contribution NFT tokens via direct API calls
SDK Components
Contribution Manager
- verifyContributions()
- getContributionRecord()
Staking Manager
- initiateStake()
- calculateRewards()
- getStakeHistory()