{"name":"yggdrasil","version":"1.4.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":"./lib/index","repository":{"type":"git","url":"https://github.com/PrismarineJS/node-yggdrasil.git"},"bugs":{"url":"https://github.com/PrismarineJS/node-yggdrasil/issues"},"keywords":["minecraft","yggdrasil","authentication"],"dependencies":{"phin":"^3.4.1","uuid":"^8.2.0"},"license":"MIT","devDependencies":{"mocha":"^7.0.1","nock":"^13.0.2","standard":"^16.0.1"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2014-2017 Zach Mertes\nCopyright (c) 2015-2020 zekesonxx/node-yggdrasil contributers:\nroblaba, jonathanperret, insanity54, yariplus, comp500\nCopyright (c) 2020 PrismarineJS contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"yggdrasil@1.4.0","dist":{"shasum":"343525da10e4d8f45f78f4d4c76fc17ceb18dd1f","integrity":"sha512-pN4OFtvJ4WnbvGe6dSsOUx8C6I19Tzv2hVCcoIjekFOuL9zWc7C993z3STmCI6NuWVAgtQsLv+ciNVOWHIL/pA==","tarball":"http://registry-npm.ywwl.com/yggdrasil/download/yggdrasil-1.4.0.tgz","fileCount":19,"unpackedSize":22170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzAa+CRA9TVsSAnZWagAAfooP/3KoM1tIuDO2tSUs6d28\nk1y4153Ja8oNyq/UFCcGhywMZj2pamu5MQBDCqyir1uuJWe9krxBNTnUvnfL\ni5gqfKIOxckFjM1g6luSmotVEf3bj88I/Vlc3bgfEpUZg9Em1fNR07I0+r0Q\nNq+YPAzZbErYvYictJ7w+Ktswn0x5DbUq5oW0T6+fdfX43OHBKeeoIb1WWWC\nR/kUvCdNq9/vBv/0FesI9LuxINshvOP26VM/+UqFxEUTxS68BjPiQtI7ebsc\nSfh/A0jeVZAJwjRXH/5+wuGj8gup2WUlUXZ1Ah0K3y10QpKyH6n8+Uy0/WmW\nlOfte1QCrwfGKssgKY8mggzPbC4IfYUZ+ZlyEh7SM2xE+sLay++mwXbyNMCs\n9WrKetkCvXT7S1iWAwSSQx74VEmXvPKrmLh2le8nuMiObt+oNdR6/L07YbmI\nVKQ98w4a5nmOfB5bNupLkHqJ/vlI11uz0mUY6VttW77mIOfNWAjrX8VfDAXZ\nJIZndwiC7Nu/3Bt3gV6kVRHWkEi55C6KxcMxCWbZXulftD1TGsgJo4EkondC\nqCPJE0U2t29B54a8UTL/O+PZhamQx3DuS1c8UGRn/Yz8oc3Ed62eWWZJzdLe\nI71hsL/5lKjGuRaTbH5X/FQ59cNKrlMNt4v37x2uCM49HI+cWeOTu3s2a+gN\npvPz\r\n=QPiM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm8XImK64cm1oCECF18bYtbYJC9tAg44BzjNSJ/VT5xgIgcaFWqPqeMrTAjYH9ouxYXQr1VIJeTxQ9gvbwIJ+aWe4="}],"size":7094,"noattachment":false,"key":"/yggdrasil/-/yggdrasil-1.4.0.tgz"},"_npmUser":{"name":"rom1504","email":"romain.rom1@gmail.com"},"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","tmp":"tmp/yggdrasil_1.4.0_1607206589512_0.3670621600149715"},"_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":1607206589624,"_cnpm_publish_time":1607206589624,"dist-tags":{"latest":"1.8.0"}}