{"_id":"@bluebeela/nextjs-shopify-auth","_rev":"9-2f7de7455f26218a202c5f401e5df556","name":"@bluebeela/nextjs-shopify-auth","dist-tags":{"main":"1.0.1","latest":"1.0.2"},"versions":{"0.2.1":{"name":"@bluebeela/nextjs-shopify-auth","version":"0.2.1","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"b7cb7c445cdfcc3ecfb4428c5aa8f159e3c2ce8e","_id":"@bluebeela/nextjs-shopify-auth@0.2.1","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JtO3G4mrJv37eNsqpMjBWAEuRPaoZB7VazOgD+6ADqzC8uYQUZrgi2kPuaKkZI9EHKTcsbYo63a5kJCYGi5sJA==","shasum":"2f31a27a405504faa60b5dd2ff4b87adbf60bed5","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-0.2.1.tgz","fileCount":110,"unpackedSize":112850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzPp2CRA9TVsSAnZWagAA/QYP/RL55V7aE0FH+gpFXWmD\nq5xr/oRzKKT4SlNyzXVOMNdUGc67cQMVc5XS8JhR8ipk/nV4JziLPi9yEVUi\nSi3gMbwjDRyFs2uU101gMEXSDL+fciop32Kr99XXjZnjmsYXbt1NntzqAW38\nByos+HB84oAM1k8TcFm/NPij6KeQCZtdw+1YkyL/Cs+19g2S9G3M63LYmPLQ\nYJPmIRQd7qG1+ZDmpP9DaUkjSg0528bae7VCTXqByKoA+5F7XYrUgi3yFiZu\n3O2U3VFCkyuX1skWNxoLV7euS9nYEKrYODwmQtjqbut6FH6sNlVpVHf/f84/\nWWHwMnhsvR8LOntx+9izCsNH5s8+2g/9k823Y2bGwn+fS1s4ILkgqjFMGs/s\ns+vqpOcG+WE607cUY21f6ctJmElv2QU12+obNUQzaqCK0uvAr+0JH8PVFSwr\n6oL5zrCKkf58nbuUOgffEJjzKbdpP77fU9KksFua97qwBykbGTXErQZpHoTK\nyIcnNPnR6WXoJJYyst+zHcCYCMlBr/uOTmd+ixuLv7yA/kGttIlBKdn1xuP1\nYVU72a9ScunM1n9YAqKH/nW9h8a5Ebq0+AzXk7hgPly3jqJgn2BClDEil6Z1\nmqXGwL3DnlC8RvMBSxCFfkpa+usL2fdTsSXE/WOjZfr+sgPnc3b86uQyMK6x\naQSr\r\n=Z6Ho\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFUhUJ2yQRztPcP7e96km1Jis7BUCzOft48xrIEaHtBfAiEAqTSrqeqqOiwFQc14g8YLbdFQRHV35lpckz/vFMSI5dM="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_0.2.1_1607268982011_0.955801794963667"},"_hasShrinkwrap":false},"0.2.2":{"name":"@bluebeela/nextjs-shopify-auth","version":"0.2.2","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"b94a36a911b7ad8896ff66a959780b65302a10ca","readme":"ERROR: No README data found!","_id":"@bluebeela/nextjs-shopify-auth@0.2.2","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-o10rnv5h2qkJ9EcHK3Fem21uQ2sqi9eNgQqLh3yo6t62CBwTpJpstTyzyFKn7VAPdlN6a5KkfTtoC7UNygdyJg==","shasum":"1994dfb6fe6429df955c2dcc096b6e4684216886","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-0.2.2.tgz","fileCount":110,"unpackedSize":112842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzQGACRA9TVsSAnZWagAA2yoP/j+7IDSz7dG6ov6S0r6U\nb1DoCdyotB/FxwQzRXfMneEIcln2yu06LMVbE4+yTmwsTXv9C4AEDsZaaGPn\ncqhayu1KBcKh8zyZZ4v3Kdqm1aPQvUavUlZkXKsOpfX7bmbmnFxJzR8GPhth\nYKCobxvUeU9IDzmXnhv78iVhmEuFebOHRQtkq+IPT9Bd6BWOBw5A78jX3RWY\nwc5MNfKmy8kZ7Zrd1s5R4Csw2J2KWvQ3xD52cdnCn06xyl/qUb1hW5wilXwH\n+ULtm9BeB4udzJSWUyiC5kLAmF4GOKCkZuaLr6t8/yfM+Z00J0Az8cbns9Y7\n7UiUHAdDmZcEsPDKfu/F2hkotLRAVhix15fj3mUTTlKiW1Frd/FBfcGaUfLx\nvhPY78lbWu0p5c/sinFDZMirU4YczdQH9voNvJ1xFPkm7SennhqmrFEeh5AJ\nNoe+ZnGHg5YnIyreinnDcNuq2WCY20PK3jUidZro2l+JyNQkwZk0w/cUgwmp\nc5YQ3Onp3+VTzEFeP4a3oWgj2lZbrEAfUvIVauGP0y3Us71ZJHh86xn5v/Lv\nuNKhpWwmxyh7anzndBC6i1ve0kFUvMCKtgL/RVSQ1dY2FMDsI2ReKa3R3sak\nn09OkU0B36LwvteBLSHzNslOEaCszeEszpEUDN6NET4Rt8939AY3/2Sc6kkm\nAwwl\r\n=hax3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCQ9QVeovUk0fV931i0iSNJxbe5ttCUYOUgsFgi5h9fQIhAN6n/b+YUdxb4520QwfHh/HUfvhO6UuG23HU05iaprip"}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_0.2.2_1607270783450_0.48130703504727634"},"_hasShrinkwrap":false},"0.2.3":{"name":"@bluebeela/nextjs-shopify-auth","version":"0.2.3","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"db3c6135a0ac4360ded3ff322e68b4d2ffedc26d","readme":"ERROR: No README data found!","_id":"@bluebeela/nextjs-shopify-auth@0.2.3","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9XC2KuU9N1RVUn6NTmrF5ZIMAqlgEKYyg+m4V1RmEbgtHMAJ37W2iu1/asurfAGIml52JGgd2NFGKUhDOz5yuA==","shasum":"4a1e68cd976512adaebb64da4133fe1a9ff4416f","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-0.2.3.tgz","fileCount":110,"unpackedSize":112834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzQT8CRA9TVsSAnZWagAA7NIP/3b8EZgtHP4x1PqqcxVV\nKmGVpcXL0Hf5OQanLgjFGv/RUDyVFL89IT1v2b6B2o/s9GqdtrkpYEXMNjy0\nSuth3HgAk3AZmglVUmDmw47CKL+p5ZYAS3Q4wSHampRG6w5f0O9PUnJgSDYO\nQ00wmWxpOkw7m0WSsaT/9uhnNPsckBzxJ14STsFG+JWdj1blLsm/3JgfSO5Z\njOnIJ/8/yEAKmRMrDSza9H6rD4NmNZJZyYe07m93/lBcDzGYxEHVWmRM33yD\nZj1eeX6EKNq32mf9J+oNBYYrcSTCuP15IS1lkziRkuQqPRTz45hY+YWwgLwZ\nPP6jijbbdBeZ1Bb3dWGLdYK4S8Mh5L/Im0+nfI2aAgbwsq+zMqpGDWbl85WZ\nRTnfDLxSA5Y3rshdoqNwXWO9i+++O+vQaBwhir11+Su0i76x0nrT6jusYMgl\nSud+esSD3j/iMI+yYSGEYuqy1F3xZEJsRSnQm5abNsGc6YYUGsf2Ldr/L+LT\njXt6NBMPkHItNSFiy4b4iNPa/c6g+pxGsk5EaDWRObOYwcH98NoebBx5H7Hz\n9b9Rt2QMDfWm+3VqAOkGIhdIG9KT3EgFhrCHOgIex4lElsUQdaPBuuCS+Mo1\nYwqSgD6MllQQyXO8yDXh974shodTodkFBNWqnZv+I+40UquQWT3whwSVmEuD\nMToI\r\n=tKHq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIIJ5Z7rJw2ssgV2yccF28/XSP28bYtAeFw+HuLF0eVQIhANOXrtyAOPro9jK/0x61WK74EGZqfeflyrs9jV2knpwv"}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_0.2.3_1607271675857_0.9597795562218396"},"_hasShrinkwrap":false},"0.3.0":{"name":"@bluebeela/nextjs-shopify-auth","version":"0.3.0","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"8d2110c96ff5dfed6fafb63a59ba05f3d967fc0a","readme":"ERROR: No README data found!","_id":"@bluebeela/nextjs-shopify-auth@0.3.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-U72S9OzycBGo1q7gQIVvA6rs23/TTaw7PV3eDFnH9lyJRaNdkw0tgCGYPTGr+INgWwQ21E4nuHgMsiRS0E6Hwg==","shasum":"58f20ff1351adc175432dfd7dead9efb646b3b2d","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-0.3.0.tgz","fileCount":110,"unpackedSize":112806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzRYGCRA9TVsSAnZWagAAzAYP/A3aWhN3spiUY8fS8kvt\nCvbRuR8+qoe7hl5vstsESWEE487xGeMjEthue1pStMvsEV3DBUdnO9MJ5wt1\n/gRO/BGvmbk/hqE0BYMWYAaUZDun7YQ46PlDnTSV3YbmxgUxRudcRqbgorSt\n6heFZmKEgrdLKUnjAE6CAEofKFHA1NHtCPwjTbaf+EACVkSspFUkqal/hnh5\nAAtEc2yzbUMPBnWN9V7x7JR/WeTyhJiD7MIqSsjDmHd2pMfqfli5jMS0lfOO\nVie7LmwB5bc9Yh6ziJE5ck6+BKtFdtKYtafZJyIjDQBKDoXUPnOJNjtnTY/H\n1dpr1uuJdzp30l0CojqDf2XhIVgEbWmQEhRvUZIYGHWFV1pNuh6SDJCYxeYR\nXESzRCoZ6B/tRbjsyOGvDZlG1/Y6hfXcpS8TgC9dQdZSwzK/asP9QCDkKQB/\nGuKhazRD8l8wyAcZi08PSCZR427I8m0LdmrbC9BE7ZPn8k5shN5NnwugHQd/\nLYPYuIzBWl1MHvUW4CCZqvmuqewPiGJCIDOhOxex3Vf6NMObChIJ+dMZ2MRK\n/FbNj7KeWwxFTVXaMwlaZGimQ+412CABHLw5CG9/6KY/BQgKgoYXbE7GcCRc\nr1AD8C9+UsFhI4aU+JfysHCGfP7GOPOFo6MnZhdAibYGg/MxcBbQrrEooHxR\np82F\r\n=rzSe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3YAxNWu7UT3XAmmI3t81EON2oDBbgVQF4mVXnjlOxZAiEAtnJj7REAdD30ukEUoJ3SsyRgFAq3Hu/+Z1R5U7V3TCk="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_0.3.0_1607276037912_0.2693884345009474"},"_hasShrinkwrap":false},"0.4.0":{"name":"@bluebeela/nextjs-shopify-auth","version":"0.4.0","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"4436754d6b32530dd345dfa237613dbb3208227c","readme":"ERROR: No README data found!","_id":"@bluebeela/nextjs-shopify-auth@0.4.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-h0kjvjbHw7n2s1c5oUX3Hpnzyctbvt7IkFVGuceaisYp7ovkazqkvAoLlMOxT5OJDVrqiFwYot+k7SyQDVFvcw==","shasum":"8c74caae88033eec62243d3ca2face0f62e5f4ee","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-0.4.0.tgz","fileCount":86,"unpackedSize":89413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzfJbCRA9TVsSAnZWagAAaGMP/3yIs37Jfg9gC368ZeIP\n+NdOCD60JNiGGoAlSNiyNDZlXewktt1HKzqQTDzZY6VS5cNerAEfyzC/CQCG\nxTumOVeMlnPbTCDH/a6PBHF8kcOqyjWOEhYgxoU3MwehIeQZ88WfDVqWCpSU\nw6eAYZ7Xq/L6iaCFWVBVa+tq3eR2kkQgpAwz86YX87dfi6B0UR6NyH/bOfwY\nqLy7Z9S2qzc+jXVUmzjv5w4jUB1dLTslhMsjTlHQ5DaNnXGpR9q938/matgs\nbYYq+DGGKoe3Lhag4PY6Zc8f5O6ocMHvSta9IbkNSQbXLmxgBeQTKETEO+Mn\nFsSUktNf8i5j5kULsg6lfmzLHAXhJmlI3qy9MilXPAx/n004I7atpUrHdoTZ\ncKFcyya5lz8D9c6rB+xyugT0iXaxuuzripFrNstGlfv0JXpu4kACceWU6gf8\nVe1soW2lu7o0mBMJr4MYqjYpCI6iITf38eWY1IUZ0h+HX6oii3stWmc89I3e\nZNHbHyGsuKr5k97tU2jKs/dFOtI6f36Wa+pgOXWrL0wDPpd33HlIilUvM/6Q\ncogEoR67uriBrvHdl2rMoSFf+qx7ciBPX7PVRIczwd9d7cOjqOP/ITGbGqz5\nkulDaD/JfCAQ6d4hKEsaTQKZCablo8ulneQmZXk7nw7Zte0OBdPTCTzxgVFW\nzvjx\r\n=lPQM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHt89qz/ZNIBowAKiYsDAdQnNbDHhpFQu3e8tpmlDHKSAiBcbxbKd9qsY93t5j3MvQAU39VsLrnmnOO0d6Ksby1nAA=="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_0.4.0_1607332442560_0.1678374583308222"},"_hasShrinkwrap":false},"0.5.0":{"name":"@bluebeela/nextjs-shopify-auth","version":"0.5.0","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"6111262bf78f3d984024d20769a322a1a45f23e1","readme":"ERROR: No README data found!","_id":"@bluebeela/nextjs-shopify-auth@0.5.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-CY6V3GLsgYX7l/wRqW6ROCe0HcHzHfLf20ohMSENQ8ucYOQR6agNMIm1UWh0Eqa33vu5t5n46PGnOFORNwP96g==","shasum":"eca8288f1d4ae4932f3dabaf50877c1910a7892a","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-0.5.0.tgz","fileCount":86,"unpackedSize":90730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzhwxCRA9TVsSAnZWagAAin4QAJYmTK+puzyem6N8WMBM\nSPZ1l9zz3vWg6OXXFKC2V+67VzynkK8TDrZ4jU4+YHCAroHoCFLdrpVjDKn1\nMFVC8jXiA57PMtaX8nVB+nGbw3l7t25nyVWzLD6CFqmKvFEtD+jN5jL45tyl\nIhMFEfMWm7W0cR6ETM/Nn/yzXw1n7SS6OVONH515PBhMjThXJ+WTyKNF8ZPf\nZc9vGILeWmPW0rOu0XdHia5Ps+aSStJsfGbga9m5Ba8IZfIOpYlGHn3SqIvh\nEEQ3h6B9j1SsgKUO5MivMLgn5RgUJhesWhZAYjKo2AGDWO5ts181SYXShO5A\nEP56WORiTvIDYPr0XJeLnhIsV2X34NkP+/5qhEPYpyhbG+Ei4oOTEfjMQKWH\nS9Bhy/pNTkulBBhAnAVJ8bpmRcB3qUste4ablNHo6P479dF4lSc5LZXSQObB\nkIcps0sj2RnHcNn3j25aSpptgpV2+m4wnyyYsPNl/2g6nHLrxkHHFlclULFv\nTtjg01VdtEXWp2yhLI/xaTHZ8psHD8g8oLYMZpOZIcAcRexSe/q8wJDKtovL\nnKEc8LKBYBFPZHEDYiBWCXas6LWgH2B+mqH/ORxwj1EadKNiVbtiAVHl5MpP\nnJEwPEh2fF62NgfFUULsWXQtrHRs25TFj9sQ5HdEPRxYrpMGw6czyA5B4QCO\nPYBo\r\n=WN0J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlejqSfthP9jx9bVKOsN0SFp22VrlbgcuEmnBBhrrreAiEAunxkZpKc9Zos+k/nMFIDsVR0vJzHcif1YuEGYOiAxsw="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_0.5.0_1607343153179_0.7392671375021254"},"_hasShrinkwrap":false},"1.0.0":{"name":"@bluebeela/nextjs-shopify-auth","version":"1.0.0","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"readme":"# `@bluebeela/nextjs-shopify-auth`\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\nAuthenticate your [Next.js](https://nextjs.org/) app with [Shopify](https://www.shopify.com/).\n\nSister module to [`@shopify/shopify-express`](https://www.npmjs.com/package/@shopify/shopify-express) and [`@shopify/koa-shopify-auth`](https://www.npmjs.com/package/@shopify/koa-shopify-auth), but for nextjs.\n\n### Missing features\n- Registering webhook\n- Listening to webhook\n\nA example app without the webhook for the [Build a Shopify app with Node and React](https://developers.shopify.com/tutorials/build-a-shopify-app-with-node-and-react) tutorial is available [here](https://github.com/bluebeel/nextjs-shopify)\n\n\n\n## Installation\n\n```bash\n$ npm install @bluebeela/nextjs-shopify-auth\n```\n\n## Usage\n\nThis package exposes `createShopifyAuth` by default, `authenticateShopifyPage`, `authenticateShopifyAPI`, and `NextShopifyApiRequest`, as a named export.\n\n```js\nimport createShopifyAuth, {authenticateShopifyPage, authenticateShopifyAPI, NextShopifyApiRequest} from '@bluebeela/nextjs-shopify-auth';\n```\n\n### createShopifyAuth\n\nReturns a set of helpers that you will need to use in 4 different routes explained below.\n\n```js\nconst shopifyAuthOptions = {\n  // your shopify app api key\n  apiKey: process.env.SHOPIFY_API_KEY,\n  // your shopify app secret\n  secret: process.env.SHOPIFY_API_SECRET,\n  // your app url\n  appUrl: process.env.HOST,\n  // if specified, mounts the routes off of the given path\n  // eg. /api/shopify/auth, /api/shopify/auth/callback\n  // defaults to \"\"\n  prefix: \"/api/shopify\",\n  // scopes to request on the merchants store\n  scopes: [\"read_products\", \"write_products\"],\n  // set access mode, default is \"online\"\n  accessMode: \"online\",\n  // callback for when auth is completed\n  async afterAuth({\n    shopOrigin,\n    shopifyToken,\n    shopifyAssociatedUser,\n    req,\n    res,\n  }) {\n    console.log(\n      `We're authenticated on shop ${shopOrigin}: ${shopifyToken} with user ${JSON.stringify(\n        shopifyAssociatedUser\n      )}`\n    );\n    res.writeHead(302, { Location: `/` });\n    res.end();\n  },\n};\n\nconst shopify = createShopifyAuth(shopifyAuthOptions);\n```\n\n#### in pages/api/example-api-route-you-want-to-protect.js\nSimply add the authenticateShopifyAPI middleware to your route to verify that the request is secure.\n\n```js\nimport { authenticateShopifyAPI } from \"@bluebeela/nextjs-shopify-auth\";\n\nexport default authenticateShopifyAPI(async function helloWorld(req, res) {\n  return await res.json({ hello: \"world\" });\n});\n```\n\n#### in pages/protected-page.js\nSimply add the authenticateShopifyPage middleware to your route to verify that the request is secure.\n\n```js\n// random page\nimport { authenticateShopifyPage } from \"@bluebeela/nextjs-shopify-auth\";\n\nexport const getServerSideProps = authenticateShopifyPage(async (ctx) => {\n  return { props: { hello: \"world\"}}\n});\n```\n\n### Required API routes\n\nIn a Next.js app, you will need to create these 5 routes:\n - /api/shopify/auth/callback\n - /api/shopify/auth/enable_cookies\n - /api/shopify/auth/index\n - /api/shopify/auth/inline\n - /api/shopify/verify-token\n\nTheses files will need the following content for the authentication and verification processes to work as expected\n\n#### /api/shopify/auth/callback\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthCallback(req, res) {\n\tconst { oAuthCallback } = shopify;\n\n\tawait oAuthCallback(req, res);\n}\n```\n\n#### /api/shopify/auth/enable-cookies\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthEnableCookies(req, res) {\n\tconst { enableCookies } = shopify;\n\n\tawait enableCookies(req, res);\n}\n```\n\n#### /api/shopify/auth/index\n\n```js\nimport {\n  hasCookieAccess,\n  shouldPerformInlineOAuth,\n  grantedStorageAccess,\n} from \"@bluebeela/nextjs-shopify-auth\";\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthIndex(req, res) {\n  const {\n    enableCookiesRedirect,\n    oAuthStart,\n    topLevelOAuthRedirect,\n    requestStorageAccess,\n  } = shopify;\n\n  if (!hasCookieAccess(req.cookies)) {\n    await enableCookiesRedirect(req, res);\n    return;\n  }\n\n  if (!grantedStorageAccess(req.cookies)) {\n    await requestStorageAccess(req, res);\n    return;\n  }\n\n  if (shouldPerformInlineOAuth(req.cookies)) {\n    await oAuthStart(req, res);\n    return;\n  }\n\n  await topLevelOAuthRedirect(req, res);\n}\n\n```\n\n#### /api/shopify/auth/inline\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthInline(req, res) {\n  const { oAuthStart } = shopify;\n\n  await oAuthStart(req, res);\n}\n\n```\n\n#### /api/shopify/verify-token\n\nThis is a simple proxy route to avoid CORS issues we would face by hitting Shopify API from a different domain\n\n```js\nexport default async function verifyToken(req, res) {\n  const { shopOrigin, shopifyToken } = req.cookies;\n\n  const response = await fetch(\n      `https://${shopOrigin}/admin/metafields.json`,\n      {\n        method: \"GET\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"X-Shopify-Access-Token\": shopifyToken,\n        },\n      },\n  );\n  res.status(response.status).end();\n}\n```\n","readmeFilename":"README.md","gitHead":"04ee1afd187b9317f46c4ecc04c8703c13179853","_id":"@bluebeela/nextjs-shopify-auth@1.0.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-y0RRK3pLyhVEQrkVvJ1EEtH0AgYU89VX/hZ/yaM3IsvIRl/T1H7tK7S/SPRtujdis751h599ABpYJh0bJPiX0g==","shasum":"d5d617601d10694c1a62c2985c3612356d5e7980","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-1.0.0.tgz","fileCount":87,"unpackedSize":96082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzlUICRA9TVsSAnZWagAAI2QP/ji604yr66RT3AHodzZS\n/at4E7rbWzcC+L1DrcA5fe9AF3MfUtoGvq6OE/uZhnCqgAZ92eGytvsUEjAu\nk3whwUGSpBmbtV2K+xgZSUD0RYVPgfZEP7fE4x0iOR+FYEvACCzzfvcQjIUT\naYasKs4eVyApn7TYqJvnM9+MxatnzaqpEA1iob0CVCQ1HMUzSbrJokXt9Moe\nWpD8qWUymEX6t/8K+JnF1xw/4jlDHfJ8LkVuHMbafxHsBTBiItFcxCkb/etb\ncsGaXXw4t6ahaTITC35NYIZSwLA1bFgggDvvNzG48nzcWoa7JVn/NEPog41T\n0TAutIR2/Pbn0gfIg6FENc8mKzHbAD0F3j8xW9IRSfXlLkRGMjY3BdbSCiSl\nMdfG6DNm23aS7hOhms8Te5Nb8ilSb/SRhkKtcRpndXKQmwPDtUMWVfhfw6aV\njRcR8RNtlckZS7c7gOQ0AxK0uMdrsGQuUPMJcHwI4RgbGo58O3H/dVW/OnPm\n75GGQMB38c/CYI1w70m3D6ytw2rJXhGp6LXmp76B7Q424m5aGzlu7e9N7tVD\n1tSMN7wPiXnHoB7npeHH/oA3thjeqqfBRFiVPWHd4JntI+vJNUr/YdUd87e5\nJ91aNQ4cUyxECqqATuehrzYupp5TJnnjsTDwWVX/HANQ4/OZCcJuoTmnf5+B\nizFk\r\n=NOVB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFpAzdXmcS/QAQwrXA0fnlw6GDZDSmhts60VOoi5WUtVAiAp/0NHeyPaJN/nBl8zemgOIX9CJnELYEiDrN5yhUtXfg=="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_1.0.0_1607357704171_0.9841065147950308"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bluebeela/nextjs-shopify-auth","version":"1.0.1","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/blob/main/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"readme":"# `@bluebeela/nextjs-shopify-auth`\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\nAuthenticate your [Next.js](https://nextjs.org/) app with [Shopify](https://www.shopify.com/).\n\nSister module to [`@shopify/shopify-express`](https://www.npmjs.com/package/@shopify/shopify-express) and [`@shopify/koa-shopify-auth`](https://www.npmjs.com/package/@shopify/koa-shopify-auth), but for nextjs.\n\n### Missing features\n- Registering webhook\n- Listening to webhook\n\nA example app without the webhook for the [Build a Shopify app with Node and React](https://developers.shopify.com/tutorials/build-a-shopify-app-with-node-and-react) tutorial is available [here](https://github.com/bluebeel/nextjs-shopify)\n\n\n\n## Installation\n\n```bash\n$ npm install @bluebeela/nextjs-shopify-auth\n```\n\n## Usage\n\nThis package exposes `createShopifyAuth` by default, `authenticateShopifyPage`, `authenticateShopifyAPI`, and `NextShopifyApiRequest`, as a named export.\n\n```js\nimport createShopifyAuth, {authenticateShopifyPage, authenticateShopifyAPI, NextShopifyApiRequest} from '@bluebeela/nextjs-shopify-auth';\n```\n\n### createShopifyAuth\n\nReturns a set of helpers that you will need to use in 4 different routes explained below.\n\n```js\nconst shopifyAuthOptions = {\n  // your shopify app api key\n  apiKey: process.env.SHOPIFY_API_KEY,\n  // your shopify app secret\n  secret: process.env.SHOPIFY_API_SECRET,\n  // your app url\n  appUrl: process.env.HOST,\n  // if specified, mounts the routes off of the given path\n  // eg. /api/shopify/auth, /api/shopify/auth/callback\n  // defaults to \"\"\n  prefix: \"/api/shopify\",\n  // scopes to request on the merchants store\n  scopes: [\"read_products\", \"write_products\"],\n  // set access mode, default is \"online\"\n  accessMode: \"online\",\n  // callback for when auth is completed\n  async afterAuth({\n    shopOrigin,\n    shopifyToken,\n    shopifyAssociatedUser,\n    req,\n    res,\n  }) {\n    console.log(\n      `We're authenticated on shop ${shopOrigin}: ${shopifyToken} with user ${JSON.stringify(\n        shopifyAssociatedUser\n      )}`\n    );\n    res.writeHead(302, { Location: `/` });\n    res.end();\n  },\n};\n\nconst shopify = createShopifyAuth(shopifyAuthOptions);\n```\n\n#### in pages/api/example-api-route-you-want-to-protect.js\nSimply add the authenticateShopifyAPI middleware to your route to verify that the request is secure.\n\n```js\nimport { authenticateShopifyAPI } from \"@bluebeela/nextjs-shopify-auth\";\n\nexport default authenticateShopifyAPI(async function helloWorld(req, res) {\n  return await res.json({ hello: \"world\" });\n});\n```\n\n#### in pages/protected-page.js\nSimply add the authenticateShopifyPage middleware to your route to verify that the request is secure.\n\n```js\n// random page\nimport { authenticateShopifyPage } from \"@bluebeela/nextjs-shopify-auth\";\n\nexport const getServerSideProps = authenticateShopifyPage(async (ctx) => {\n  return { props: { hello: \"world\"}}\n});\n```\n\n### Required API routes\n\nIn a Next.js app, you will need to create these 5 routes:\n - /api/shopify/auth/callback\n - /api/shopify/auth/enable_cookies\n - /api/shopify/auth/index\n - /api/shopify/auth/inline\n - /api/shopify/verify-token\n\nTheses files will need the following content for the authentication and verification processes to work as expected\n\n#### /api/shopify/auth/callback\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthCallback(req, res) {\n\tconst { oAuthCallback } = shopify;\n\n\tawait oAuthCallback(req, res);\n}\n```\n\n#### /api/shopify/auth/enable-cookies\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthEnableCookies(req, res) {\n\tconst { enableCookies } = shopify;\n\n\tawait enableCookies(req, res);\n}\n```\n\n#### /api/shopify/auth/index\n\n```js\nimport {\n  hasCookieAccess,\n  shouldPerformInlineOAuth,\n  grantedStorageAccess,\n} from \"@bluebeela/nextjs-shopify-auth\";\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthIndex(req, res) {\n  const {\n    enableCookiesRedirect,\n    oAuthStart,\n    topLevelOAuthRedirect,\n    requestStorageAccess,\n  } = shopify;\n\n  if (!hasCookieAccess(req.cookies)) {\n    await enableCookiesRedirect(req, res);\n    return;\n  }\n\n  if (!grantedStorageAccess(req.cookies)) {\n    await requestStorageAccess(req, res);\n    return;\n  }\n\n  if (shouldPerformInlineOAuth(req.cookies)) {\n    await oAuthStart(req, res);\n    return;\n  }\n\n  await topLevelOAuthRedirect(req, res);\n}\n\n```\n\n#### /api/shopify/auth/inline\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthInline(req, res) {\n  const { oAuthStart } = shopify;\n\n  await oAuthStart(req, res);\n}\n\n```\n\n#### /api/shopify/verify-token\n\nThis is a simple proxy route to avoid CORS issues we would face by hitting Shopify API from a different domain\n\n```js\nexport default async function verifyToken(req, res) {\n  const { shopOrigin, shopifyToken } = req.cookies;\n\n  const response = await fetch(\n      `https://${shopOrigin}/admin/metafields.json`,\n      {\n        method: \"GET\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"X-Shopify-Access-Token\": shopifyToken,\n        },\n      },\n  );\n  res.status(response.status).end();\n}\n```\n","readmeFilename":"README.md","gitHead":"1008ffbfe4aa2ab759642699944dd1653f228fe0","_id":"@bluebeela/nextjs-shopify-auth@1.0.1","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EODRsEvLZmO4XJBmpUXBB0dC5204JDuBS9RHg2zizcy11aA3cVOp12LfUptFd8f6KZoGkHkJoTS7Fc0G3jdi8Q==","shasum":"e898bdf8739bc9598229497fab499d009304c0bc","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-1.0.1.tgz","fileCount":87,"unpackedSize":96092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6U0CRA9TVsSAnZWagAAGtMP/0rgleyq8B6SHrKWM36P\nma7InTsiVrQU+kB8UKaqbmjw3udFxvMRgLlOpMFW/RUiYDpflZvCZmOk70TG\nYluDtt5D/IW9+e9afc1wkJ4PwPQ8w+jCQ0XpZd978p/MDcFHUZ+2pI/yDVsm\nmhKRAheW8KXhSHhUIFnIR5a7uDA/6tod1RD2j2UTcrL67m+uozpgilYcqZ5f\nyIgeYQHJThtg53ENFL7wDRDTcOdR0c6TfHZvIFIroubmGWhGA/3MpUAg/msG\nv8RYaZYRTeJ56ydi1kc9fkNYeApPUi6B8M/EsjvX2RLuupgQ/ugx/0nTANcl\nm3zWffiqvMk169AV26aLk9YRMpg7mvH4M1LpaU3yMMK2ncYAMROUNXiVihqZ\nPOMIjP+0ST6uPd05NQgk46hJMwSjjNPx/eN327w09zhcMQEiyQtULN8IJfgW\nlFC90MVsRTfOQ5IfhKwZa3K4MB1ycZxCajuWnAXSGJ8AAiBGqXDju4T4ZOcl\ngM7SpbSpugmnfg3pC9IMIsfW+kdd5AgAWaBtr+A7vvfke/JO76LQp5Xyv4yD\nR27W2b9/gLZXgGMySmzvjNuECLSam/ddteNKXmTlmc3znG4Q0nNPknOqm2y+\n306rVFUacsAqlNEPD3DUy9jvGUlzNkj3GksrUXbNl+dRc8zcIjCob2WOd43u\nFEsF\r\n=J656\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKMnGb+I7i3Pryp2umPs7thRvYchQhzWkNalb9BgctZAiANUJKl1rmdOKuTQznr44+RH2nSQHaOr/Y2UJH0TaMvyw=="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_1.0.1_1607443763638_0.02397647944651693"},"_hasShrinkwrap":false},"1.0.2":{"name":"@bluebeela/nextjs-shopify-auth","version":"1.0.2","license":"MIT","description":"Middleware to authenticate a Nextjs application with Shopify","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist","test":"jest","build":"tsc","lint":"eslint","prepublishOnly":"yarn run clean && yarn run build"},"publishConfig":{"access":"public"},"author":{"name":"Bluebeela"},"repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"homepage":"https://github.com/bluebeel/nextjs-shopify-auth/blob/main/README.md","dependencies":{"@shopify/network":"^1.5.0","cookie":"^0.4.1","next":"^10.0.3","nonce":"^1.0.4","nookies":"^2.5.0","tslib":"^1.9.3"},"devDependencies":{"@shopify/jest-dom-mocks":"^2.9.1","@types/cookie":"^0.4.0","@types/node":"^14.14.10","babel-preset-shopify":"^21.0.0","eslint":"^7.8.1","jest":"^26.4.2","node-fetch":"^2.6.0","typescript":"^4.0.2"},"sideEffects":false,"gitHead":"b2b20dea53a7d92e211ea816b6dbb3bccd9bda4f","_id":"@bluebeela/nextjs-shopify-auth@1.0.2","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-WwPlpEB0JjlEbUaBMG+DNI9mXr44hWbWrNvc0QRDym32P70QRglOjQD9nlvn1tZBUw1r8WcorwiBSQNKUgLzSg==","shasum":"00ffeedb57ecc4735896be481e2d410721712893","tarball":"https://registry.npmjs.org/@bluebeela/nextjs-shopify-auth/-/nextjs-shopify-auth-1.0.2.tgz","fileCount":87,"unpackedSize":96092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6cPCRA9TVsSAnZWagAA6BMP/iHgaFGVNo8+d/LmwuY0\nJ7ClP8CLiIAxPcLhKQnYEAbH+7HowWZwJ9sjXmZv7bwIEBN5OV6sO+rhhpVA\nDzot1U2A/lKbLD6rC8kKmiga1DOQGM4ID7PuNJCL5lrP1KO5+bTy+2P1okCk\nj+2FAXqY4UUFQuUCe3DFykqTvFt9ZslNr190ocjAgYA5HX3I+gofc/Xu9QgL\npo1hHOf2XwG/Wt1tXzHQcemIWA2AZxFrVpz9wIpbKDHx0vEatDhGxGHRIBZ7\ncNBSIwFBQaLMEW4XO4w9Wblpb7bIS25csKjpyGRbiu2g1VfBvRw4hc1SC/A0\n6JybdhE22Xn/rQriSa3zIqfKXhLyAu8eXx2wNxZ7+9N+GpgDIvgi8aMIhtJY\nCnMgktIFlVGqtz25MjFoiIOUkyBmOhT1gTEEKk62lIodRgvyNzKipFXU6y9H\nNpG76HiKdbyEYLehP48IlW0GKge0RdPIm/1zpK6aJa1EYPxArmmnylHXx8Bf\nGfdfXKxHYHGrw0Pm1XKcOEds7BTGH9uzDPB4A9B41/zdISYwxrlvMNwMv+aT\ndp6fP/coib4LIuDlUCB2R8m0oq+nAvMybfzd/iE0hqIxaSuwtWNVBDy8uuYt\nEFsm6ibQ1YKisf+iPg8ThWckYQ2P9X0eq+QiWQgzslz1ee3b7D1lhNEsq1uK\nUjmJ\r\n=uoSM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID4T+O8Fuabul9pyrFYbrJKBEGihTzne4mM6aYFmq9r9AiEAnAe58qe23b/BlycjWvD6M6Szr3CXbW9795ZwiR35Xw0="}]},"_npmUser":{"name":"bluebeela","email":"sbluebeel@gmail.com"},"directories":{},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs-shopify-auth_1.0.2_1607444239004_0.9904564428390235"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-06T15:36:21.962Z","0.2.1":"2020-12-06T15:36:22.179Z","modified":"2022-04-04T19:44:17.151Z","0.2.2":"2020-12-06T16:06:23.642Z","0.2.3":"2020-12-06T16:21:16.034Z","0.3.0":"2020-12-06T17:33:58.073Z","0.4.0":"2020-12-07T09:14:02.748Z","0.5.0":"2020-12-07T12:12:33.310Z","1.0.0":"2020-12-07T16:15:04.312Z","1.0.1":"2020-12-08T16:09:23.774Z","1.0.2":"2020-12-08T16:17:19.144Z"},"maintainers":[{"name":"bluebeela","email":"sbluebeel@gmail.com"}],"description":"Middleware to authenticate a Nextjs application with Shopify","homepage":"https://github.com/bluebeel/nextjs-shopify-auth/blob/main/README.md","repository":{"type":"git","url":"git+https://github.com/bluebeel/nextjs-shopify-auth.git"},"author":{"name":"Bluebeela"},"bugs":{"url":"https://github.com/bluebeel/nextjs-shopify-auth/issues"},"license":"MIT","readme":"# `@bluebeela/nextjs-shopify-auth`\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\nAuthenticate your [Next.js](https://nextjs.org/) app with [Shopify](https://www.shopify.com/).\n\nSister module to [`@shopify/shopify-express`](https://www.npmjs.com/package/@shopify/shopify-express) and [`@shopify/koa-shopify-auth`](https://www.npmjs.com/package/@shopify/koa-shopify-auth), but for nextjs.\n\n### Missing features\n- Registering webhook\n- Listening to webhook\n\nA example app without the webhook for the [Build a Shopify app with Node and React](https://developers.shopify.com/tutorials/build-a-shopify-app-with-node-and-react) tutorial is available [here](https://github.com/bluebeel/nextjs-shopify)\n\n\n\n## Installation\n\n```bash\n$ npm install @bluebeela/nextjs-shopify-auth\n```\n\n## Usage\n\nThis package exposes `createShopifyAuth` by default, `authenticateShopifyPage`, `authenticateShopifyAPI`, and `NextShopifyApiRequest`, as a named export.\n\n```js\nimport createShopifyAuth, {authenticateShopifyPage, authenticateShopifyAPI, NextShopifyApiRequest} from '@bluebeela/nextjs-shopify-auth';\n```\n\n### createShopifyAuth\n\nReturns a set of helpers that you will need to use in 4 different routes explained below.\n\n```js\nconst shopifyAuthOptions = {\n  // your shopify app api key\n  apiKey: process.env.SHOPIFY_API_KEY,\n  // your shopify app secret\n  secret: process.env.SHOPIFY_API_SECRET,\n  // your app url\n  appUrl: process.env.HOST,\n  // if specified, mounts the routes off of the given path\n  // eg. /api/shopify/auth, /api/shopify/auth/callback\n  // defaults to \"\"\n  prefix: \"/api/shopify\",\n  // scopes to request on the merchants store\n  scopes: [\"read_products\", \"write_products\"],\n  // set access mode, default is \"online\"\n  accessMode: \"online\",\n  // callback for when auth is completed\n  async afterAuth({\n    shopOrigin,\n    shopifyToken,\n    shopifyAssociatedUser,\n    req,\n    res,\n  }) {\n    console.log(\n      `We're authenticated on shop ${shopOrigin}: ${shopifyToken} with user ${JSON.stringify(\n        shopifyAssociatedUser\n      )}`\n    );\n    res.writeHead(302, { Location: `/` });\n    res.end();\n  },\n};\n\nconst shopify = createShopifyAuth(shopifyAuthOptions);\n```\n\n#### in pages/api/example-api-route-you-want-to-protect.js\nSimply add the authenticateShopifyAPI middleware to your route to verify that the request is secure.\n\n```js\nimport { authenticateShopifyAPI } from \"@bluebeela/nextjs-shopify-auth\";\n\nexport default authenticateShopifyAPI(async function helloWorld(req, res) {\n  return await res.json({ hello: \"world\" });\n});\n```\n\n#### in pages/protected-page.js\nSimply add the authenticateShopifyPage middleware to your route to verify that the request is secure.\n\n```js\n// random page\nimport { authenticateShopifyPage } from \"@bluebeela/nextjs-shopify-auth\";\n\nexport const getServerSideProps = authenticateShopifyPage(async (ctx) => {\n  return { props: { hello: \"world\"}}\n});\n```\n\n### Required API routes\n\nIn a Next.js app, you will need to create these 5 routes:\n - /api/shopify/auth/callback\n - /api/shopify/auth/enable_cookies\n - /api/shopify/auth/index\n - /api/shopify/auth/inline\n - /api/shopify/verify-token\n\nTheses files will need the following content for the authentication and verification processes to work as expected\n\n#### /api/shopify/auth/callback\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthCallback(req, res) {\n\tconst { oAuthCallback } = shopify;\n\n\tawait oAuthCallback(req, res);\n}\n```\n\n#### /api/shopify/auth/enable-cookies\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthEnableCookies(req, res) {\n\tconst { enableCookies } = shopify;\n\n\tawait enableCookies(req, res);\n}\n```\n\n#### /api/shopify/auth/index\n\n```js\nimport {\n  hasCookieAccess,\n  shouldPerformInlineOAuth,\n  grantedStorageAccess,\n} from \"@bluebeela/nextjs-shopify-auth\";\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthIndex(req, res) {\n  const {\n    enableCookiesRedirect,\n    oAuthStart,\n    topLevelOAuthRedirect,\n    requestStorageAccess,\n  } = shopify;\n\n  if (!hasCookieAccess(req.cookies)) {\n    await enableCookiesRedirect(req, res);\n    return;\n  }\n\n  if (!grantedStorageAccess(req.cookies)) {\n    await requestStorageAccess(req, res);\n    return;\n  }\n\n  if (shouldPerformInlineOAuth(req.cookies)) {\n    await oAuthStart(req, res);\n    return;\n  }\n\n  await topLevelOAuthRedirect(req, res);\n}\n\n```\n\n#### /api/shopify/auth/inline\n\n```js\nimport shopify from \"../../../../lib/shopify\"; // lib is on the root dir\n\nexport default async function shopifyAuthInline(req, res) {\n  const { oAuthStart } = shopify;\n\n  await oAuthStart(req, res);\n}\n\n```\n\n#### /api/shopify/verify-token\n\nThis is a simple proxy route to avoid CORS issues we would face by hitting Shopify API from a different domain\n\n```js\nexport default async function verifyToken(req, res) {\n  const { shopOrigin, shopifyToken } = req.cookies;\n\n  const response = await fetch(\n      `https://${shopOrigin}/admin/metafields.json`,\n      {\n        method: \"GET\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"X-Shopify-Access-Token\": shopifyToken,\n        },\n      },\n  );\n  res.status(response.status).end();\n}\n```\n","readmeFilename":"README.md"}