Azure DevOps Extension API provides REST client libraries and TypeScript contracts for building Azure DevOps web extensions. It ships auto-generated, thin clients for each API area (Git, Build, WorkItemTracking, etc.) with subpath imports enabling tree-shaking. Current stable version is 5.272.3, released in a dual CJS/ESM module format (since v5). AMD format was removed in v5; consumers relying on AMD should pin to v4. Peer dependency on azure-devops-extension-sdk (^2 || ^3 || ^4) is required for authentication and host interaction. Releases follow Azure DevOps API updates, with frequent minor version bumps. Key differentiator: official Microsoft-authored library, closely mirrors Azure DevOps REST API, and provides TypeScript types for all endpoints.
npm install azure-devops-extension-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes the Azure DevOps SDK, creates a Git REST client, and fetches repositories for a project.
Pin to azure-devops-extension-api@4 or migrate to CommonJS/ESM
If using webpack < 5, ensure resolve.conditionNames includes 'require' or 'import'
Use subpath imports like 'azure-devops-extension-api/Git' to enable tree-shaking
Call SDK.init() and SDK.ready() before getClient()
Update tsconfig.json: set 'moduleResolution' to 'node16' or 'bundler' (or use 'esModuleInterop')
Ensure SDK.init() is called first and SDK.ready() promise is awaited before calling getClient()
Use dynamic import() in CJS, or upgrade to Node 12+ with 'type':'module'