{"name":"yggdrasil","version":"1.8.0","author":{"name":"Zeke Sonxx","email":"zeke@zekesonxx.com"},"description":"Mojang authentication (Yggdrasil) client","scripts":{"test":"mocha -R spec","pretest":"npm run lint","lint":"standard","fix":"standard --fix"},"main":"./src/index.js","repository":{"type":"git","url":"git+https://github.com/PrismarineJS/node-yggdrasil.git"},"bugs":{"url":"https://github.com/PrismarineJS/node-yggdrasil/issues"},"keywords":["minecraft","yggdrasil","authentication"],"dependencies":{"node-fetch":"^2.6.1","uuid":"^10.0.0"},"license":"MIT","devDependencies":{"@types/node":"^22.8.0","@types/node-fetch":"^3.0.3","@types/uuid":"^10.0.0","mocha":"^10.0.0","nock":"^13.0.2","standard":"^17.0.0"},"gitHead":"65b8ee52502c9a62a0c390f41b6131d1087d3b14","_id":"yggdrasil@1.8.0","homepage":"https://github.com/PrismarineJS/node-yggdrasil#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-r5bKOhkZ52DJ6q034uSkdsdZLoFVhOmfDOagRs6h/JX5W7+XIPOMb+peCbElhLEoIckwt43NCUoNQbydOzuPcQ==","shasum":"4539cbd4da03dca4566fc2ca356128b27397ce05","tarball":"http://registry-npm.ywwl.com/yggdrasil/download/yggdrasil-1.8.0.tgz","fileCount":15,"unpackedSize":31582,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/yggdrasil@1.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEtm+H93qC9ExS4jl0ZQ0YPYwaeaQjyxQv7V7fAXr7TEAiAdrJgEhF6dX76qKTFNImoLElYPqU/cGp5sKpIGv5wpOw=="}],"size":8655,"noattachment":false,"key":"/yggdrasil/-/yggdrasil-1.8.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:838caeee-2b21-489f-b25d-5e6e96c105a2"}},"directories":{},"maintainers":[{"name":"rom1504","email":"romain.rom1@gmail.com"},{"name":"zekesonxx","email":"zeke@zekesonxx.com"},{"name":"wvffle","email":"casper@wvffle.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yggdrasil_1.8.0_1774833581554_0.10668436812996229"},"_hasShrinkwrap":false,"readme":"# yggdrasil\n[![NPM version](https://img.shields.io/npm/v/yggdrasil.svg)](http://npmjs.com/package/yggdrasil)\n[![Build Status](https://github.com/PrismarineJS/node-yggdrasil/workflows/CI/badge.svg)](https://github.com/PrismarineJS/node-yggdrasil/actions?query=workflow%3A%22CI%22)\n[![Discord](https://img.shields.io/badge/chat-on%20discord-brightgreen.svg)](https://discord.gg/GsEFRM8)\n[![Gitter](https://img.shields.io/badge/chat-on%20gitter-brightgreen.svg)](https://gitter.im/PrismarineJS/general)\n[![Irc](https://img.shields.io/badge/chat-on%20irc-brightgreen.svg)](https://irc.gitter.im/)\n\n[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/PrismarineJS/node-yggdrasil)\n\nA Node.js client for doing requests to yggdrasil, the Mojang authentication system, used for Minecraft and Scrolls.\n\n# Usage\n    $ npm install yggdrasil\n\n## Client\n```js\n//init\nconst ygg = require('yggdrasil')({\n  //Optional settings object\n  host: 'https://authserver.mojang.com' //Optional custom host. No trailing slash.\n});\n\n//Authenticate a user\nygg.auth({\n  token: '', //Optional. Client token.\n  agent: '', //Agent name. Defaults to 'Minecraft'\n  version: 1, //Agent version. Defaults to 1\n  user: '', //Username\n  pass: '', //Password\n  requestUser: false //Optional. Request the user object to be included in response\n}).then(\n  (response)=>{},\n  (error)=>{}\n);\n\n//Refresh an accessToken\nygg.refresh(oldAccessToken, clientToken, true).then(\n  ({accessToken, clientToken, user?})=>{},\n  (error)=>{}\n);\n// Note that requestUser is an optional parameter. If set to true, it requests the user object from Mojang's authentication servers as well.\n\n//Validate an accessToken\nygg.validate(token).then(\n  (response)=>{},\n  (error)=>{}\n);\n\n//Invalidate all accessTokens using a current valid accessToken and clientToken.\nygg.invalidate(accessToken, clientToken).then(\n  (response)=>{},\n  (error)=>{}\n);\n\n//Invalidate all accessTokens\nygg.signout(username, password).then(\n  (response)=>{},\n  (error)=>{}\n);\n```\n\n## Server\n```js\nconst yggserver = require('yggdrasil').server({\n  //Optional settings object\n  host: 'https://authserver.mojang.com' //Optional custom host. No trailing slash.\n});\n\n//Join a server (clientside)\nyggserver.join(token, profile, serverid, sharedsecret, serverkey).then(\n  (response)=>{},\n  (error)=>{}\n);\n\n//Join a server (serverside)\nyggserver.hasJoined(username, serverid, sharedsecret, serverkey).then(\n  (clientInfo)=>{},\n  (error)=>{}\n);\n```\n## Proxy Support\n```js\nconst ProxyAgent = require('proxy-agent');\n\nconst ygg = require('yggdrasil')({\n  //Any type of HTTP Agent \n  agent: new ProxyAgent('https://example.com:8080')\n});\n```\n\n# Further Reading\n* [Authentication protocol documentation](http://wiki.vg/Authentication)\n* [node-minecraft-protocol](https://github.com/PrismarineJS/node-minecraft-protocol), a Minecraft client and server in Node.js\n","publish_time":1774833581707,"_cnpm_publish_time":1774833581707,"dist-tags":{"latest":"1.8.0"}}