Library assembly
Adapter design. This page specifies the unpublished adapter. Run a request with Octokit and Effect.
The package root assembles the public service from the supplied client. octokit/ preserves SDK method names, argument conventions and return shapes. effect/ controls execution, interruption, failures and resource lifetimes. The service exposes the capabilities its client provides.
A named REST call travels from the facade to the shared Effect operation constructor. When a fiber executes it, the closure merges call options and invokes the original bound Octokit method. The promise settles through the error boundary. Hooks and auth execute within Octokit’s normal request path. A Stream uses the same client under a stream-scoped lifetime.
| Public entry point | Construction and imports |
|---|---|
| Root | GitHub, fromOctokit, client layer, shared error types and the standard battery-included surface. Core-client wrapping only needs its structural capabilities. |
| App, OAuth and webhooks | Dedicated entry points for users who supply or construct those objects. Share the same client adapter, so event and installation clients retain their plugin types. |
| Middleware | Host-specific entry points for Node, Web and Lambda only where upstream supports each combination. A root import must work without loading server-only code. |
| Plugins and testing | Extension factories and test service construction. Avoid a required dependency on every optional Octokit package. |
The dependency direction is assembly → bindings → Effect helpers. Effect helpers accept typed thunks, iterator factories and registration/release functions. They never import the facade or enumerate endpoints. Public type signatures come from the installed capability’s declarations. Keep optional imports type-only or behind the matching entry point.
Leave applications in charge of running the outer Effect, loading credentials, choosing installations and authorizing business operations. A callback invoked by an external SDK is the one place a runtime bridge may be needed. See callbacks.