{"id":17697314,"url":"https://github.com/waigel/node-ms-teams-webhook","last_synced_at":"2025-04-30T15:22:27.693Z","repository":{"id":225193552,"uuid":"212651938","full_name":"waigel/node-ms-teams-webhook","owner":"waigel","description":"Microsoft Teams webhook","archived":false,"fork":false,"pushed_at":"2024-05-19T01:32:07.000Z","size":77,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-19T02:32:05.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waigel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-03T18:36:46.000Z","updated_at":"2024-05-19T02:32:19.300Z","dependencies_parsed_at":"2024-05-19T02:32:09.648Z","dependency_job_id":"0e754b44-5091-4af5-adb8-e353b149b775","html_url":"https://github.com/waigel/node-ms-teams-webhook","commit_stats":null,"previous_names":["waigel/node-ms-teams-webhook","verhext/node-ms-teams-webhook"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waigel%2Fnode-ms-teams-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waigel%2Fnode-ms-teams-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waigel%2Fnode-ms-teams-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waigel%2Fnode-ms-teams-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waigel","download_url":"https://codeload.github.com/waigel/node-ms-teams-webhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246351314,"owners_count":20763280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T14:47:03.922Z","updated_at":"2025-03-31T15:30:55.459Z","avatar_url":"https://github.com/waigel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microsoft Incoming Webhooks\n\nThis package helps you making requests to Microsoft Teams Incoming Webhooks. Use it in your application to send a notification to a channel.\n\n## Installation\n\n```shell\n$ npm install ms-teams-webhook\n```\n\n## Usage\n\n### Initialize the webhook\n\nThe package exports a `IncomingWebhook` class. You'll need to initialize it with the URL you received from Microsoft Teams.\n\nThe URL can come from installation the `Webhook Connector` by `right click on a channel \u003e Incomming Webhook \u003e Configuration \u003e (insert a name) \u003e Create`\n\n### Javascript example:\n\n```javascript\nconst { IncomingWebhook } = import(\"ms-teams-webhook\");\n\n// Read a url from the environment variables\nconst url = process.env.MS_TEAMS_WEBHOOK_URL;\n\n// Initialize\nconst webhook = new IncomingWebhook(url);\n```\n\n### Typescript example:\n\n```typescript\nimport { IncomingWebhook } from \"ms-teams-webhook\";\n\n// Read a url from the environment variables\nconst url = process.env.MS_TEAMS_WEBHOOK_URL;\nif (!url) {\n  throw new Error(\"MS_TEAMS_WEBHOOK_URL is required\");\n}\n\n// Initialize\nconst webhook = new IncomingWebhook(url);\n```\n\n### Send a webhook\n\nYou can use the \"Editor for adaptive cards\" in the Microsoft Teams Developer Portal\n\nhttps://dev.teams.microsoft.com/cards\n\nAfter you set up the webhook (see above), you can send a message to the channel by calling `webhook.send()`.\n\n```typescript\n(async () =\u003e {\n  await webhook.send({\n    \"@type\": \"MessageCard\",\n    \"@context\": \"https://schema.org/extensions\",\n    summary: \"Issue 176715375\",\n    themeColor: \"0078D7\",\n    title: 'Issue opened: \"Push notifications not working\"',\n    sections: [\n      {\n        activityTitle: \"Miguel Garcie\",\n        activitySubtitle: \"9/13/2016, 11:46am\",\n        activityImage:\n          \"https://connectorsdemo.azurewebsites.net/images/MSC12_Oscar_002.jpg\",\n        text: \"There is a problem with Push notifications, they don't seem to be picked up by the connector.\",\n      },\n    ],\n  });\n})();\n```\n\n---\n\nCredits go out to Slack. I took her [Webhook lib](https://github.com/slackapi/node-slack-sdk/blob/master/packages/webhook/README.md) as a template for this API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaigel%2Fnode-ms-teams-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaigel%2Fnode-ms-teams-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaigel%2Fnode-ms-teams-webhook/lists"}