Skip to content
repo-sdk
Esc
navigateopen⌘Jpreview
On this page

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-sdk
pnpm add repo-sdk
yarn add repo-sdk
bun add repo-sdk

Requirements

repo-sdk ships as ESM only and depends on nothing but the platform’s fetch and Web Crypto APIs.

PropType
Node?string

Also runs on Cloudflare Workers and other Web-standard runtimes.

Typestring
Default>= 20
Module?string

Package "type": "module". No CommonJS build.

Typestring
DefaultESM
Dependencies?string

Zero runtime dependencies.

Typestring
Default0

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

Was this page helpful?