Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
A Node.js client for doing requests to yggdrasil, the Mojang authentication system, used for Minecraft and Scrolls. There's already one other client out there (at the time of writing) but I don't like it, so I wrote this one.
node-yggdrasil was originally made because I was messing around with trying to make a Minecraft server in JS. Never really got anywhere with it. However, the folks over at PrismarineJS have gotten quite far with it, and use this library in their project.
$ npm install yggdrasil
//init
const ygg = require('yggdrasil')({
//Optional settings object
host: 'https://authserver.mojang.com' //Optional custom host. No trailing slash.
});
//Authenticate a user
ygg.auth({
token: '', //Optional. Client token.
agent: '', //Agent name. Defaults to 'Minecraft'
version: 1, //Agent version. Defaults to 1
user: '', //Username
pass: '' //Password
}, function(err, data){});
//Refresh an accessToken
ygg.refresh(oldtoken, clienttoken, function(err, newtoken, response body){});
//Validate an accessToken
ygg.validate(token, function(err){});
//Invalidate all accessTokens
ygg.signout(username, password, function(err));
const yggserver = require('yggdrasil').server({
//Optional settings object
host: 'https://authserver.mojang.com' //Optional custom host. No trailing slash.
});
//Join a server (clientside)
yggserver.join(token, profile, serverid, sharedsecret, serverkey, function(err, response body){});
//Join a server (serverside)
yggserver.hasJoined(username, serverid, sharedsecret, serverkey, function(err, client info){});
const ProxyAgent = require('proxy-agent');
const ygg = require('yggdrasil')({
//Any type of HTTP Agent
agent: new ProxyAgent('https://example.com:8080')
});
/**
* Import Client or Server from 'yggdrasil/es6'.
* Note that the library is stateless when imported this way vs the CommonJS way.
*/
import { Client as ygg, Server as yggServ } from 'yggdrasil/es6'
// Use it like you normally would.
ygg.validate(token, function(err){})
yggServ.join(token, profile, serverid, sharedsecret, serverkey, function(err, response body){});
1.3.0
FAQs
Mojang authentication (Yggdrasil) client
The npm package yggdrasil receives a total of 4,110 weekly downloads. As such, yggdrasil popularity was classified as popular.
We found that yggdrasil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.