Visual Studio Services Client SDK
Renamed
Our SDK is renamed from vss-sdk
to vss-web-extension-sdk
. Please use the new package name for npm and bower.
Overview
This repo contains core client SDK file and TypeScript declare files needed for developing Visual Studio Online Extensions.
VSS.SDK.js enables an extension to communicate to host to perform operations like initializing, notifying extension is loaded or getting context about the current page on the host.
Getting started
- Add this line:
<script src="sdk/scripts/VSS.SDK.js"></script>
- Using
npm install vss-web-extension-sdk
- Using
bower install vss-web-extension-sdk
Usage
Next step is initializing the extension using two options below:
-
Implicit handshake
VSS.init({
usePlatformScripts: true,
usePlatformStyles: true
});
VSS.ready(function() {
});
-
Explicit handshake
VSS.init({
explicitNotifyLoaded: true,
usePlatformScripts: true,
usePlatformStyles: true
});
doSomeAsyncStuff().then(
function(result) {
VSS.notifyLoadSucceeded();
},
function(error) {
VSS.notifyLoadFailed(error);
});
Full API reference of VSS.SDK.js can be found at Core Client SDK page.
Types
- Types of VSS.SDK.js, controls and client services are available in typings/vss.d.ts.
- REST Client types for VSTS are available in typings/tfs.d.ts
- REST Client and extensibility types for Release Management are available in typings/rmo.d.ts
Dependencies
Dependency graph for the types.

Using tsd
Although TypeScript declare files do not exist at DefinitelyTyped repo, they can still be used through tsd.
- First, make sure that the dependencies are loaded using below command:
tsd install jquery knockout q --save
- Next, run below command to get vss-web-extension-sdk types added to tsd.d.ts:
- Finally, add only reference to typings/tsd.d.ts in your TypeScript files.