Search code examples
tfsazure-devopsazure-devops-extensions

TFS Extension LocalStorage


I'm trying to port an application which uses localstorage to store values between sessions. Looking at vss-web-extension-sdk's VSS.SDK.js, it looks like TFS runs extensions in a sandbox which shims in a localstorage replacement, which works well enough within a session, but nothing set in shimmedLocalStorage persists when the page or iframe is refreshed.

Is this a bug, or is shimmedLocalStorage not meant to persist?

It's crucial that this application is able to store user settings and data, is there any other way to do this in a TFS extension?


Solution

  • VSTS extensions have the ability to store user preferences and complex data structures directly on Microsoft-provided infrastructure.

    There are two ways to interact with the data storage service: REST APIs or a Microsoft-provided client service available as part of the VSS SDK. It is highly recommended that extension developers use the provided client service APIs, which provide a convenient wrapper over the REST APIs.

    Details refer to Data storage.