Socket
Socket
Sign inDemoInstall

@reuters-graphics/teams-klaxon

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reuters-graphics/teams-klaxon

[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fteams-klaxon.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fteams-klaxon) [![Reuters open source software](https://badgen.net/badge/Reuters/open%20source/?color=ff8000)](https://github.c


Version published
Weekly downloads
613
increased by17.88%
Maintainers
2
Weekly downloads
 
Created
Source

@reuters-graphics/teams-klaxon

npm version Reuters open source software

Send messages to a Microsoft Teams channel.

Quickstart

Setup a Microsoft Teams incoming webhook in a channel, then install the library.

$ yarn add @reuters-graphics/teams-klaxon
const TeamsKlaxon = require('@reuters-graphics/teams-klaxon');

// Your incoming webhook
const webhook = 'https://outlook.office.com/webhook/...';

const klaxon = new TeamsKlaxon(webhook);

await klaxon.log({
  text: 'A simple message',
});

Message formats

Text
await klaxon.log({
  text: 'A simple message',
});

Facts
await klaxon.log({
  title: '⚙️ Testing facts',
  facts: {
    Name: 'Jon McClure',
    Age: '35',
  },
});

Images
await klaxon.log({
  title: '⚙️ Testing images',
  images: [
    'https://scitechdaily.com/images/Great-White-Shark-Smile-1536x1152.jpg',
    'https://cdn.britannica.com/79/65379-050-5CF52BAC/Shortfin-mako-shark-seas.jpg',
  ],
});

Stack trace
await klaxon.log({
  title: '⚙️ Testing stack trace',
  stackTrace: {
    title: 'Stack trace',
    code: 'console.log(\'hello world\'!)',
  },
});

await klaxon.log({
  title: '⚙️ Testing link buttons',
  linkButtons: [{
    name: 'Google',
    link: 'https://www.google.com',
  }, {
    name: 'Twitter',
    link: 'https://www.twitter.com',
  }],
});

Color
await klaxon.log({
  title: '⚙️ Testing color',
  color: 'FF0000'
});

Multiple options
await klaxon.log({
  title: '⚙️ Testing multiple options',
  color: 'FF0000',
  facts: {
    Name: 'Jon McClure',
    Age: '35',
  },
  images: [
    'https://scitechdaily.com/images/Great-White-Shark-Smile-1536x1152.jpg',
    'https://cdn.britannica.com/79/65379-050-5CF52BAC/Shortfin-mako-shark-seas.jpg',
  ],
  stackTrace: {
    code: 'console.log(\'hello world!\')',
  },
  linkButtons: [{
    name: 'Google',
    link: 'https://www.google.com',
  }, {
    name: 'Twitter',
    link: 'https://www.twitter.com',
  }],
});

Testing

$ yarn test

FAQs

Package last updated on 24 Aug 2020

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