Get Github Token
[MODE:SIDEEFFECTS] Tier: other. Idempotent within the returned refresh lease.
Returns the server-provided GitHub credential for <owner>/<repo> through GET /api/github_token?repo=<owner/repo>. Enterprise resolves the current Player's matching GitHub App installation and returns a short-lived installation token. Standalone Core returns its single configured GITHUB_TOKEN.
When to use
- Need to clone or push a repository using the credential selected by the connected Fibe server.
- Issuing a one-off
git pushoutside of the SDK's flow. - GitHub API access permitted by the returned credential.
When NOT to use
- You need a specific credential kind. Enterprise returns an App token; Core returns its configured stable token.
- Pure Fibe API access — that's
FIBE_API_KEY, not a GitHub token.
Inputs
| Field | Type | Required | Notes |
|---|---|---|---|
repo | string | yes | Full repo name owner/name |
Output
{
"token": "...",
"expires_in": 3000
}
Behavior
- Validates the
owner/repositoryinput. - Enterprise looks up the current Player's matching GitHub App installation and mints or reuses its short-lived token.
- Standalone Core returns its configured process credential without contacting GitHub.
expires_inis a client refresh lease; repeated requests may return the same token.
Gotchas
- Re-fetch before
expires_in; do not infer the underlying token's expiry from this lease. - Enterprise installation tokens have App-defined permissions and are not the Player's OAuth token.
- Core has no installation or player scope. Any holder of its administrative
FIBE_API_KEYcan retrieve the host-wide token, and rotation requires replacing the Core container with updated ENV. - Enterprise can return
GITHUB_INSTALLATION_NOT_FOUNDorGITHUB_TOKEN_ERROR. Core returnsGITHUB_TOKEN_NOT_CONFIGUREDwhen its ENV credential is blank.
Related
fibe_find_github_repos— Enterprise repository discovery; unsupported in standalone Core.fibe_repo_status_check— verify access without minting a token.fibe_github_repos_create— create new repo (OAuth path, different mechanism).