Consuming VSS.SDK.js

VSS.SDK.js has a new home https://github.com/Microsoft/vss-sdk, where it is being updated with each update of Visual Studio Team Services. It can be accessed using three options:

  1. From the repo under lib folder
  2. Run npm install vss-sdk
  3. Run bower install vss-sdk

If a specific version is required, below options can be followed:

  1. Go to https://github.com/Microsoft/vss-sdk/releases/tag/0.90.0 and click Source code (zip) at the bottom
  2. Run npm install vss-sdk@0.90.0
  3. Run bower install vss-sdk#0.90.0

If you use TypeScript, the types of VSS.SDK.js are also available in typings/vss.d.ts. Additionally, types for REST Client Libraries are available in typings/tfs.d.ts.

Although these declare files do not exist at DefinitelyTyped repo, they can still be consumed by TypeScript Definition Manager for DefinitelyTyped. Here are the steps:

  1. Make sure that the dependencies are loaded using below command:
    • tsd install jquery knockout q –save
  2. Run below command to get vss-sdk types added to tsd.d.ts:
    • tsd link
  3. Add reference to typings/tsd.d.ts in your TypeScript files.

Please let us know if you see any issue or what you want to see in docs and samples here.

Follow me at twitter.com/serkan_inci