{"_id":"@getmocha/users-service","_rev":"11-b9de5595ff3608e71fef5ca7c365781d","name":"@getmocha/users-service","dist-tags":{"staging":"0.0.3-dev.0","latest":"0.0.4"},"versions":{"0.0.1-dev.0":{"name":"@getmocha/users-service","version":"0.0.1-dev.0","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"name":"Mocha"},"license":"MIT","_id":"@getmocha/users-service@0.0.1-dev.0","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"cb8120906291dc579be61aa13dab67aff5d08d9f","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.1-dev.0.tgz","fileCount":4,"integrity":"sha512-sIDiSz2fJYdvZZbJVr7GybC0FTi0uXv+1Lm+/YIjwd+ABK6PO7MOhkhxyc8dBDB8/scw/HgwCEYD08DzdvwSoA==","signatures":[{"sig":"MEUCIE7fMq/rhMZklHQu+mvKJB2/ywyHnJHjgatsS0gJ5KBIAiEAiQyVXKqSiKOp/YY+l4u8hBuOLEdCix5qwhA/yqak56o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15416},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1d153ae5aae09a10c459b9e7a1139ff1cc5c4380","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.67","hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"zod":"^3.0.0","hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.1-dev.0_1750365592099_0.0533384547767346","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-dev.1":{"name":"@getmocha/users-service","version":"0.0.1-dev.1","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.1-dev.1","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"e2f1b70e9dc2324198a6042b8f32cda9e5693c73","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.1-dev.1.tgz","fileCount":5,"integrity":"sha512-ObROiaf6ozxaYav7d3l9fPvLOW3+d61YQyWWKDwHYyz7c/M6S4D+0W6343RhJH1r3nA8GTJoRboUQnMgeTDavQ==","signatures":[{"sig":"MEUCIDCArxaxQnkNzUML+7bwuMM6MaSf8x7qKhF25Ffk1wvtAiEAiJtDbvGRHWyDioxG/WOorjDY+R9L1bUQ2LOh8e9cmio=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24658},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7b2cda5efcf60c5e8d487f23603f7f4f1d340545","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.67","hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"zod":"^3.0.0","hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.1-dev.1_1750366960755_0.36800103698805575","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-dev.2":{"name":"@getmocha/users-service","version":"0.0.1-dev.2","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.1-dev.2","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"8f0634d6e8040345fdfc95678171d5689feedb9d","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.1-dev.2.tgz","fileCount":5,"integrity":"sha512-t7wqDVEebJnTFavCu5MWjtz1b3Cyz884wBZC30wobJZZ9qwkAE0WsaDDOeRCl/4Drz1SWck2rJPpA/NdoQ6MBw==","signatures":[{"sig":"MEUCIQDtY/ihNRE4ikVK3W00nWS6wK2VLT84Rr+WveXbZLEeGgIgfT+oHP9xkHuenKMBQ2EmNq7NU9m9QKJ8llKrhrTW3QA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24775},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"9732b2cb45f5240f19b7e9aa67a611140ea69696","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"zod":"^3.25.67","hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"zod":"^3.0.0","hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.1-dev.2_1750372491553_0.5090709081351323","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-dev.3":{"name":"@getmocha/users-service","version":"0.0.1-dev.3","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.1-dev.3","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"9f84f2f6ed6584ff8f7d4627521ef7398f3df6e3","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.1-dev.3.tgz","fileCount":7,"integrity":"sha512-w4sEwVn+lVNXEEj+qeS3eT1aw/+b5BB3LLSFLaW1EWv0BpJFLQPg7WcRoIOUXPGciMMjmCzviY1ERDVS7Ne51w==","signatures":[{"sig":"MEQCIHM/crSvokL2tpIUz/FxFKgck5lsng+KTYJx1tuq7G/yAiBZPFhjOjIgF/NBQi472Yg7v2mqvweY5OKfKONoix0lig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23028},"type":"module","exports":{"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"1e1d0c5ac8c85212bd1917730bdbd2ccf3b426d9","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.1-dev.3_1750375285918_0.5479679210225201","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@getmocha/users-service","version":"0.0.1","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.1","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"7fcee96bffcfc3fb60a801f7f1909f23aa777604","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.1.tgz","fileCount":7,"integrity":"sha512-WFavYxllXsByv/iv7m9mfSPOu/Gwf7dNTXaEDPDytQS95YBLeuWYXnssxUGx4ozhPDKnEDJyzflAzgQqcSGahw==","signatures":[{"sig":"MEYCIQCuiu1vlVQawauop9nA5rZBHiVhIDrqzYhAPvkg7hDg8wIhAIZWV5SzjUEwi5OSWJKFJWkehi/AHnYU1NhhTb3ezVv/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23022},"type":"module","exports":{"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"76d20a87142464e4f8acad30a0df207f0499ee5a","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.1_1750376336672_0.865034571939215","host":"s3://npm-registry-packages-npm-production"}},"0.0.2-dev.0":{"name":"@getmocha/users-service","version":"0.0.2-dev.0","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.2-dev.0","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"da38012cb8beb8ed2a653b7592a9b547f1c31c40","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.2-dev.0.tgz","fileCount":7,"integrity":"sha512-cJyzxOqXMtmeJ4CiGRiLFo8gthyNpFYuY+melyN8G0KVqf1D5w0WDP6aYGkx+uJsy8ap99Nk2s4JX25R1nPRLQ==","signatures":[{"sig":"MEUCIQCADkdyXA2ShpJFDb3DOpbPDPxslG5LS0UcIKp+Z8aGNgIgLsXiNw2ZS74rnRAJtuyPdQcp/TGia+IMoY53x8GFVfY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24834},"type":"module","exports":{"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"977110bf86f28f1d42e40b13529bd93aa60af566","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.2-dev.0_1750386289257_0.8541674951858134","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@getmocha/users-service","version":"0.0.2","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.2","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"e94491e315c84ef72af1d28dec42d9064f2d41a8","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.2.tgz","fileCount":7,"integrity":"sha512-0yPuYBrzQIMypBPG46nkUpxt97zbEpMFcmiTN973agfHraCnTkC7JssWxeWdSt/aLZsVn1D3aiFQWQ/gmn1TJQ==","signatures":[{"sig":"MEUCIFMJKmg+M+OxnSbKFJkwmKJ8M8DEHld9/KTmE3mqlyHcAiEAvyYFc+Y4K58YcHGn+Xovkcg10eQuHyNrgor8fpK9JzU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24946},"type":"module","exports":{"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"6419fd3a7960d83599707bad75fbfbbdb780d884","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client and Hono middleware for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.8.0","prettier":"^3.5.3","typescript":"^5.8.3"},"peerDependencies":{"hono":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.2_1750386922111_0.8415636006093012","host":"s3://npm-registry-packages-npm-production"}},"0.0.3-dev.0":{"name":"@getmocha/users-service","version":"0.0.3-dev.0","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.3-dev.0","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"a3f68eb62f9c6b2b87e125629d5ddaf9645171ca","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.3-dev.0.tgz","fileCount":9,"integrity":"sha512-SxFoy3irUklCdoeREO8TMR2wgcixe+8tWvjEsYBzKL7wQI7Fj8TIkTUsXmPZDu6Xa+77gSgPeoS+bHxxCuXYpw==","signatures":[{"sig":"MEQCIAyDTUI5LF+91pZLTqoWFO+s972NJfBoBBWIVUDb0g5AAiAowNZqPOaJOHKSi0MxiT+PPlKjiHw+mfGVCFhClKBL9g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33279},"type":"module","exports":{"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"07741a21189d40d95337520b3da2aba60f7a7f90","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client, Hono middleware, and a React provider for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"react":["./dist/react.d.ts"],"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"hono":"^4.8.0","react":"^18.0.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/react":"^18.0.0"},"peerDependencies":{"hono":"^4.0.0","react":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.3-dev.0_1751067443452_0.8378804562380184","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@getmocha/users-service","version":"0.0.3","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.3","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"46b502747a23c45000c162177262c44ac57613e5","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.3.tgz","fileCount":9,"integrity":"sha512-xMAvOTl/M54FXzMNt82ZWO01gDeABp241ChSbRLdB7ahDMUSGh+OypYvJgZEG5EUjYc9rHvnPdYbWyR9vSmuvw==","signatures":[{"sig":"MEUCIQC04s5+j5DgJ2b5UmP3uXPu3tcUxwBEOVkQ7OsbD6AoPwIgVDFf5Iu+qXXa+nlI8/XnjDkzBkfBZv+3yrwRPep6EmI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34321},"type":"module","exports":{"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"2a3cc9c5903740e7b5259d6232b976d5f79428f5","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client, Hono middleware, and a React provider for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"react":["./dist/react.d.ts"],"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.8.0","react":"^18.0.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/react":"^18.0.0"},"peerDependencies":{"hono":"^4.0.0","react":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.3_1751213684496_0.01784792982400263","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@getmocha/users-service","version":"0.0.4","keywords":["mocha","users service","auth","authentication","oauth"],"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","_id":"@getmocha/users-service@0.0.4","maintainers":[{"name":"benjreinhart","email":"benjreinhart@gmail.com"},{"name":"drtangible","email":"danielcgilbert@gmail.com"},{"name":"nichochar","email":"nicholascharriere@gmail.com"}],"dist":{"shasum":"94b53002be5fa24c0e85f76f1790dd67d246120e","tarball":"https://registry.npmjs.org/@getmocha/users-service/-/users-service-0.0.4.tgz","fileCount":9,"integrity":"sha512-KJamJbc1c+1uWPZnYZyiv/6SALsKY5Ou0btw3pb0hHgUtd5EaKMd4jpaXfln2ln3LyDXdrY0IiY2GSKgtvgeWg==","signatures":[{"sig":"MEUCIQCB+tsfPPldmXWQziIpikQvE+c/BoPWBwZKsMaaj7IpFgIgXpxhCYnekifxZ0uh/XDVQo9O6cXcYC5n3b3Y3F0XxLU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34332},"type":"module","exports":{"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./backend":{"types":"./dist/backend.d.ts","import":"./dist/backend.js"}},"gitHead":"308fe3a1af1b10ce384b576bb8e232f7c8273de2","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rm -rf dist","prebuild":"npm run clean","check-format":"prettier --check .","prepublishOnly":"npm run build && npm run check-format"},"_npmUser":{"name":"benjreinhart","actor":{"name":"benjreinhart","type":"user","email":"benjreinhart@gmail.com"},"email":"benjreinhart@gmail.com"},"_npmVersion":"10.7.0","description":"An API client, Hono middleware, and a React provider for the Mocha Users Service","directories":{},"_nodeVersion":"22.1.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"react":["./dist/react.d.ts"],"shared":["./dist/shared.d.ts"],"backend":["./dist/backend.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.8.0","react":"^18.0.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/react":"^18.0.0"},"peerDependencies":{"hono":"^4.0.0","react":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/users-service_0.0.4_1751370514737_0.5432947977105476","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-19T20:39:51.954Z","modified":"2026-01-26T21:02:54.703Z","0.0.1-dev.0":"2025-06-19T20:39:52.304Z","0.0.1-dev.1":"2025-06-19T21:02:40.962Z","0.0.1-dev.2":"2025-06-19T22:34:51.738Z","0.0.1-dev.3":"2025-06-19T23:21:26.111Z","0.0.1":"2025-06-19T23:38:56.851Z","0.0.2-dev.0":"2025-06-20T02:24:49.462Z","0.0.2":"2025-06-20T02:35:22.288Z","0.0.3-dev.0":"2025-06-27T23:37:23.651Z","0.0.3":"2025-06-29T16:14:44.678Z","0.0.4":"2025-07-01T11:48:34.956Z"},"author":{"url":"https://getmocha.com","name":"Mocha"},"license":"Apache-2.0","keywords":["mocha","users service","auth","authentication","oauth"],"description":"An API client, Hono middleware, and a React provider for the Mocha Users Service","maintainers":[{"email":"odonnell.reilly.j@gmail.com","name":"reillyjodonnell"},{"email":"benjreinhart@gmail.com","name":"benjreinhart"},{"email":"danielcgilbert@gmail.com","name":"drtangible"},{"email":"nicholascharriere@gmail.com","name":"nichochar"}],"readme":"# @getmocha/users-service\n\nAn SDK for interacting with the Mocha Users Service, providing authentication and user management functionality for Hono and React applications.\n\n## Installation\n\n```bash\nnpm install @getmocha/users-service\n```\n\n## Features\n\n- Google OAuth authentication via the Mocha Users Service\n- Session management\n- User information retrieval\n- Hono middleware for protected routes\n- A React context provider and associated hook for managing user and authentication state in React apps.\n\n## Usage\n\n### Backend Authentication Flow\n\nUse the @getmocha/users-service/backend export for backend functionality and Hono support.\n\n1. **Get OAuth Redirect URL**\n\n```typescript\nimport { getOAuthRedirectUrl } from '@getmocha/users-service/backend';\n\n// In your API handler\napp.get('/api/oauth/google/redirect_url', async (c) => {\n  const redirectUrl = await getOAuthRedirectUrl('google', {\n    apiUrl: c.env.MOCHA_USERS_SERVICE_API_URL,\n    apiKey: c.env.MOCHA_USERS_SERVICE_API_KEY,\n  });\n\n  return c.json({ redirectUrl }, 200);\n});\n```\n\n2. **Exchange Code for Session Token**\n\n```typescript\nimport {\n  exchangeCodeForSessionToken,\n  MOCHA_SESSION_TOKEN_COOKIE_NAME,\n} from '@getmocha/users-service/backend';\nimport { setCookie } from 'hono/cookie';\n\n// In your API handler for the callback\napp.post('/api/sessions', async (c) => {\n  const { code } = await c.req.json();\n\n  const sessionToken = await exchangeCodeForSessionToken(code, {\n    apiUrl: c.env.MOCHA_USERS_SERVICE_API_URL,\n    apiKey: c.env.MOCHA_USERS_SERVICE_API_KEY,\n  });\n\n  // Set the session cookie\n  setCookie(c, MOCHA_SESSION_TOKEN_COOKIE_NAME, sessionToken, {\n    httpOnly: true,\n    path: '/',\n    sameSite: 'none',\n    secure: true,\n    maxAge: 60 * 24 * 60 * 60, // 60 days\n  });\n\n  return c.json({ success: true });\n});\n```\n\n3. **Protect Routes with Auth Middleware**\n\n```typescript\nimport { authMiddleware } from '@getmocha/users-service/backend';\nimport { Hono } from 'hono';\n\n// Create your Hono app\nconst app = new Hono();\n\n// Use the middleware to protect routes\napp.get('/api/protected-route', authMiddleware, async (c) => {\n  // The user is available in the context\n  const user = c.get('user');\n\n  return c.json({ message: `Hello, ${user.email}!` });\n});\n```\n\n4. **Get Current User**\n\n```typescript\nimport { authMiddleware } from '@getmocha/users-service/backend';\nimport { Hono } from 'hono';\n\n// Create your Hono app\nconst app = new Hono();\n\napp.get('/api/users/me', authMiddleware, async (c) => {\n  const user = c.get('user');\n  return c.json(user);\n});\n```\n\n5. **Logout**\n\n```typescript\nimport { deleteSession } from '@getmocha/users-service/backend';\nimport { Hono } from 'hono';\nimport { getCookie, setCookie } from 'hono/cookie';\n\n// Create your Hono app\nconst app = new Hono();\n\napp.get('/api/logout', async (c) => {\n  const sessionToken = getCookie(c, MOCHA_SESSION_TOKEN_COOKIE_NAME);\n\n  if (typeof sessionToken === 'string') {\n    await deleteSession(sessionToken, {\n      apiUrl: c.env.MOCHA_USERS_SERVICE_API_URL,\n      apiKey: c.env.MOCHA_USERS_SERVICE_API_KEY,\n    });\n  }\n\n  // Delete cookie by setting max age to 0 These params must match the ones\n  // used when setting the cookie, except max age (0) and the cookie value ('').\n  setCookie(c, MOCHA_SESSION_TOKEN_COOKIE_NAME, '', {\n    httpOnly: true,\n    path: '/',\n    sameSite: 'none',\n    secure: true,\n    maxAge: 0,\n  });\n\n  return c.json({ success: true }, 200);\n});\n```\n\n### Shared\n\nUse the @getmocha/users-service/shared export for functionality that can be used on the frontend or backend.\n\nFor example, the `MochaUser` TypeScript type.\n\n```typescript\nimport type { MochaUser } from '@getmocha/users-service/shared';\nimport { Hono } from 'hono';\n\ntype Variables = {\n  user?: MochaUser;\n};\n\nconst app = new Hono<{ Bindings: Env; Variables: Variables }>();\n```\n\n### Frontend React package\n\nUse the @getmocha/users-service/react export for a React context provider and hook that provides user and authentication management.\n\n```tsx\nimport { AuthProvider } from '@getmocha/users-service/react';\n\nexport default function App() {\n  return (\n    <AuthProvider>\n      <Router>\n        <Routes>\n          <Route path=\"/\" element={<HomePage />} />\n          <Route path=\"/auth/callback\" element={<AuthCallbackPage />} />\n        </Routes>\n      </Router>\n    </AuthProvider>\n  );\n}\n```\n\nThen you can use the exported `useAuth` hook.\n\n```tsx\nconst {\n  user,\n  isPending,\n  isFetching,\n  fetchUser,\n  redirectToUrl,\n  exchangeCodeForSessionToken,\n  logout,\n} = useAuth();\n```\n","readmeFilename":"README.md"}