Context interface

Properties

appIconPosition

Personal app icon y coordinate position

appLaunchId

ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.

appSessionId

Unique ID for the current session for use in correlating telemetry data.

channelId

The Microsoft Teams ID for the channel with which the content is associated.

channelName

The name for the channel with which the content is associated.

channelRelativeUrl

The relative path to the SharePoint folder associated with the channel.

channelType

The type of the channel with which the content is associated.

chatId

The Microsoft Teams ID for the chat with which the content is associated.

defaultOneNoteSectionId

The OneNote section ID that is linked to the channel.

entityId

The developer-defined unique ID for the entity this content points to.

frameContext

The context where tab url is loaded (content, task, setting, remove, sidePanel).

groupId

The Office 365 group ID for the team with which the content is associated. This field is available only when the identity permission is requested in the manifest.

hostClientType

The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead), * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays

hostTeamGroupId

The AAD group ID of the host team.

hostTeamTenantId

The tenant ID of the host team.

isCallingAllowed

Represents whether calling is allowed for the current logged in User

isFullScreen

Indication whether the tab is in full-screen mode.

isMultiWindow

Indication whether the tab is in a pop out window

isPSTNCallingAllowed

Represents whether PSTN calling is allowed for the current logged in User

isTeamArchived

Indicates whether team is archived. Apps should use this as a signal to prevent any changes to content associated with archived teams.

locale

The current locale that the user has configured for the app formatted as languageId-countryId (for example, en-us).

loginHint

A value suitable for use as a login_hint when authenticating with Azure AD. Because a malicious party can run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

meetingId

Meeting Id used by tab when running in meeting context

mySiteDomain

The SharePoint my site domain associated with the user.

mySitePath

The SharePoint relative path to the current users mysite

osLocaleInfo

More detailed locale info from the user's OS if available. Can be used together with the @microsoft/globe NPM package to ensure your app respects the user's OS date and time format configuration.

parentMessageId

The ID of the parent message from which this task module was launched. This is only available in task modules launched from bot cards.

ringId

Current ring ID

sessionId

Unique ID for the current Teams session for use in correlating telemetry data.

sharepoint

SharePoint context. This is only available when hosted in SharePoint.

sourceOrigin

Source origin from where the tab is opened

subEntityId

The developer-defined unique ID for the sub-entity this content points to. This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.

teamId

The Microsoft Teams ID for the team with which the content is associated.

teamName

The name for the team with which the content is associated.

teamSiteDomain

The domain of the root SharePoint site associated with the team.

teamSiteId

Teamsite ID, aka sharepoint site id.

teamSitePath

The relative path to the SharePoint site associated with the team.

teamSiteUrl

The root SharePoint site associated with the team.

teamTemplateId

Team Template ID if there was a Team Template associated with the creation of the team.

teamType

The type of the team.

tenantSKU

The type of license for the current users tenant.

theme

The current UI theme.

tid

The Azure AD tenant ID of the current user. Because a malicious party can run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

upn
userClickTime

Time when the user clicked on the tab

userFileOpenPreference

Where the user prefers the file to be opened from by default during file open.

userLicenseType

The license type for the current user.

userObjectId

The Azure AD object id of the current user. Because a malicious party run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

userPrincipalName

The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users). Because a malicious party run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

userTeamRole

The user's role in the team. Because a malicious party can run your content in a browser, this value should be used only as a hint as to the user's role, and never as proof of her role.

Property Details

appIconPosition

Personal app icon y coordinate position

appIconPosition?: number

Property Value

number

appLaunchId

ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.

appLaunchId?: string

Property Value

string

appSessionId

Unique ID for the current session for use in correlating telemetry data.

appSessionId?: string

Property Value

string

channelId

The Microsoft Teams ID for the channel with which the content is associated.

channelId?: string

Property Value

string

channelName

The name for the channel with which the content is associated.

channelName?: string

Property Value

string

channelRelativeUrl

The relative path to the SharePoint folder associated with the channel.

channelRelativeUrl?: string

Property Value

string

channelType

The type of the channel with which the content is associated.

channelType?: ChannelType

Property Value

@microsoft/teams-js.@microsoft.teams-js.ChannelType

chatId

The Microsoft Teams ID for the chat with which the content is associated.

chatId?: string

Property Value

string

defaultOneNoteSectionId

The OneNote section ID that is linked to the channel.

defaultOneNoteSectionId?: string

Property Value

string

entityId

The developer-defined unique ID for the entity this content points to.

entityId: string

Property Value

string

frameContext

The context where tab url is loaded (content, task, setting, remove, sidePanel).

frameContext?: FrameContexts

Property Value

@microsoft/teams-js.@microsoft.teams-js.FrameContexts

groupId

The Office 365 group ID for the team with which the content is associated. This field is available only when the identity permission is requested in the manifest.

groupId?: string

Property Value

string

hostClientType

