Skip to content
repo-sdk
Esc
navigateopen⌘Jpreview
Zero dependencies · Edge-compatible

repo-sdk

One unified, normalized TypeScript API over GitHub, GitLab, Bitbucket Cloud, and Azure DevOps. Write your discovery, commit, tag, download, and webhook logic once — not four times.

$ npm install repo-sdk

Supported providers

GitHubGitLabBitbucket CloudAzure DevOps

One unified API

Discovery, commits, tags, downloads, and webhooks over four providers — one interface.

Zero dependencies

Just fetch and Web Crypto. Nothing to audit, nothing to bloat your bundle.

Edge-compatible

Runs on Node.js ≥ 20, Cloudflare Workers, and any Web-standard runtime.

Normalized types

Namespace, Repository, Commit, Tag, Webhook — with a raw escape hatch on every object.

Typed errors

Every failure is a RepoError with a stable code union, retry hints, and redacted secrets.

Webhook verify & parse

Standalone helpers that take a Web-standard Request — no client needed.

Capability gating

Providers differ. Unsupported options throw instead of being silently dropped.

In-memory testing provider

Exercise your integration end to end without hitting a real provider.

Swap the provider, keep your code

One client, one shape. Switching providers means swapping the provider argument.

import { createClient } from 'repo-sdk';
import { github } from 'repo-sdk/github';

const client = createClient({
  provider: github({ auth: { token: process.env.GITHUB_TOKEN! } }),
});

// Resolve a ref (branch, tag, or SHA) to a single commit.
const head = await client.commits.get({
  repo: 'capawesome-team/repo-sdk',
  ref: 'main',
});
console.log(head.sha, head.message);