
Research
/Security News
Compromised npm Packages in the AsyncAPI Namespace Deliver Miasma Botnet Loader
3 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.
matrix-api
Advanced tools
Matrix API. 100% frontend.
https://curvature.seanmorr.is/matrix-api
<script src = "https://unpkg.com/curvature@0.0.66-q/dist/curvature.js"></script>
<script src = "https://unpkg.com/matrix-api@0.0.0-d/dist/matrix-api.js"></script>
<script src = "https://unpkg.com/matrix-api@0.0.0-d/dist/matrix-api.standalone.js"></script>
Set up a page that can serve as your redirect target. This page will post a message back to its opener when the login flow completes, and then it will close.
// Under /accept-sso
const baseUrl = 'https://matrix.org/_matrix';
const matrix = new Matrix(baseUrl);
const loginToken = '...'; // Get the loginToken from the query string.
matrix.completeSso(loginToken);
In your main application, initialize a Matrix object with the same baseUrl. Log in and listen for events:
// In your main application
// Connect to your Matrix endpoint:
const baseUrl = 'https://matrix.org/_matrix';
const matrix = new Matrix(baseUrl);
// Open the login popup, targetting the url from the first step:
const redirectUrl = location.origin + '/accept-sso';
matrix.initSso(redirectUrl);
// ... and wait or the user to log in:
matrix.addEventListener('logged-in', event => console.log('Logged in!', event));
// Listen for events of only one type:
matrix.addEventListener('m.room.message', event => console.log('Message:', event));
// Listen for ALL events from the server:
matrix.addEventListener('matrix-event', event => console.log('Event:', event));
Join a room:
// Send a message:
const roomId = 'ROOM_ID_HERE';
// You'll receive a promise that will complete
// when the server responds:
matrix.joinRoom(roomId)
.then(response => console.log(response))
.catch(error => console.error(error));
Send messages to a room:
// Send a message:
const roomId = 'ROOM_ID_HERE';
const msgtype = 'm.text';
const body = 'message body...';
const message = {msgtype, body};
// You'll receive a promise that will complete
// when the server responds:
matrix.putEvent(roomId, 'm.room.message', message)
.then(response => console.log(response))
.catch(error => console.error(error));
FAQs
Matrix API library for the frontend.
The npm package matrix-api receives a total of 23 weekly downloads. As such, matrix-api popularity was classified as not popular.
We found that matrix-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
3 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.