{"name":"yggdrasil","version":"1.2.0","author":{"name":"Zeke Sonxx","email":"zeke@zekesonxx.com"},"description":"Mojang authentication (Yggdrasil) client","scripts":{"test":"mocha -R spec","lint":"standard"},"main":"./lib/index","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":{"phin":"^2.2.1","uuid":"^3.1.0"},"license":"MIT","devDependencies":{"mocha":"^3.5.0","nock":"^9.0.14","should":"^11.2.1","standard":"^14.3.1"},"gitHead":"9af4687f735823d368e8f9e99ebd0f7d4ff04963","homepage":"https://github.com/PrismarineJS/node-yggdrasil#readme","_id":"yggdrasil@1.2.0","_nodeVersion":"12.10.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-IQ/08tssYIsKOEZq6E9o4r0r3rGkg2uRpaKc7eMrrIRQ8mwWz2XK3fa9LL7MHWHbu8T+tztRdg72OC/tR5QcQA==","shasum":"7bb98d531a61c837dc5c70946831581047ddddab","tarball":"http://registry-npm.ywwl.com/yggdrasil/download/yggdrasil-1.2.0.tgz","fileCount":19,"unpackedSize":21835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNh/3CRA9TVsSAnZWagAAgzIQAJtT1qIXSloUhbV5TC+Y\nuUVGnIq6MdqQl64IV0oqrlBN8EUS2PJAYFmGoorD6xlV4Zz38e+w9rdX72kO\nwS/3z80E5w2PZNOybfEyCdn+/JY+guoBY64jSOLX51Z+ygd65E1Qn9wiVGh2\n1wrulhZgIHrNADatSuyyKVYsAIRA0fCvwjvlVrK5IxSMzoZNFHN+1PHzZXmd\nWXYzZYxE/8jnCTrMxOrX9Or0A4FNSrV4uad2TvQEC97Qhb8McRR7Pjh63xWR\nyRac/q30CdYb6iacnBfSWmsRkh23egm8Hg3SOXBCPeEpLY0yRHZnYSiJHJde\nOcTEz0eoRBzYA++thIZRpQYkVRtuEfmM3olpnATkrT2Rh4uGAL+Pb9oUE+SJ\nkAhrk3H47ItTcDpfs1LhzBejy3Hw4+5rs6ysdMh3ekt3lZMGiI0vbEFubTUn\naMJi92BaLJX4J7m9N6XJ+0NBnnQ3Mlo81mXK9q2g5VjQG5WxGTSB7cekPQsk\nwdZD/0+DTD6hStNp36YypLIjbiRTK4jZQXzB42/aB2M/a0856PvXaE6KPzrs\nli9rb520BHM/0DBlKVdA17ltlQKy/vwIiDi/iPgWKoqvvWIpd3UwCft/nDS9\n0QQsZHyu3bohrIPvTX4UTLPQY1aUcL3SEh1p5temxkcftmYuwLIbOqA13ckw\n+fP7\r\n=mlF4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsu5677R5ihJbmCXRi73fq3X8pHeEPYZgGtGIv56NsYAIgMyK2OII5IZseRh6ZcQLvQMLzmpUAPcO551xsXbtiZew="}],"size":7196,"noattachment":false,"key":"/yggdrasil/-/yggdrasil-1.2.0.tgz"},"maintainers":[{"name":"zekesonxx","email":"zeke@zekesonxx.com"}],"_npmUser":{"name":"wvffle","email":"casper@wvffle.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yggdrasil_1.2.0_1580605431221_0.605364998172695"},"_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":1580605431380,"_cnpm_publish_time":1580605431380,"dist-tags":{"latest":"1.8.0"}}