{"name":"yggdrasil","version":"0.3.0","author":{"name":"Zeke Sonxx","email":"zeke@zekesonxx.com"},"description":"Mojang authentication (Yggdrasil) client","scripts":{"test":"node node_modules/mocha/bin/mocha -R spec","lint":"node node_modules/eslint/bin/eslint -f tap ."},"main":"./lib/index","repository":{"type":"git","url":"git+https://github.com/zekesonxx/node-yggdrasil.git"},"bugs":{"url":"https://github.com/zekesonxx/node-yggdrasil/issues"},"keywords":["minecraft","yggdrasil","authentication"],"dependencies":{"request":"^2.79.0","uuid":"^3.0.1"},"license":"MIT","devDependencies":{"eslint":"^3.14.0","eslint-config-standard":"^6.2.1","eslint-plugin-promise":"^3.4.0","eslint-plugin-standard":"^2.0.1","mocha":"~1.18.0","nock":"~0.27.2","should":"~3.1.3"},"gitHead":"278d30077a439af92f2794296cade23974ea0f8e","homepage":"https://github.com/zekesonxx/node-yggdrasil#readme","_id":"yggdrasil@0.3.0","_npmVersion":"5.2.0","_nodeVersion":"8.1.4","_npmUser":{"name":"zekesonxx","email":"zeke@zekesonxx.com"},"dist":{"integrity":"sha512-T2THXCYkvtvjaRM4XjZrIGWeoYcK8Pw2UG1DvHaniD6WgL0zLz0Jlb0/LzlOpx2kwvcViWlA4o39X5+og0U3zA==","shasum":"5b6c1fa4ef86d17c80781d1131a80faa5e4e35d0","tarball":"http://registry-npm.ywwl.com/yggdrasil/download/yggdrasil-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb1Q0m8aQVJTQNDZo754FmWXg8Fl/hi27U8m8P++gSdwIgT7/LYCpf1J5v6gVBwO6JTFilkg5G1En0VZam+b6Y3oY="}],"size":17931,"noattachment":false,"key":"/yggdrasil/-/yggdrasil-0.3.0.tgz"},"maintainers":[{"name":"zekesonxx","email":"zeke@zekesonxx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yggdrasil-0.3.0.tgz_1499891250551_0.05794364772737026"},"directories":{},"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":1499891251588,"_cnpm_publish_time":1499891251588,"dist-tags":{"latest":"1.8.0"}}