{"name":"yggdrasil","version":"1.5.1","author":{"name":"Zeke Sonxx","email":"zeke@zekesonxx.com"},"description":"Mojang authentication (Yggdrasil) client","scripts":{"test":"mocha -R spec","pretest":"npm run lint && npm run build","prepublish":"npm run lint && npm run build","lint":"ts-standard","fix":"ts-standard --fix","build":"npx tsc"},"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":{"node-fetch":"^2.6.1","uuid":"^8.2.0"},"license":"MIT","devDependencies":{"@types/node":"^14.14.19","@types/node-fetch":"^2.5.8","@types/uuid":"^8.3.0","mocha":"^7.2.0","nock":"^13.0.2","ts-standard":"^10.0.0","typescript":"^4.1.3"},"gitHead":"81f5b445a9d3272c742e94a28fa68a223559afdd","homepage":"https://github.com/PrismarineJS/node-yggdrasil#readme","_id":"yggdrasil@1.5.1","_nodeVersion":"14.0.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-fJESL8mQU4sozzEDkvWOIxMyPIpmOuPdStdC+NLCA9ckS8iNS8OncjKSC2Mcf9lWfJGy4lCFH7fzv7pzT93MIQ==","shasum":"f8828592cc2f7c7e93049c1e22d83c8f5cf1ce07","tarball":"http://registry-npm.ywwl.com/yggdrasil/download/yggdrasil-1.5.1.tgz","fileCount":16,"unpackedSize":29114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgE3XGCRA9TVsSAnZWagAAtuoP/0GA7pzcnzdpAXGSaCKM\nMa/S0QCbWAU5Z9LkX9HX/50QZUdt3ShtwRs7sfL/+w/XQlzz11/ahPdKLST2\niLVIrbBJo4/WEA633IT2XNTe20go8eoALma93hpjdyLrZE4lnu8wXwiG1l2v\nRrzZOZV8bNGQx21+MMk2udIdzYqNHJpLVeoAbWCeUbpYvfitrmz2gWc3U2ji\nVX9k66rbqroCKsyZoYCSJb40+vBI56onpSuuRAM2WkingyyusM8EKnXxd1Oi\nzASoO4BXwjEQHPCk/mDH8BpDJUNUC12lb1xM9UUxqOjVFI5P1KxQWjGDAhut\nqd7iHSBn4Aqs+Vf+uY2ziJtOLUU8J3FtlsGjrIBCo98y1BrwHSi2EkTNNCR+\n1cKYNpMYuhJN8VgWS7gYJEwWpzp4zhn6e8tKmMXMvvIU+7t0aRdMnc1USTzI\nvAHkeQHZ9lDQ4gg3Gf1YUXBDOGjJU/hnD5cqv2wGO0MHr5Fr18P7W6k2hBpO\n7wN7kG7GdXOzfe25NWNPi6BFJKUEAXAnpatFgT6mymcdKO3eqiQm1MvD9EB+\nAar6DVdUFvFsRIZjp5BOJuQZ98xi+UFMVtoeVQAEXpQ5fUwy6j2dTXmC6+Dw\nDotmevsOm9khNJi849hZVzvMHQNeS4fUkpjlkA8eyKoxdjm2OrqkcfxxUmrQ\nRF6p\r\n=a4Aq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwq2ZTLu2+0xDHL+rsjhstWRgzXarWkJGnZPvxV2mqPAIhANHlU2xzVaRjlWzBs+/Q3TVfuQxifjZcncXgG4Qx/38M"}],"size":7875,"noattachment":false,"key":"/yggdrasil/-/yggdrasil-1.5.1.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.5.1_1611888069942_0.8258968588492634"},"_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":1611888070174,"_cnpm_publish_time":1611888070174,"dist-tags":{"latest":"1.8.0"}}