Skip to content

Microsoft Teams

Microsoft Teams is a collaboration app from Microsoft for team chat, meetings, calls, and channels. Protocol Launcher allows you to generate deep links for Microsoft Teams.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

Notes

Microsoft recommends https://teams.microsoft.com/l/... deep links by default. The msteams protocol handler opens Teams desktop directly, but Microsoft warns not to prepend msteams: to an https:// Teams URL. This module only exposes the native msteams:/l/meeting-share form for the meeting-stage share link where Microsoft documents that exact format.

Open App Install Dialog

Open a Teams app install dialog by app ID.

On-Demand
ts
import { openAppInstallDialog } from 'protocol-launcher/microsoft-teams'

const url = openAppInstallDialog({
  appId: 'fxxxxxxx-0xxx-4xxx-8xxx-cxxxxxxxxxxx',
  tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47',
})

Open App Tab

Open content inside a Teams app tab.

On-Demand
ts
import { openAppTab } from 'protocol-launcher/microsoft-teams'

const url = openAppTab({
  appId: 'fxxxxxxx-0xxx-4xxx-8xxx-cxxxxxxxxxxx',
  entityId: 'tasklist123',
  webUrl: 'https://tasklist.example.com/123/456',
  label: 'Task 456',
  context: {
    subEntityId: 'task456',
    channelId: '19:cbe3683f25094106b826c9cada3afbe0@thread.skype',
  },
  openInMeeting: false,
})

Open App Chat

Open a personal chat with a Teams app.

On-Demand
ts
import { openAppChat } from 'protocol-launcher/microsoft-teams'

const url = openAppChat({
  appId: 'fxxxxxxx-0xxx-4xxx-8xxx-cxxxxxxxxxxx',
  tenantId: 'abcdef12-3456-7890-abcd-ef1234567890',
})

Open Dialog

Open a Teams dialog with a TaskInfo.url.

On-Demand
ts
import { openDialog } from 'protocol-launcher/microsoft-teams'

const url = openDialog({
  appId: 'fxxxxxxx-0xxx-4xxx-8xxx-cxxxxxxxxxxx',
  url: 'https://example.com/task',
  height: 600,
  width: 800,
  title: 'Example Task',
  completionBotId: 'abcdef12-3456-7890-abcd-ef1234567890',
})

Open New Chat

Open or create a private chat with users and optional draft text.

On-Demand
ts
import { openNewChat } from 'protocol-launcher/microsoft-teams'

const url = openNewChat({
  users: ['joe@contoso.com', 'bob@contoso.com'],
  topicName: 'Prep For Meeting Tomorrow',
  message: 'Hi folks, kicking off a chat about our meeting tomorrow',
})

Open Chat

Navigate to a specific Teams chat conversation.

On-Demand
ts
import { openChat } from 'protocol-launcher/microsoft-teams'

const url = openChat({
  chatId: '19:c6d70e392a384916c3262b15406d763e@thread.v2',
})

Open Channel Conversation

Navigate to a channel conversation.

On-Demand
ts
import { openChannelConversation } from 'protocol-launcher/microsoft-teams'

const url = openChannelConversation({
  channelId: '19:3997a8734ee5432bb9cdedb7c432ae7d@thread.tacv2',
  messageId: '1648741500652',
  tenantId: '0d9b645f-597b-41f0-a2a3-ef103fbd91bb',
  groupId: '3606f714-ec2e-41b3-9ad1-6afb331bd35d',
  parentMessageId: '1648741500652',
  teamName: 'Example Team',
  channelName: 'General',
  createdTime: '1648741500652',
})

Open Chat Message

Navigate to a message in a personal or group chat.

On-Demand
ts
import { openChatMessage } from 'protocol-launcher/microsoft-teams'

const url = openChatMessage({
  chatId: '19:253f5895-9a62-4362-8d38-43f0205c702c_f1b94dcf-0aa3-4989-bcdf-ef4a5ed00f86@unq.gbl.spaces',
  messageId: '1563480968434',
})

Open Team

Navigate to a team. The channel ID path segment is encoded by the helper.

