Microsoft Client SDK for building app for Microsoft hosts
npm install @microsoft/teams-jsWelcome to the Teams JavaScript client library! For breaking changes, please refer to our changelog in the current directory.
This JavaScript library is part of the Microsoft Teams developer platform. See full library reference documentation.
See instructions in the monorepo root for how to clone and build the repository.
Whenever building or testing the Teams client library, you can run pnpm build or pnpm test from the packages/teams-js directory.
To install the stable version:
npm install --save @microsoft/teams-js
pnpm add @microsoft/teams-js
You can reference these files directly from here or point your package manager at them.
Install either using npm or pnpm.
If you are using any dependency loader such as RequireJS or SystemJS or module bundler such as browserify, webpack, you can use import syntax to import specific modules. For e.g.
``typescript`
import { app } from '@microsoft/teams-js';
Reference the library inside of your .html page using:
`html
src="https://res.cdn.office.net/teams-js/2.48.1/js/MicrosoftTeams.min.js"
integrity="sha384-opiKcSoAwE9QEI+cc408L9oI0NWev5vi/CLyCCX57M7GuRKrXlC4nOxJ9z6cBoXS"
crossorigin="anonymous"
>
`
Teams client library depends on Promise` type. If you support older browsers and devices which may not yet provide it natively (e.g. IE 11), you need to provide a global polyfill, such as es6-promise, in your bundled application. If you're using a script tag to reference the Teams client library, you need to make sure the polyfill is included and initialized before the Teams client library is initialized.
While each interface, class, function, etc. includes compact developer documentation, full documentation about library usage, including examples, can be found here.
The Teams Test App is used to validate the Teams client library APIs.
If the CDN hash value on the npm page is out of date please refer to here for an up to date version. If you notice this problem, please report that issue to us in GitHub Issues
Please be sure to check out the Contributor's guide for crucial steps.