Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/teams-js

Package Overview
Dependencies
Maintainers
3
Versions
498
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

  • 2.28.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
127K
decreased by-18.51%
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 04 Sep 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