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

node-slack

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-slack

Send and receive Slack Webhooks easily!

  • 0.0.2
  • npm
  • Socket score

Version published
Weekly downloads
16K
decreased by-5.35%
Maintainers
1
Weekly downloads
 
Created
Source

node-slack

A node module for sending and receiving messages with Slack via webhooks.

(Slack)[https://slack.com/] is a messaging platform that is easy to integrate with. This module should be useful for creating various integrations with Slack, such as chat bots!

Install Slack

node-slack is available via npm:

npm install node-slack

Get your custom domain and token from Slack.

Domain is the first part of your .slack.com.

Token is provided on the integration setup page.

var Slack = require('node-slack');
var slack = new Slack(domain,token);

To send a message, call slack.send:

slack.send({
	text: 'Howdy!',
	channel: '#foo',
	username: 'Bot'
});

To respond to a message, pass the information from the webhook into slack.respond, along with a callback function responsible for returnign a response.

From inside an Express.js route, this is as easy as passing in req.body:

app.post('/yesman',function(req,res) {
	
	var txt = slack.respond(req.body,function() {
		
		return {
			text: 'Good point, ' + this.user_name,
			username: 'Bot'
		};
		
		
	});
	
	res.json(txt);

});

FAQs

Package last updated on 14 Sep 2013

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