Socket
Book a DemoInstallSign in
Socket

@vscode/copilot-api

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vscode/copilot-api

A module used for interacting with the GitHub Copilot API.

0.1.4
latest
Source
npmnpm
Version published
Weekly downloads
46K
-7.93%
Maintainers
2
Weekly downloads
 
Created
Source

@vscode/copilot-api

A module used for interacting with the GitHub Copilot API.

Installation

With npm:

npm install @vscode/copilot-api

With yarn:

yarn add @vscode/copilot-api

Usage

Basic Setup

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);

Available Request Types

  • RequestType.CopilotToken - Get Copilot token
  • RequestType.ChatCompletions - Chat completions
  • RequestType.RemoteAgent - Remote agent requests
  • RequestType.Embeddings - Embeddings
  • RequestType.Models - Available models
  • RequestType.Chunks - Code chunks
  • RequestType.EmbeddingsCodeSearch - Embeddings code search
  • RequestType.ListSkills - List available skills
  • RequestType.SearchSkill - Search skills
  • RequestType.ContentExclusion - Content exclusion
  • RequestType.Telemetry - Telemetry
  • RequestType.CopilotUserInfo - User info
  • RequestType.OriginTracker - Origin tracking

Development

Building

The 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

Build Output

  • dist/index.js - Platform-neutral ESM build
  • dist/index.d.ts - TypeScript declarations

Package Exports

The package is configured with a simplified ESM export structure:

{
  "exports": {
    "import": "./dist/index.js",
    "types": "./dist/index.d.ts"
  }
}

Testing

This project uses Vitest for testing. Run tests with:

# Run tests once
npm test

# Run tests in watch mode
npm run test:watch

FAQs

Package last updated on 11 Aug 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.