On-Demand
ts
import { openTeam } from 'protocol-launcher/microsoft-teams'

const url = openTeam({
  channelId: '19:TWLPKo8lD4v8zDxyw4FnDYY-ovnBJG5CSjmrHUAoOz41@thread.tacv2',
  groupId: '72602e12-78ac-474c-99d6-f619710353a9',
  tenantId: 'aaaabbbb-0000-cccc-1111-dddd2222eeee',
})

Open Channel

Navigate to a standard, private, or shared Teams channel. Set ngc: true for private channels and both ngc: true plus allowXTenantAccess: true for shared channels, matching Microsoft's documented parameters.

On-Demand
ts
import { openChannel } from 'protocol-launcher/microsoft-teams'

const standardUrl = openChannel({
  channelId: '19:9be3de4e70874c71a608dee9ba803ed3@thread.tacv2',
  channelName: 'My example channel',
  groupId: '72602e12-78ac-474c-99d6-f619710353a9',
  tenantId: 'aaaabbbb-0000-cccc-1111-dddd2222eeee',
})

const sharedUrl = openChannel({
  channelId: '19:9be3de4e70874c71a608dee9ba803ed3@thread.tacv2',
  channelName: 'My example channel',
  groupId: '72602e12-78ac-474c-99d6-f619710353a9',
  tenantId: 'aaaabbbb-0000-cccc-1111-dddd2222eeee',
  ngc: true,
  allowXTenantAccess: true,
})

Open File

Navigate to a file in a Teams channel.

On-Demand
ts
import { openFile } from 'protocol-launcher/microsoft-teams'

const url = openFile({
  fileId: '5E0154FC-F2B4-4DA5-8CDA-F096E72C0A80',
  tenantId: '0d9b645f-597b-41f0-a2a3-ef103fbd91bb',
  fileType: 'pptx',
  objectUrl: 'https://microsoft.sharepoint.com/teams/ActionPlatform/Shared Documents/deck.pptx',
  baseUrl: 'https://microsoft.sharepoint.com/teams/ActionPlatform',
  serviceName: 'teams',
  threadId: '19:f8fbfc4d89e24ef5b3b8692538cebeb7@thread.skype',
  groupId: 'ae063b79-5315-4ddb-ba70-27328ba6c31e',
})

Open Meeting Scheduling Dialog

Open the Teams meeting scheduling dialog.

On-Demand
ts
import { openMeetingSchedulingDialog } from 'protocol-launcher/microsoft-teams'

const url = openMeetingSchedulingDialog({
  subject: 'test subject',
  attendees: ['joe@contoso.com', 'bob@contoso.com'],
  startTime: '2018-10-24T10:00:00-07:00',
  endTime: '2018-10-24T10:30:00-07:00',
  content: 'test:content',
})

Start Call

Start an audio or audio-video call.

On-Demand
ts
import { startCall } from 'protocol-launcher/microsoft-teams'

const url = startCall({
  users: ['joe@contoso.com', '4:9876543210'],
  withVideo: true,
  source: 'demoApp',
})

Share To Meeting Stage

Share app content to a Teams meeting stage. Microsoft requires the appContext value to be double-encoded in the final URL.

On-Demand
ts
import { shareToMeetingStage } from 'protocol-launcher/microsoft-teams'

const webUrl = shareToMeetingStage({
  deepLinkId: 'sampleid',
  fqdn: 'teams.microsoft.com',
  appContext: {
    appSharingUrl: 'https://teams.microsoft.com/extensibility-apps/meetingapis/view',
    appId: '9cc80a93-1d41-4bcb-8170-4b9ec9e29fbb',
    useMeetNow: true,
  },
})

const nativeUrl = shareToMeetingStage({
  deepLinkId: 'sampleid',
  fqdn: 'teams.microsoft.com',
  protocol: 'msteams',
  appContext: {
    appSharingUrl: 'https://teams.microsoft.com/extensibility-apps/meetingapis/view',
    appId: '9cc80a93-1d41-4bcb-8170-4b9ec9e29fbb',
    useMeetNow: true,
  },
})

Official Documentation