@kevinmichaelchen/distilled-github
v0.3.0
Published
Protocol-based Effect 4 SDK for the GitHub REST API
Readme
distilled-github
An Effect-native GitHub REST API SDK generated from GitHub's official versioned OpenAPI description.
Operations are grouped into service modules. Runtime schemas, protocol traits,
typed errors, and retry support come from @kevinmichaelchen/distilled;
GitHub authentication and HTTP behavior are defined by this package.
Set GITHUB_TOKEN. GITHUB_API_URL and GITHUB_API_VERSION are optional.
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
import {
CredentialsFromEnv,
Services,
} from "@kevinmichaelchen/distilled-github";
const GitHubLive = Layer.mergeAll(FetchHttpClient.layer, CredentialsFromEnv);
const repository = await Effect.runPromise(
Services.repos.reposGet({ owner: "octocat", repo: "Hello-World" }).pipe(
Effect.provide(GitHubLive),
),
);Run bun run generate after updating the pinned specification. Generated
service modules under src/services must not be edited by hand.
