Search code examples
azure-devopsazure-devops-rest-apiazure-devops-extensions

Azure DevOps - Check if logged user has dark theme enabled


I'm building an extension for Azure DevOps and I need to find out if the logged-in user has dark mode enabled.

Is there any way to do this through the Azure DevOps REST API or the VSS SDK?

Thank you!


Solution

  • Is there any way to do this through the Azure DevOps REST API or the VSS SDK?

    There is no such document REST API to check if logged user has dark theme enabled.

    But we could use F12 to grab the request URL:

    Get  https://dev.azure.com/<YourOrganizationName>/_apis/Settings/Entries/globalme
    

    The result from postman, if logged user has dark theme enabled, the value should be ms.vss-web.vsts-theme-dark

    enter image description here

    If not, the value should be default value ms.vss-web.vsts-theme without the dark.