Socket
Socket
Sign inDemoInstall

@microsoft/teams-js

Package Overview
Dependencies
Maintainers
3
Versions
488
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/teams-js

Microsoft Client SDK for building app for Microsoft hosts


Version published
Weekly downloads
129K
decreased by-3.24%
Maintainers
3
Weekly downloads
 
Created

What is @microsoft/teams-js?

@microsoft/teams-js is a JavaScript library that allows developers to integrate their web applications with Microsoft Teams. It provides a set of APIs to interact with Teams features such as authentication, notifications, and user context.

What are @microsoft/teams-js's main functionalities?

Authentication

This feature allows you to authenticate users within your Teams application. The code sample demonstrates how to initiate an authentication flow using the `microsoftTeams.authentication.authenticate` method.

const microsoftTeams = require('@microsoft/teams-js');
microsoftTeams.authentication.authenticate({
  url: window.location.origin + '/auth-start',
  width: 600,
  height: 535,
  successCallback: (result) => {
    console.log('Authentication successful:', result);
  },
  failureCallback: (reason) => {
    console.log('Authentication failed:', reason);
  }
});

Notifications

This feature allows you to show notifications to users within your Teams application. The code sample demonstrates how to display a notification using the `microsoftTeams.notifications.showNotification` method.

const microsoftTeams = require('@microsoft/teams-js');
microsoftTeams.notifications.showNotification({
  message: 'This is a notification',
  duration: 3000
});

User Context

This feature allows you to retrieve the context of the user within Teams. The code sample demonstrates how to get the user context using the `microsoftTeams.getContext` method.

const microsoftTeams = require('@microsoft/teams-js');
microsoftTeams.getContext((context) => {
  console.log('User context:', context);
});

Other packages similar to @microsoft/teams-js

FAQs

Package last updated on 24 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc