GitHub 37
Skip to content
ViteHub is still experimental. Expect bugs and breaking changes.

Forge

Call GitHub as your GitHub App, or GitLab, Forgejo, and Gitea with a token. You write no JWT or token code.

.env
# Local development: the private PEM file must exist at runtime
VITEHUB_GITHUB_APP_ID=123456
VITEHUB_GITHUB_PRIVATE_KEY_PATH=./github-app.pem
.env

For production, provide credentials for your host.

Act as your GitHub App

useForge() signs the App JWT, finds the installation, and mints installation tokens.

A typed Forge client

provider() returns a forges client, including graphql() on GitHub.

GitHub, GitLab, Forgejo, and Gitea

Pass forge and the client type follows it.

One set of env names

Routes, the GitHub Channel, and Agents share the same VITEHUB_GITHUB_* variables.

Repository tools for Agents

The forge() Capability and the GitLab and Forgejo Channels use the same Forge.

Errors without try/catch

Each call returns [error, data]. Configuration that cannot work throws at the first call.