Provides authentication utilities for OpenCode Copilot, an AI-powered code assistant. Version 0.0.12 is the latest. The package handles JWT token management and GitHub App authentication flows. It is designed for Node.js environments and supports both CommonJS and ESM. It simplifies the process of obtaining and validating access tokens for Copilot services.
npm install opencode-copilot-authVerified import paths — ran on the pinned version, not inferred.
Initializes an AuthClient with environment variables and retrieves a token for a GitHub App installation.
Ensure Node version is >=14.
Use `process.env.PRIVATE_KEY.replace(/\\n/g, '\n')` or store as base64.
Use `getToken({ installationId, client })` instead.Ensure private key is a valid RSA private key in PEM format with proper \n characters.
Use `new AuthClient(opts)` and pass it as `client` parameter to `getToken`.
Check that `getToken` returned a valid token and that it is passed correctly.
No dependency data recorded yet.