Skip to content
← Public packages

@kody/github

Call GitHub REST, GraphQL, and pull requests with a GitHub OAuth App or a personal access token.

src/accounts.ts

32 lines · 868 B · TypeScript
export type {
  GitHubAuthInput,
  GitHubAuthLaneInfo,
  GitHubAuthMode,
  GitHubResolvedAuth,
} from "./types"
export {
  DEFAULT_GITHUB_INTEGRATION_NAME,
  DEFAULT_GITHUB_SECRET_NAME,
  GITHUB_BYO_OAUTH_CONNECT_URL,
  GITHUB_OAUTH_CONNECT_URL,
  GITHUB_PAT_SETUP_URL,
  accounts,
  resolveGithubAuth,
} from "./core"
import { accounts } from "./core"

/**
 * List GitHub auth lanes (OAuth vs PAT) and selection guidance.
 *
 * Multi-account: connect extra GitHub identities under distinct integration
 * names and pass `integrationName` on each call. There are no hard-coded
 * personal aliases.
 *
 * @example
 * import listGithubAccounts from 'kody:@kody/github/accounts'
 * const lanes = listGithubAccounts()
 * // => [{ lane: 'oauth', integrationName: 'github', default: true, ... }, ...]
 */
export default function listGithubAccounts() {
  return accounts()
}