Installation
Install repo-sdk, check runtime requirements, and learn the ESM subpath exports.
Install repo-sdk from npm with your package manager of choice.
npm install repo-sdkpnpm add repo-sdkyarn add repo-sdkbun add repo-sdkRequirements
repo-sdk ships as ESM only and depends on nothing but the platform’s fetch and Web Crypto APIs.
Node?string
Also runs on Cloudflare Workers and other Web-standard runtimes.
string>= 20Module?string
Package "type": "module". No CommonJS build.
stringESMDependencies?string
Zero runtime dependencies.
string0Subpath exports
The client lives at the package root; each provider factory lives on its own subpath so you only pull in
the provider you use. Each provider subpath also exports the webhook helpers (verifyWebhook,
parseWebhookEvent) and a commitWebUrl helper for provider-specific commit URLs.
| Import | Exports |
|---|---|
repo-sdk |
createClient, RepoError, detectWebhookProvider, and all normalized types |
repo-sdk/github |
github, verifyWebhook, parseWebhookEvent, commitWebUrl |
repo-sdk/gitlab |
gitlab, verifyWebhook, parseWebhookEvent, commitWebUrl |
repo-sdk/bitbucket |
bitbucket, verifyWebhook, parseWebhookEvent, commitWebUrl |
repo-sdk/azure-devops |
azureDevOps, listOrganizations, verifyWebhook, parseWebhookEvent, commitWebUrl |
repo-sdk/gitea |
gitea, verifyWebhook, parseWebhookEvent, commitWebUrl |
repo-sdk/testing |
createInMemoryProvider |
Import the client and a provider
import { createClient } from 'repo-sdk';
import { github } from 'repo-sdk/github';
const client = createClient({
provider: github({ auth: { token: process.env.GITHUB_TOKEN! } }),
});
Continue to the Quickstart
Create a client, list commits, resolve a ref, and receive a webhook.