Hello Robin,
To open URLs within Microsoft Teams from your custom application, you can use the Teams JavaScript SDK. Here’s a basic example of how you can achieve this:
- Install the Teams SDK: Make sure you have the Microsoft Teams JavaScript SDK installed in your project. You can add it via npm:
npm install @microsoft/teams-js
- Initialize the SDK: Initialize the Teams SDK in your application
import * as microsoftTeams from "@microsoft/teams-js";
microsoftTeams.initialize();
- Open URLs in Teams: Use the microsoftTeams.executeDeepLink method to open URLs within Teams.
function openUrlInTeams(url) {
microsoftTeams.executeDeepLink(url);
}
// Example usage
openUrlInTeams("https://your-url-here.com");
This will ensure that the URLs open within the Teams environment rather than in a new browser window.
If there are any misunderstandings, please let me know
Best regards,
Maycon Novaes
If the Answer is helpful, please click "Accept Answer" and upvote it.