{"_id":"@alohahealth/micro-bluebutton","_rev":"4-c78c382c835966150470c3b48baab82d","name":"@alohahealth/micro-bluebutton","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@alohahealth/micro-bluebutton","version":"0.1.0","description":"CMS Blue Button 2.0 OAuth for ZEIT Micro","main":"index.js","scripts":{"example":"micro example.js","test":"xo"},"repository":{"type":"git","url":"git+https://github.com/alohahealth/micro-bluebutton.git"},"author":{"name":"Adam Barry","email":"adam@alohahealth.net"},"license":"MIT","devDependencies":{"eslint-config-prettier":"^6.3.0","xo":"^0.25.3"},"peerDependencies":{"micro":"^9.3.4"},"dependencies":{"micro-redirect":"^1.0.0","request":"^2.88.0","request-promise":"^4.2.4","uuid":"^3.3.3"},"xo":{"spaces":2,"extends":"prettier"},"gitHead":"03a0957a5362f560c2cc8f3254e7718a8f684696","bugs":{"url":"https://github.com/alohahealth/micro-bluebutton/issues"},"homepage":"https://github.com/alohahealth/micro-bluebutton#readme","_id":"@alohahealth/micro-bluebutton@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-X1Z9wotKJHCN+L7bFEBfuorI+qxF0mJmJu3KHu6B0TRK3qlB0OXjc5dnpxPGWpsmaegwJWUjkrGvBZBGWEd/qg==","shasum":"6cf0812c7aeeb827faccb2e11dd9fbb8bec7fbf8","tarball":"https://registry.npmjs.org/@alohahealth/micro-bluebutton/-/micro-bluebutton-0.1.0.tgz","fileCount":5,"unpackedSize":7318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmJDZCRA9TVsSAnZWagAAX5IP/00ztwvFpAZdiZ/1Vsf3\nX698RCayYpyOUPqQXh820qXqVPNG2LEHZJZWEB82ZLR6Jve9hNrhDxz0+52o\nwNYCwDKp3kPm0MFOOnSObu22Szl0vK9T3O3Gk8EqRJjS2u54yKNKqvrZkyxZ\nxQvQ9JtOsqsR4wArrhx6gEEq6TKu/FWFbh5WBiEk2lye+EGJIZhXhWCpug5i\nyyVPnkCXYOf+t5kiyjDjIuvD/dbAQlJ8QRfw/VBqUmN/TY/vvh+c17MUGLJU\nVMz5616n/r/3O+Ha+wTXreAMXMBfzGVjXCIsrMfvOUh7JxUE445ohRUkX+GE\n5D4ni1HwUriopDc3a0lxNQR5qf5HVdFoZDmneC4nGGExnCDXzA5W6z2r2KTi\nP4FS+KL1r7AXBzBn9i8UTKhxdUXETw2YxBDwhsr9j4jRdi3CqclT5/bRn/IR\nsw5FNpz/g/nWFMQymHdbo5UWb18r/g276BH4IEUXutVWT6OvRhWLjn8LIikl\nVDp7x5dYjhupkftDKZQdmYd5hTPw3g6WN4ogjhnMoJoQcnat1IoKWJx/TjoJ\n2pECYkWfXEbKjTl9m+0apEGf9mr9T48URI0t+rcnPT4OnbfSMkuTP4OdMiV8\n/TK72bza24AjnktZmVaJ4JTOAhB/CXKuGmKWmN32iwofXQxy31yt3M/QUA94\nbB9t\r\n=3sOF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvv6Izd6nvACU0qhFgmPS+MRBpOQyNS1h8AXsjiitlDgIhAIe8D840QrQdJV2ESTyLtES2wRcOgWUxDOTwAUxmcG9e"}]},"maintainers":[{"name":"ajbarry","email":"adam@alohahealth.net"}],"_npmUser":{"name":"ajbarry","email":"adam@alohahealth.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-bluebutton_0.1.0_1570279641055_0.3926168203008835"},"_hasShrinkwrap":false},"0.1.1":{"name":"@alohahealth/micro-bluebutton","version":"0.1.1","description":"CMS Blue Button 2.0 OAuth for ZEIT Micro","main":"index.js","scripts":{"example":"micro example.js","test":"xo"},"repository":{"type":"git","url":"git+https://github.com/alohahealth/micro-bluebutton.git"},"author":{"name":"Adam Barry","email":"adam@alohahealth.net"},"license":"MIT","devDependencies":{"eslint-config-prettier":"^6.3.0","xo":"^0.25.3"},"peerDependencies":{"micro":"^9.3.4"},"dependencies":{"micro-redirect":"^1.0.0","request":"^2.88.0","request-promise":"^4.2.4","uuid":"^3.3.3"},"xo":{"spaces":2,"extends":"prettier"},"gitHead":"59b9461e0c7749625af627be231a74413e852e6e","bugs":{"url":"https://github.com/alohahealth/micro-bluebutton/issues"},"homepage":"https://github.com/alohahealth/micro-bluebutton#readme","_id":"@alohahealth/micro-bluebutton@0.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-KRcS+JNy7DrSwB3/izhYUj0WLiJEkhptCcyJWfr2enwkrUnMrofpOgU5Ul2OjwP1hnlPOyiTMmNtDD/nOQ9HKw==","shasum":"afaf715df75b8a7a7586b1298cd774ff57aaa4c9","tarball":"https://registry.npmjs.org/@alohahealth/micro-bluebutton/-/micro-bluebutton-0.1.1.tgz","fileCount":5,"unpackedSize":7172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmJNdCRA9TVsSAnZWagAAXzQP/0ENBEws0sxHP8sEyxum\n5PvKhmbRclwo0hSxEXUxuJPm/XG3gCxbSdL+MJhIjhvPUBMijVWVOyAMmUc4\nh+WJ4kPrurkWf83nj4AePvgpELGW5TBDhBGnMR4ApzWS48UiphXKhAmpJm4k\n9EN9WDJvwqnlZQf3pA75uEN7b1+CKNmtxJHh2l16u8YZNabyHaCJAUj2b57Z\nqAJeLZb4pyrDqXzxrDwfozwKU2S0opUA8l7bWlmaJezJApSp+laTN2C3FTS7\niHzOu0XkcLUkYblzguFF5Pik4PYIjKXBwoZ6HAYR90zymg9qhcStgAtlynrb\nqHnoEHdNCxaN4Alv4ijr5Ou7QIdwzkaExL17PSmgLdIriF85hMOPnkZ0hjF6\n4nK9l/qIUNU4HgktoEku7FZESqX5MyjC+iYVsCr3XHJgNL/u7qM4LTvU1J1s\nsS+tVH1oMqM/38eISKxfdAOR1AYzxQm8zv1Un+/ZFHdcb5+heAiRyj7ifoK6\njF4ed1F5DyxoaHkIOJxNASOi1TwIvnSqAqtf3zT65cQbtBWfWYVIwiW8XI17\n4iqpeUlUlW0FzutOgV6uNdQLo89eQOkkLWTxauh2+KkwN95RGRPO0rWCcle4\n4gCeWaA+fvhm7jrJ70sw7yaXWNGaF9NZrASGCN2muFt2AntA4MwfiSd7gM0D\nQjOJ\r\n=K+71\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAncv1yi319RY1dq97Klwg/6loxegs1fJ6EWM8MZaZqLAiEAwdnnN/vCFW8Xy/MTyUKd98ZJ52Led+OZzw69Xv55sOk="}]},"maintainers":[{"name":"ajbarry","email":"adam@alohahealth.net"}],"_npmUser":{"name":"ajbarry","email":"adam@alohahealth.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-bluebutton_0.1.1_1570280284334_0.20718006032583047"},"_hasShrinkwrap":false},"0.1.2":{"name":"@alohahealth/micro-bluebutton","version":"0.1.2","description":"CMS Blue Button 2.0 OAuth for ZEIT Micro","main":"index.js","scripts":{"example":"micro example.js","test":"xo"},"repository":{"type":"git","url":"git+https://github.com/alohahealth/micro-bluebutton.git"},"author":{"name":"Adam Barry","email":"adam@alohahealth.net"},"license":"MIT","devDependencies":{"eslint-config-prettier":"^6.3.0","xo":"^0.25.3"},"peerDependencies":{"micro":"^9.3.4"},"dependencies":{"micro-redirect":"^1.0.0","request":"^2.88.0","request-promise":"^4.2.4","uuid":"^3.3.3"},"xo":{"spaces":2,"extends":"prettier"},"gitHead":"2337679c2e0b5b091a27413bfe4e4f2832b93a19","bugs":{"url":"https://github.com/alohahealth/micro-bluebutton/issues"},"homepage":"https://github.com/alohahealth/micro-bluebutton#readme","_id":"@alohahealth/micro-bluebutton@0.1.2","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-5BSNHZiD2gt3/6IWU595T4or1+WCGgI9SLfKqelvbM2eflcpEIm02LbWwpP58MXv5YXA+LKHzWIGWEoTkxGXuQ==","shasum":"403cbb7daa64c0e0c0298d2e04067a1496c51d16","tarball":"https://registry.npmjs.org/@alohahealth/micro-bluebutton/-/micro-bluebutton-0.1.2.tgz","fileCount":5,"unpackedSize":7164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmJRHCRA9TVsSAnZWagAABg0P/iISGDhPSJr4SPBy6xKn\nutr8M1riBPXXBqcwn8T/4FjYQNN5YKlxhVtm/dhkQiW5YgsZjNrNq1Bkab3V\nAgFeB0dQootzD2bJZydzA5uOrZKov8XYO+3X45BKI9KeYedswGN2HG9do+IH\n4XoJ3NNyq1PeSh/iHk+e0nG+j7EzJZehaxTnv7srxC2HcCi64pVuGY2zFloo\nc6nwNfA9f7usNnM4ksB0AZ9bIcSDoyNpwoSB3vGUnxgivkLfCY+cGVqIjSNm\nQAUcxgSa19OUPs65wPvrJvIzAfa57E3UoC+MWyOundJsWvNRYo9bKZ2/JXDD\nZmITt5GzNWK/HmK1FLCUEbVjsbVNKWFur8mKCk1G61+djleNebj3GY54Ynye\nsA+OrLw36i/QBsWKYLz9FS8hmOXANO08qS6GjDsXyeGNKg2bhJz95cFwVLoa\ngAYu4bqEH6ce9vPJg2RZEJyKFUBSpvsRvJ26cvdvetqWAHk6cDkl7KSrQ+T6\njyc4IF1qEqvBjFqDykfJVdJvXqsy55f8IHehZN0KbUNwu95QA5RC/FdVYo35\nDbRKu7b61ClQyj//0KuICDOFZGHDRoR2mgbncGmy52riZUhw5wUQtxaS5rRR\n74J+6t41KE+Ync4P+I1TRPz8wIuWKq+hdGLxNUo/zffaqhDSpOhb1Bkzvh9Y\n7xOr\r\n=sX4N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0GFQ+pJzUUxfvY9GWiaQ2lSi1tmC3/xBVCr9RMAJT3gIgdJhmDx/QcVTMvYlTChPXHzvIlOKlbn/979lSVP2KOkg="}]},"maintainers":[{"name":"ajbarry","email":"adam@alohahealth.net"}],"_npmUser":{"name":"ajbarry","email":"adam@alohahealth.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-bluebutton_0.1.2_1570280519343_0.568280947161933"},"_hasShrinkwrap":false},"0.1.3":{"name":"@alohahealth/micro-bluebutton","version":"0.1.3","description":"CMS Blue Button 2.0 OAuth for ZEIT Micro","main":"index.js","scripts":{"example":"micro example.js","test":"xo"},"repository":{"type":"git","url":"git+https://github.com/alohahealth/micro-bluebutton.git"},"author":{"name":"Adam Barry","email":"adam@alohahealth.net"},"license":"MIT","devDependencies":{"eslint-config-prettier":"^6.3.0","xo":"^0.25.3"},"peerDependencies":{"micro":"^9.3.4"},"dependencies":{"micro-redirect":"^1.0.0","request":"^2.88.0","request-promise":"^4.2.4","uuid":"^3.3.3"},"xo":{"spaces":2,"extends":"prettier"},"gitHead":"a58ea944e3b45c0c7ebae5cce580dd3d0dbe58bd","bugs":{"url":"https://github.com/alohahealth/micro-bluebutton/issues"},"homepage":"https://github.com/alohahealth/micro-bluebutton#readme","_id":"@alohahealth/micro-bluebutton@0.1.3","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-AWTHTgfrFN8sEiJQvRKdcBRuUJfWCnH5I3XjyvR95lKqZHO7aRmWUqbrG/nhxUCGR2N+iIl6NfpFrQIcd0hMhA==","shasum":"a07a9c58d4de9a7989dc5ef79e6009014dd5b56a","tarball":"https://registry.npmjs.org/@alohahealth/micro-bluebutton/-/micro-bluebutton-0.1.3.tgz","fileCount":5,"unpackedSize":7190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmJb8CRA9TVsSAnZWagAAqnwP/jVAjY63EQ7/oylhJ6+1\ng0BJBTw50T+j7eTzx+tFCdKmgAhgapyw5tD9/ZQ9o3erc2QK6S1C++GqxqsJ\n4lEsBB0GntnRESKyO+FxEm+Nmr+HO9Kk2izeb5/Cu2FxsNK/BjEalhvLzOyL\nhgSgnV4Ibpx40ifb7OzG+aDRVoWzCsSJahyHPDM/Nv+ivRFN3pq14naKP6qo\n3y32uRaBZbjlVjIDvo6GxKLbDJObjP18Gmom6MA4wuioI7LpUWN8UyPf38X6\ny7v//36L2FDC4TE03mm8Es829ZyLeiW82iX31jWTCHcGvbQXAp80CCtYoV5E\nGiD6WhXDk1EQrEUfjU8p5tullOAU/dD5iINQ5/l+sxNb08ExuLHb6kZCA7+q\n/bIHstK/th6JTCSS4wiavpNKIxEzRNDKVB1VnsYD6Xfppv7EJiUg7oFvGQFY\nO+ZGkbTl6xWZxrhYaki6BgvVU8stg13Fu5cmslkpIsoeaiIiqdQ8JNEgjww+\nX3QvrUkGexSbHqWmVzYOS1k+/s+2Lq1ul582JBigl5HnPNGeD60h5o3OaiDj\n23YUAg73NMXk4iRPb/e/WK7QG8wKK48nKqD9iorCPhjoxojlivIWJiQDg7XG\nUFt3JXMgp0nYkgCu+gOSskQZU7NkkBdZB63qebD/E8YYjR24jVqe5UpEQYxC\n8fUp\r\n=ulkx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCesSCTP8/yp6K7k6O7airHTUwEKocJNL1qivYzABlDYgIhAK9qqRV30cQmLerCUGVHvlEmirGrb8o9mt+KtK8qW4a/"}]},"maintainers":[{"name":"ajbarry","email":"adam@alohahealth.net"}],"_npmUser":{"name":"ajbarry","email":"adam@alohahealth.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-bluebutton_0.1.3_1570281212288_0.41155537211715965"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-05T12:47:20.884Z","0.1.0":"2019-10-05T12:47:21.262Z","modified":"2022-04-04T13:36:51.508Z","0.1.1":"2019-10-05T12:58:04.473Z","0.1.2":"2019-10-05T13:01:59.494Z","0.1.3":"2019-10-05T13:13:32.400Z"},"maintainers":[{"name":"ajbarry","email":"adam@alohahealth.net"}],"description":"CMS Blue Button 2.0 OAuth for ZEIT Micro","homepage":"https://github.com/alohahealth/micro-bluebutton#readme","repository":{"type":"git","url":"git+https://github.com/alohahealth/micro-bluebutton.git"},"author":{"name":"Adam Barry","email":"adam@alohahealth.net"},"bugs":{"url":"https://github.com/alohahealth/micro-bluebutton/issues"},"license":"MIT","readme":"# micro-bluebutton\n\n## [BlueButton 2.0](https://bluebutton.cms.gov) OAuth Client for [ZEIT micro](https://github.com/zeit/micro/)\n\nAdd [CMS BlueButton 2.0](https://bluebutton.cms.gov) authentication to your [micro](https://github.com/zeit/micro/) service in just a few keystrokes.\n\n> This module is graciously borrowed from, but not affiliated with the [microauth](https://github.com/microauth/microauth) collection.\n\n## Installation\n\n```sh\nnpm install --save @alohahealth/micro-bluebutton\n# or\nyarn add @alohahealth/micro-bluebutton\n```\n\n## Usage\n\n1. Register your application client on the [Developer Sandbox](https://sandbox.bluebutton.cms.gov/v1/o/applications/)\n1. Create the following micro app as `app.js`:\n\n```js\nconst { send } = require('micro')\nconst microBlueButton = require('micro-bluebutton')\n\nconst options = {\n  dev: process.env.NODE_ENV !== 'production',\n  clientId: 'CLIENT_ID',\n  clientSecret: 'CLIENT_SECRET',\n  callbackUrl: 'http://localhost:3000/auth/bluebutton/callback',\n  path: '/auth/bluebutton',\n}\n\nconst blueButtonAuth = microBlueButton(options)\n\n// Third `auth` argument will provide error or the results of authentication\n// so it will { err: errorObject } or\n// { result: {\n//     provider: 'bluebutton',\n//     token: { /token response object },\n//     user: { /userinfo response object },\n// }}\nconst handler = async (req, res, auth) => {\n  if (!auth) {\n    return send(res, 404, 'Not Found')\n  }\n\n  if (auth.err) {\n    // Error handler\n    console.error(auth.err)\n    return send(res, 403, 'Forbidden')\n  }\n\n  return `Hello ${auth.result.user.name}`\n}\n\nmodule.exports = blueButtonAuth(handler)\n```\n\nRun:\n\n```sh\nmicro app.js\n```\n\n1. Visit `http://localhost:3000/auth/bluebutton`\n1. Enter USERNAME: `BBUser00000` and PASSWORD: `PW00000!`\n1. Click the ALLOW button when prompted by Blue Button\n1. See `Hello Jane Doe` as the response\n\n## Author\n\n[Adam Barry](https://github.com/ajbarry)\n","readmeFilename":"README.md"}