
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@vscode/copilot-api
Advanced tools
A module used for interacting with the GitHub Copilot API.
With npm:
npm install @vscode/copilot-api
With yarn:
yarn add @vscode/copilot-api
import { CAPIClient, RequestType } from '@vscode/copilot-api';
// Create a new client instance
const client = new CAPIClient(editorDetails, license, optionalFetcherService);
// Update domains (if needed)
const domainChanges = client.updateDomains(copilotToken, enterpriseUrlConfig);
// Make requests
const response = await client.makeRequest(fetchOptions, RequestType.ChatCompletions);
RequestType.CopilotToken - Get Copilot tokenRequestType.ChatCompletions - Chat completionsRequestType.RemoteAgent - Remote agent requestsRequestType.Embeddings - EmbeddingsRequestType.Models - Available modelsRequestType.Chunks - Code chunksRequestType.EmbeddingsCodeSearch - Embeddings code searchRequestType.ListSkills - List available skillsRequestType.SearchSkill - Search skillsRequestType.ContentExclusion - Content exclusionRequestType.Telemetry - TelemetryRequestType.CopilotUserInfo - User infoRequestType.OriginTracker - Origin trackingThe package is built using esbuild to create a single platform-neutral ESM module that works in both Node.js and web environments:
# Build for production (minified)
npm run build
# Build for development (unminified)
npm run build:dev
# Clean build artifacts
npm run clean
dist/index.js - Platform-neutral ESM builddist/index.d.ts - TypeScript declarationsThe package is configured with a simplified ESM export structure:
{
"exports": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
}
This project uses Vitest for testing. Run tests with:
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
FAQs
A module used for interacting with the GitHub Copilot API.
The npm package @vscode/copilot-api receives a total of 169,409 weekly downloads. As such, @vscode/copilot-api popularity was classified as popular.
We found that @vscode/copilot-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.