New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

matrix-appservice

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matrix-appservice

Matrix Application Service Framework

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
increased by108.95%
Maintainers
1
Weekly downloads
 
Created
Source

This is a Matrix Application Service framework written in Node.js.

This can be used to quickly setup performant application services for almost anything you can think of in a web framework agnostic way.

var AppService = require("matrix-appservice").AppService;
var AppServiceRegistration = require("matrix-appservice").AppServiceRegistration;

// creating registration files
var reg = new AppServiceRegistration("http://localhost:8010");
reg.setHomeserverToken(AppServiceRegistration.generateToken());
reg.setAppServiceToken(AppServiceRegistration.generateToken());
reg.setSenderLocalpart("example-appservice");
reg.addRegexPattern("users", "@.*", true);
reg.outputAsYaml("registration.yaml");

// listening
var as = new AppService({
  homeserverToken: "abcd653bac492087d3c87"
});
as.on("type:m.room.message", function(event) {
  // handle the incoming message
});
as.onUserQuery = function(userId, callback) {
  // handle the incoming user query then respond
  console.log("RECV %s", userId);
  callback();
};
// can also do this as a promise
as.onAliasQuery = function(alias) {
    // Needs a promise lib e.g.  var q = require("q");
    var defer = q.defer();
    // do stuff
    defer.resolve();
    return defer.promise;
};
as.listen(8010);

API Reference

A hosted API reference can be found on GitHub Pages.

Keywords

FAQs

Package last updated on 01 Sep 2015

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