The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead), * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays

hostClientType?: HostClientType

Property Value

@microsoft/teams-js.@microsoft.teams-js.HostClientType

hostTeamGroupId

The AAD group ID of the host team.

hostTeamGroupId?: string

Property Value

string

hostTeamTenantId

The tenant ID of the host team.

hostTeamTenantId?: string

Property Value

string

isCallingAllowed

Represents whether calling is allowed for the current logged in User

isCallingAllowed?: boolean

Property Value

boolean

isFullScreen

Indication whether the tab is in full-screen mode.

isFullScreen?: boolean

Property Value

boolean

isMultiWindow

Indication whether the tab is in a pop out window

isMultiWindow?: boolean

Property Value

boolean

isPSTNCallingAllowed

Represents whether PSTN calling is allowed for the current logged in User

isPSTNCallingAllowed?: boolean

Property Value

boolean

isTeamArchived

Indicates whether team is archived. Apps should use this as a signal to prevent any changes to content associated with archived teams.

isTeamArchived?: boolean

Property Value

boolean

locale

The current locale that the user has configured for the app formatted as languageId-countryId (for example, en-us).

locale: string

Property Value

string

loginHint

A value suitable for use as a login_hint when authenticating with Azure AD. Because a malicious party can run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

loginHint?: string

Property Value

string

meetingId

Meeting Id used by tab when running in meeting context

meetingId?: string

Property Value

string

mySiteDomain

The SharePoint my site domain associated with the user.

mySiteDomain?: string

Property Value

string

mySitePath

The SharePoint relative path to the current users mysite

mySitePath?: string

Property Value

string

osLocaleInfo

More detailed locale info from the user's OS if available. Can be used together with the @microsoft/globe NPM package to ensure your app respects the user's OS date and time format configuration.

osLocaleInfo?: LocaleInfo

Property Value

@microsoft/teams-js.@microsoft.teams-js.LocaleInfo

parentMessageId

The ID of the parent message from which this task module was launched. This is only available in task modules launched from bot cards.

parentMessageId?: string

Property Value

string

ringId

Current ring ID

ringId?: string

Property Value

string

sessionId

Unique ID for the current Teams session for use in correlating telemetry data.

sessionId?: string

Property Value

string

sharepoint

SharePoint context. This is only available when hosted in SharePoint.

sharepoint?: any

Property Value

any

sourceOrigin

Source origin from where the tab is opened

sourceOrigin?: string

Property Value

string

subEntityId

The developer-defined unique ID for the sub-entity this content points to. This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.

subEntityId?: string

Property Value

string

teamId

The Microsoft Teams ID for the team with which the content is associated.

teamId?: string

Property Value

string

teamName

The name for the team with which the content is associated.

teamName?: string

Property Value

string

teamSiteDomain

The domain of the root SharePoint site associated with the team.

teamSiteDomain?: string

Property Value

string

teamSiteId

Teamsite ID, aka sharepoint site id.

teamSiteId?: string

Property Value

string

teamSitePath

The relative path to the SharePoint site associated with the team.

teamSitePath?: string

Property Value

string

teamSiteUrl

The root SharePoint site associated with the team.

teamSiteUrl?: string

Property Value

string

teamTemplateId

Team Template ID if there was a Team Template associated with the creation of the team.

teamTemplateId?: string

Property Value

string

teamType

The type of the team.

teamType?: TeamType

Property Value

@microsoft/teams-js.@microsoft.teams-js.TeamType

tenantSKU

The type of license for the current users tenant.

tenantSKU?: string

Property Value

string

theme

The current UI theme.

theme?: string

Property Value

string

tid

The Azure AD tenant ID of the current user. Because a malicious party can run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

tid?: string

Property Value

string

upn

Warning

This API is now deprecated.

Use loginHint or userPrincipalName. The UPN of the current user. Because a malicious party can run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

upn?: string

Property Value

string

userClickTime

Time when the user clicked on the tab

userClickTime?: number

Property Value

number

userFileOpenPreference

Where the user prefers the file to be opened from by default during file open.

userFileOpenPreference?: FileOpenPreference

Property Value

@microsoft/teams-js.@microsoft.teams-js.FileOpenPreference

userLicenseType

The license type for the current user.

userLicenseType?: string

Property Value

string

userObjectId

The Azure AD object id of the current user. Because a malicious party run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

userObjectId?: string

Property Value

string

userPrincipalName

The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users). Because a malicious party run your content in a browser, this value should be used only as a hint as to who the user is and never as proof of identity. This field is available only when the identity permission is requested in the manifest.

userPrincipalName?: string

Property Value

string

userTeamRole

The user's role in the team. Because a malicious party can run your content in a browser, this value should be used only as a hint as to the user's role, and never as proof of her role.

userTeamRole?: UserTeamRole

Property Value

@microsoft/teams-js.@microsoft.teams-js.UserTeamRole