Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
This sample shows how to open purchase dialog and trigger purchase flow using teams-js sdk
office-teams
office
office-365
nodejs
javascript
contentType createdDate
samples
07/20/2022 12:00:00 AM
officedev-microsoft-teams-samples-tab-app-monetization-nodejs

App monetization in tab

This sample shows how to open purchase dialog and trigger purchase flow using teams-js sdk.

tab page

triggered purchase popup

Prerequisites

To try this sample

  1. Register a SAAS offer in market place and generate an plan id for it Create SAAS Offer

  2. Clone the repository

    git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
  3. Install node modules

    Inside node js folder, navigate to samples/tab-app-monetization/nodejs/ClientApp open your local terminal and run the below command to install node modules. You can do the same in Visual Studio code terminal by opening the project in Visual Studio code.

    npm install
    
  4. Run the solution from the same path terminal using below command.

    npm start
    
  5. Modify the manifest.json in the /AppPackage folder and replace the following details

    • {{Manifest-id}} with some unique GUID.
    • {{Domain Name}} with your application's base url, e.g. https://1234.ngrok.io
    • {{Plan-id}} with plan id generated in step 1.
  6. Zip the contents of AppPackage folder into a manifest.zip, and use the manifest.zip to deploy in app store or add to Teams.

  7. Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")

    • Go to Microsoft Teams. From the lower left corner, select Apps
    • From the lower left corner, choose Apps -> Manage your apps -> Upload an app.
    • Go to your project directory, the ./AppPackage folder, select the zip folder, and choose Open.
    • Select Add in the pop-up dialog box. Your app is uploaded to Teams.
  8. Add the tab in personal scope.

Features of the sample

  • Add the tab in personal scope.
  • On click of upgrade button will trigger the purchase flow.

Further reading