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

matrixorg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matrixorg

Helper library for Matrix.org APIs

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

matrix.org

Build

Node client library for matrix.org API

Install

Run

npm install node-matrixorg

Getting Started

var matrix = require('node-matrixorg');

//Use the client

var client = new Matrix.Client("http://yourhomeserver")

Login and registration

var matrix = require('node-matrixorg');
var client = new matrix.Client("http://yourhomeserver")

client.register("m.login.password", {"user":"user", "password":"password"}, function(err, res){
  console.log("user id: " + res.user_id)
})


client.login("m.login.password", {"user":"youruser", "passwword":"password", function(err,res){
	console.log("access token: " + res.access_token)
  client.access_token = res.access_token;
  client.user_id = res.user_id;
  console.log("Client is logged in properly: " + client.isLoggedIn())
});

Room methods

// Create a room
client.createRoom("my room", function(err, room){
  console.log("room id: " + room.room_id);
});

//invite users to a room
var roomId = "foo";
var userId = "bar";
client.inviteToRoom(roomId, userId, callback);

//leave a room
client.leaveRoom(roomId, callback);

//join a room
client.joinRoom(roomId, callback);

//ban user from room
client.banFromRoom(roomId, userId, "Too chatty", callback);

Keywords

FAQs

Package last updated on 31 Mar 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