MicrosoftTeams.js "SDK initialization timed out"

Joseph Radu 0 Reputation points
2023-03-17T16:16:54.02+00:00

I'm trying to test out the following but get "SDK Initialization timed out" in my console:

document.onreadystatechange = function () {
    microsoftTeams.app.initialize().then(() => microsoftTeams.authentication.notifySuccess())
};

The script I'm trying to use:

    <script src="https://res.cdn.office.net/teams-js/2.9.1/js/MicrosoftTeams.min.js"
      integrity="sha384-xnsUQ1tUqsrutBJl0vuf4/hufzLFWW8ZhGnhItfpQ0/BtWgM2uw6YT6BQ5YaKBSM"
      crossorigin="anonymous"
    ></script>

The npm package we are using:

    "@microsoft/teams-js": "^2.9.1",

Could anyone advise?

Thanks!

Microsoft Teams | Development
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.