{"_id":"next-with-split","_rev":"61-d488635483f0f5bdb038817915d8b6f3","name":"next-with-split","dist-tags":{"latest":"6.0.0","beta":"5.1.0-beta.1"},"versions":{"1.0.0":{"name":"next-with-split","version":"1.0.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"b4dfad494acfc2abe335952a18903581b3b6a655","_id":"next-with-split@1.0.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-U67avD6fKXk3VPJtrByUn6Y6D7aCfAXWmfUvmDP4S7rmUqsOZ09YpHmYy+s6EyATkIe8fNrHuJMasKL+A/DoTw==","shasum":"ae0cacd5b9f63c5c542066af088719f024f132e3","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-1.0.0.tgz","fileCount":3,"unpackedSize":6902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1ysICRA9TVsSAnZWagAAhC4P/RD1cypGV/M8Gtt7HBjg\nnM5z5EKezoED485YYEwYvx6FrG/7AOibcDWDP1ZZcy+i2MZYq/Uf55KppCBn\nZu6cTuJFWRqQi/1tibn3YTpOYbFWZA1xjjFhEBChesbWWmKchh6/x6rRzxlT\niAwOX2GbN7P5zZUeshy6l2rNLfCQ56EypCGZzYRz4CLE17YQUatR4xqAwwk+\ndoM+8+z2E7cZRTDjT5ptKYBjeNH7PXkPp5YorVBUgt1NYjMdsFSOXfiglhuI\n/9ajoXHoQzlNw6hxJZnl9i585fEgBLHSVn0h7UcDO3KxvLqo382pT8qGgCiW\nE9YDci9C6pVksKmwXmbtByrBLXsV04vfFyqWgVDEQFokrtQ8xO03+LHauj80\nynqqHL3BsJcHcMSbnG7wZbjBR4n5+iErbmPZS+s3USrkhjOD6Ttu5sgW+8sK\n8S4xpg+1wzybYTpmgFSTTMNAVMX+VpMkxHubNay7FPijTZP330V3ooYs3DFK\nq7KpTbladup7RT9Iq1VzniDQQZAK8zr3wpalEOybLtYedCT/kE5mk2plLDqy\njrLihIq5vrqh0Yr+SY1SPkX1EiMPzmNh0OcvRVPS0yLRJoqNAe1ehuoa0QO8\nmv1/Mb9GaFMNaMqQrZATDswYYjS7Y7VFgXOlkejy+Fc7MMjcOLI4AGFDpQI3\nCepd\r\n=9KI1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGo02FvCVK45WadHvanFffng3ebdryBccF93Ehg1o3pCAiAU10wZ7VBeYuFIaIuHeGYXnz2sEFqe0WepUnkDy0W0Dw=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_1.0.0_1624713991890_0.1322005530161927"},"_hasShrinkwrap":false},"1.0.1":{"name":"next-with-split","version":"1.0.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"79a26e365029d81150161ce16ed6edcbe65bf648","_id":"next-with-split@1.0.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-haW9D/c1O5JG+4fxxMW5ERCv+bX3jsX48VX86h/s6qwACdgcTH6lsln2DWjUEe5JldKEnAf/RXRFsC8ExNtCyw==","shasum":"216476ee079136159dca78abc10af655a501a2b3","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-1.0.1.tgz","fileCount":15,"unpackedSize":19176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1zBeCRA9TVsSAnZWagAAZPkP/3C1YXA15QCeAkgHL/hY\n7nC1DaLGbmmp+LWejkvOp4P9RpHolQMW+qypXonZfGqfupnpE88HpAt8yEBf\n/RVfBeYE/FKleQ0UcToraXc6W9pAsdYkuj6ypKrDgZdOG2JR+xoYTNNvTFYd\ndvLXGdbX47AG+DZlw1itzfQ+zS9KT/WFQvJRXolTRA9XfSemNHwFEveRccAA\nFeCptpI/jBwU0mg42kIMLFygB997/pT0YtFMaYgpXlwuF+BbCiijw9mLASet\nNtuDHWdtVqF6sPQ6c7ivxmTSbHh+TME38uVEIuAyP4fii6kexVPiNmLkFo57\nJWJk4kknlbzc14EZhj2RHSFP06XCeg2FqYRqAXPYV8+9QC2I2eg0LSEdY3Fj\nNND7UWN3NHQgIEJrbXOsyInsYlX6gwp7FyhhrHajGSH4GStH06XIPYE9Hpho\naIohC0ulWYHi9yMLLAW+rtPSwaRCZZ2ODx8tVoLef/MtJDNfv9A/y8Dn1Rzz\n00HcbngPsM2nTn5yBq+4zu90hwUU3tTNtkA9zdrSkSm5jzy7OP2pTyEj/fkJ\n5ZfvhmnJJkZdFTjLkytfCWS71DUdWijzwlC2Cee1HlBiGbkqOJOL0eK81P6b\n9/YYA9jGeeLZ4L5AxlBPdUUcnVcCd9OITffIM/ONT3zw4V/d2ZVzwdp5Pqhq\n/nP7\r\n=C7OS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJI/xKMRG8gS1d7zlIQiCMw2lC/sX12ZzeFy1+OvPBfQIgSDCWsSShsrMWfv/od9WTHqlOg6N2OTQrSPRJjIDn//4="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_1.0.1_1624715357684_0.08540743746155788"},"_hasShrinkwrap":false},"1.0.2":{"name":"next-with-split","version":"1.0.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"81fa2fa6bfac4eabd6ac275cf9e89aa7a80ca6b8","_id":"next-with-split@1.0.2","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-NhWWPizRiPSKosYURIOu12c+wxOWZ2WV1X1aXhc12DHRnTDWtvtIUYmEAJQizNhH482qwz3IMbi4rkIzxqhdVg==","shasum":"4ac5316e13a65f197db6749d9d7ac766b55f699d","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-1.0.2.tgz","fileCount":17,"unpackedSize":114154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2HxLCRA9TVsSAnZWagAAmiYQAJEn0ILKSy5jJMZb1U4p\nOPEt6CPV83mqrbP7dK8o4M/wSrvMY4aNii5mXAktj0De82mGTke4WjIqMAT1\nsBhrAJ/7eGZBTTwbfKsJT25tHrs1IYAyWydGK8TF1P6SHCqZh2RPPu/Lcizy\nlkgNI//t0PuEY4Lt4jFK4dvix9rYbGkWIy1UMtbYQaPqu1bVSWxmT0tec+dZ\nAgwwh+V51oN6tqbNz4xJI6to4IcqoVTVJXhL5mTEk7WpqEpZsTkGAJvJAq5t\n0pqNzQpFjUYmhp0BSYU3s9uuzn8kG6XDq2n96LzuROCn8U1xzZGHeF7N4PWf\nJZlJxDnbK/SnB3A4WWOQA05oXEP103OsAc9/Q3nopv2AiVf4jPH21MvTPLIX\nOJhuh+kwcVMVqul/BTfhmlQGGKtnxK3fh/qAvhqDhzXbq8isDulzwy5444+7\nW+KDkQx2mHLVFVfqutJXA6pjYkyLm/9h/ztlB9/7hNiJ5NTj8pi9i+BJboex\ndiF9lpKqbeZmb7XEYkDJwG3CIdzKYwLxTMYM8uUK0aec8bQ6knrHklII6/Bw\nUOLOxUKP95A+4liqdVHMO9PD3/v/amiHZ364HNqRPXIVJRsEALqW8qG0BHdA\n2srGCBM7d5ybhpEdZJm9u2535/rt7YFMZjWiua3DQdhPZrHHA2n6A03Mgpjc\ntLmE\r\n=PgNs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIWO6C7Cjn8XkeBixfZjXBdOVYprRE4Em+XzCNZhZK4wIgd7j8IYdp4wIyqNlnHoenDR+XchfFFjxE2g7DWzKSEcE="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_1.0.2_1624800331062_0.19003946351374834"},"_hasShrinkwrap":false},"2.0.0":{"name":"next-with-split","version":"2.0.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"be55c3f8951098332a08ee466ec5a326e386b0e5","_id":"next-with-split@2.0.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-QSQrmUM9BMUDc/JJTY1qhtVUmePCuNEH1ROa7DvuSfmM1lMRXb55sA+FEG8z21Ec+n/1zV1qBQ5glN6btRyESg==","shasum":"5137f4e3f015451f99bbbb7d17c2b7708a7787e3","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.0.0.tgz","fileCount":21,"unpackedSize":120722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4WYACRA9TVsSAnZWagAAcFMP/313Kgy8f5nIRR84AoH0\nBTLrLrQGtpJ79MTdYuXq4KmRDQgdUNs70NsOfKiq9rIwC9rlGaleShn2Locg\nqWoqIeWH5lmjLwEn0Pt1f+5j//g9LZ/gm27WwJ1CJccGuiXlpwyQYcZmGKZx\nwKpVdfHbS1B9H236Dr3mAicxlbIfs/8Fh6T1pwpUtSPQyNJPAHmh7PYBbAcm\nZMc2xMD7loKVozBpKUhvowNieUGgYY6rl8hsy6cBa4mlXzdgAvc2wDHdppT0\nK12itMeny5BkJrgUOUhyDSJk9EcSHsbZ4i1Rs5L0cuFmLKswWKCOw0hKG9Zb\nrcxbj2WcyRtlxAI4wekGuQUBD/AOyKx24zIIBrhtzOQ2YXFoW9Bjle55tsdD\nyuuTL1evGA1We8Z8QDTKuPMU24KjgPz6vucaw3R8zBwKJehu+UjTWaFK8e4L\nvt3sxH88O3NG4uH+jisPRqgNcS7QKUXyhSV0PZgnNJCc6iBdwWoMGjEkoht+\nof1B9He+xA/z6bR7uKC+UhPVdFM8d9DLGzKa5PG8Se2sU5s2BpHpOM5Xh6xT\neP214yQCIRQFI1xwk0s0RJbQFYXUv1O/e8NWBbpQ/QNpQthCsNF3vGKWXubo\nNziiZnFmWAxJotjlqywM4XDkG/QHBCUOqhMWHCOsT3TsGRMI8NOUhW13Gd1l\nMvXP\r\n=BW3X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc7wULIkDAlxM1R/pIVEuRito1jYT3ndbPIk3xSNaQWgIhAPdN9tAcegQHOht7zmRX6JtRTTivrEAlQXLSfblwVeut"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.0.0_1625384447347_0.2767921328087777"},"_hasShrinkwrap":false},"2.0.1":{"name":"next-with-split","version":"2.0.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"f73360cf2afe2c1219d29bf2c1e8bacec9848d6c","_id":"next-with-split@2.0.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-1X5Osnu2Xae9501eTjWlQeRv9zl01NDHrYb+hIifW0h15F+L+AaTzr16cymQhvGN6kDcug+9rsgFTEATHR0sHA==","shasum":"2cca7f862caba7b29ef0167c2bed354591481e87","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.0.1.tgz","fileCount":21,"unpackedSize":120734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4Y2TCRA9TVsSAnZWagAAREMP/ixeEHwhkBrAsjK++rrA\nfj0yPcPuygxvbfDJ0A0Uci3uKnSmgQegd4RtgTtsEQ1wSRDd7h4VjG+41NkQ\nCX18DN7BgCZYYaPFEOM+qfhHQI//cU0tGQxxjvfMHW7KzsFwuXL8RT0hfc5c\nBqYUKqfTwCA1ejkedlBkRyCNTQDQ66bvvTc/JnNy7WcwL4eU7qoHHK6riSdr\n/u/6sBKVCCkuU7yiQFwJi9i8izmTGoVoCEXAVcb19zZ9rtnfFp+FjDvR1nHm\ntMlB1uOivWirOeEtx/OFyJoBWdyVObL0xDPZ6uz8ICjx4s6D8NCG9FYDQgEK\nOcmWUEkT2G6lL4pY2gda5AS8YzHFSYTQeOit/T9JTWev0jP5wxOSTVhHVjW3\n2ZZGDsRbtyjEFMbwu20Jx+8xJ+bRYqoM36+zmZcBhoKg/8vYYPGmtt8xjhwe\nPM32eUgNhZESvOtNFMrjnLcQ+NwYlm1dnjqvSCKw6L+ymZYipJjV2NkRE7wN\nXEsYhD8SEPm1DE9WT+fAslXGEV9POyXh0Yv45ji7pMEh2D70uAPREowX1Unw\nXiZXJ1OJtGS86QkOYYIh0M2jceJfY8DdpEHyxUFabOx6ctZzT0X/3P6kGnCE\nK+PRTc8r1RoDjRrqGBAg79yHrgacbmvMQ9QdePFmB1hA2m/GU4rI9TOaPPtx\nDqrh\r\n=HPLV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAoF2aJFT17Pk+VQTSWVj8SMw2epPFA//dO0PmIy7dpAiEAmOnQ57hlUN1KQ2LzPt1Thhl7RdEqzzgxY9WxC0u8RvY="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.0.1_1625394579139_0.03381893442993311"},"_hasShrinkwrap":false},"2.0.2":{"name":"next-with-split","version":"2.0.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"313f9f1c2455617feff3e5e3079a0531caa2d055","_id":"next-with-split@2.0.2","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-ZWDDR3ZjHqQLYgAeSHMDRYMR66rUmKWPqDMC1QgeQY4xZbjUNeJOvucBIjYk6RpEs0IGacJS9Wqy+xE5aFBgww==","shasum":"afd1f9073d2c1cf42e020b50f422949b57aee478","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.0.2.tgz","fileCount":21,"unpackedSize":120753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4ZPBCRA9TVsSAnZWagAAF9QP/i9/qXHElYXapfpHZcD7\nq5bmPyyphTvnfFJPgjwdDo1j63qiwQJsqr3Gobn0dP3hiLQUq4rTFeUtIqn2\n9/ECxZNcYIa//n+vPbeI4hlgEjgwMwrFn32c5FZ75DQVU9Bykt3VmNCRs2eX\nRYHwjZreVtLyx3qjbZXn9fIirb77E5c0hzqaX7/4iyjK/AHSgS2LcGrlywY4\nMRQaiDd42filAMXI4CKFU2gYRvAwb10nZb8NEeyxfWhgbn+dtFOCgy62YGXX\nNch5OeWpONNU2D+p/DHMH0pEcMTUAxRyQOjyTkz6As0RG5E3XqGSRKzcXWT9\nU/irEeyb/dcCr5suDNZ6mTiW7tP6xaOgFVWxgMz9MdHYuZaO/H+lldPlv+Cr\nabz5rBuSh4Q7LOmIe9E1wS458mCTWSgVFHhPS8RcpsU0/qZsh7R0u1s5wQs6\nbS1yU5TYdGJQO753io6RTIRNMmeZKi3FfA8COETTW6OxcM/07XFPQ2n9J67d\n6fVxgVm/pqthvJNycxTGwOS8wxm2xYFq4JWV9fRs1UaFX8XWOnuAZbHgB+Si\nJM46m3+9q6I9wQbqITdXzFmOI6ToSE3de8OHRuYrBQle+XgY5QvOdLJG4ppm\n9AgkhKzVROjFX6QOkZPJ//Xz3y8zcQrO7+Yk7KeaY5r2GBx3FsY7EeNMzFH6\nTbYK\r\n=UaC7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4hlOvLTYX93uFje+bplKIzYUvfEoaJaefU8vjIRObqAIgYt37zOGY6EVvtm6s1vurCxlnK1/iX+PUQKrlpyxxumM="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.0.2_1625396161137_0.199374766420656"},"_hasShrinkwrap":false},"2.0.3":{"name":"next-with-split","version":"2.0.3","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"ce7a815d756375fd78744abb902cba123fc6fb25","_id":"next-with-split@2.0.3","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-ib2jtAV3d4AXSrGXT8yfOeubzII/efScL3pLb0vG2upCFyEfDR2cDazEpxxj3yYFeeZu1YoNR+6F44aE4q8xHQ==","shasum":"d85434dba94bfcff0382cbd382c2bec2d2977e8d","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.0.3.tgz","fileCount":21,"unpackedSize":120960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4Zb8CRA9TVsSAnZWagAAnNsP/Aj3/5dyS96RULPIqIQ+\nDqq75WwNHTWZeyjFVUZK6nsFtbDEvJmdhGIuN38PeUjznZQzWPRXkNuLJAbz\nZSI962KkRPsvqcmT91ftO2iiv6qWTpdc1whaxzV7ChpsnaKOYd6/qd5OX/OC\nXcNs02BtX0B0QAmJfoVZ3zE7qOT0kChBK+Eo9t3iJhGrwnd1jYDQ1geEL67c\nfUy8NXkE1UphGzGkpOsRMM6wMLyQu+FO11bfambJO1GJNt6L9PhtN6FvoGeP\nDAIkI0sPaXXyRHrN7EGb5SKHO7oDD54Miarc5ssOMWajdyf9qknKoXsApn1S\nne6MSXbxWk8f4PjoE96m6EsAC2r0aiHeHKf76ARwhVxBYGgh4YJ+xjvsnkPO\nZFSNCVu5vhYVwpdI+F9kPyvl1/w36WbZjWngmPv7kOihh/uYPYFzs2b+5Ml1\nLJqH96tLXuiVjcGDwB8vQgGEhHYNEthZFLthrObEFKq2hZFHHRmUJI3Mbuce\nt+AwGOwGOPWQBtPI9ZEnm8+RNWL98pEAcdBralcv5fTK5iTDq+4L0ltDrdEj\n492ZRiNvCEW5YbYBUGD/KMllGvBxGUL6sTyvBcfPI3xt+PEEE4mqbJs43IVD\nMLzRW7K1ddvSV2B7myJtIQJDfU4Dvycs3YrF47gycugtHg3asytuQdWeufy9\nN08e\r\n=XXsO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDS92bVP4pC0oedaVPuvHk3NQwoVXfDcvZ1PcJThCZWVAiEA2oeff0jnqcmPU1KeabBCvj/LQfgKZN2rGjtC3j15UXs="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.0.3_1625396988451_0.21104417905057593"},"_hasShrinkwrap":false},"2.1.0":{"name":"next-with-split","version":"2.1.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"fa114690f57c3f5f03c4579826a987c226bf44cf","_id":"next-with-split@2.1.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-/9khjrae54G+Nh3Gf0EhdjrfVoYrN1zp/VjCG+QCv3fboGq8qX4E/FzbA86Wu04zVZodwxXgewAbOU03Ua3ziw==","shasum":"c0fb8c994adac923b53e1b20a2ea9f6d4476feca","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.1.0.tgz","fileCount":21,"unpackedSize":121966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4cJYCRA9TVsSAnZWagAAUWkP/33rf6/64L/q+vJzq8i4\nBYA2ffMakOSQ98TdeNnkQgIca58OSGNIGpUZ8qFl0TOJ96bR4LEcCecvoXms\nJu6FZVuO82M6CWET3FJsdKkl6NJ949q/FPvt+aioTQ8R6BsN7Nw07HS4++AD\ndFM4XHUYK4/3M3lPE/X9yDRhsdTWLIA7e7Dk1DYFmyuXPKIzNsD4bOdOCIx9\ndw7tLb5Up1Sx2FXVNObluUxkCNogreUy7T5vCN9XTsxpLPtx2lcM4V3iEy80\nUA/5lDdOp7m3fleua8dfaKh7/fiS8DNvOFF+af3yVrHb2fUepf0RQIxIr+sF\nMtAi2XfLvdi24NRnhuoTiSQhiAf9M6DrRgyMeA7vBB/N8zfN0iPu54u2U+cD\nL7mFMeiQ5kW52/aio2ujojwLFHNHsFY6X76kLr8D5DUn50TpuvS3JFyCco/5\nW2dAyIk1983rvVnrFcsNFZ21DFMP0KM573dk4nsEWvxRlFtpfmLhZ6IRZ0oV\n2PSu2yI6gg3lFOw4DL7niXnBlRf3XvxeoeqLAwGS8yTkEbW1BELWV7s4BfH7\n0IHQ1fNdM2IBNvr1N+KzT8JZweCp8fz4m6qpkGDbLW9rG6JZV5xjvbwHlTdc\nogk248BatPLVq5z5e2u1/pFaseCdSNXvKGUsLQYwOveI+xDulCbxZEp8m1ZH\nZIdJ\r\n=dTLE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCV0AwcL30FVVrO6heuj/ADy4OpiUk/xxtqUhEiay3AvgIgFxsjC9ztu+bnCdpCme/PdvfJItMowVzc8Cfh4bdy9ts="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.1.0_1625408087503_0.5419364314738488"},"_hasShrinkwrap":false},"2.1.1":{"name":"next-with-split","version":"2.1.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"a4670e14b5744615da854cf5bc743739492a433c","_id":"next-with-split@2.1.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-Z6UZ+lJzn7sscbfk8lbXRfhCT5NNNwf/FoF/zXGr6xDbvagGD8fXdNtBQznoauu8Xy1iZcFhKOoEeNApkGNEVQ==","shasum":"1004839c4a281a771dc548daa47ec2e3cf595ca4","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.1.1.tgz","fileCount":21,"unpackedSize":121975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4cMCCRA9TVsSAnZWagAAS1AP/1T94NS37Gm3ELPmuQbD\n/7CYN3FPykdbensayf51TtR6Bq5r6Nkj0SNbV91NxNo6p7hCnmVCzJPQJFkh\n6zAnv/s6i3PshdKV/p27jMxzRb8017pFHpAj47cXRryCT3LBli6M3HWuy6GH\n+AVITej6jQnocLFtGp5QyosuOpVk8+hRH5wCabwLr5Po3+jp6M9/jBu7ycwI\nqwU0NvYT70fxTDKN0HBr2OemLzYLUQtkToN0hfBYe4U1DndOZRizvYhyBKgd\nrpQfjsLMjmVT3RxYIYWQSISf0lbJMxo64npvkANgchgTPEzMeuL2FwqwlzHR\nRpgIxsNkHTGguoxxA0sT2YAkSiKhVUvRVRrgjKPFcnRED3fG3Hd3UP83r9hq\noQ9SkfSuUONbvAu0IU8iysYMRoHUoJc1Tk/ZFz0C6sxCdS2JjafudiKzkD+I\noAE+n1uzvAxfpnfFlgmQGikvi3PRcHhglrhkbTzhNcdpByVqCPW7VnxCbfUa\npoN8eX8SafkHchEwqYatgRixsTuRbXyYkEme5GDqNZrxk/lR7KUbktQLFmsk\nJUBpTxa4CguUU1TPOyu30Ft7/+hzNap1Ht4lX7jMNnOFPOPvFLses0GRA2v5\nvieMpwytl4cyK6guxUZracyJJ2IhKjaDbqk3qFUaNFPN7ZzxZvKGYxwu3ByR\nfq15\r\n=hxMM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKdcbSiFxkDUl7ssnXmGnfoJ0B7UiAmiLJCbi8OTHI8AiAy0jsuVBTW+lR8MvCEfXojh4htjsIDWn4HKvV4LfKPvw=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.1.1_1625408258315_0.2421634865165201"},"_hasShrinkwrap":false},"2.2.0":{"name":"next-with-split","version":"2.2.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"1fd5ba9341718cb6850d484a08207c484fd5faa7","_id":"next-with-split@2.2.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-t7DdgBYeFJTpoZ2XtVlKimkCLvPEqysTr6ruqxu3iR7s2sm/aNoWg/VrfXwMFOwJT0vc21hfs6z8jDvviWDn+w==","shasum":"45fa1f7ffb342759a2d54e56ca005b1f8cb9b794","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.2.0.tgz","fileCount":21,"unpackedSize":122438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4vZUCRA9TVsSAnZWagAA4wwP/jKB3c23UMmyW2yr63fF\ntonNl5WCMJ+JOeJebZzfv3C73oZRz/CpcpriN2ggeoFR/YZVmeJAIGzhaSvA\n/Ieo6dXXwJAvwrX5lJFlFobrT8wEIlYSGEnfHPjA9g1njObc++w4PZwW3tSK\nMkbARoWuw9T1i+LbbFl1dMTv7AT5yEMTUfMndWtGrYNEe6Mtf7YzzogGYLzH\nC8yHbzhiWbT0IIZiZLuXwxfomqERR7tLjnS8UFLstTM00T0PVBPV0TYcODZ8\nG5xFUvgRNrrHxCKDjS29VJjdBRnL6QmppFUAjVqec/wf+xc8t6qaMwFQsNLf\nN/nqWaFcxhhaZKd+ksMPbTQ442QDIIsB/rJW8agwcrUU/jSb9dqxU70DwO2N\ntpEQAirOK3+IO9tHJ9GeyUPH0+SOqUjY7IaCa0xVyn3oWwcOXsMYeVXSBj0r\nJpSvoBV6vrq7mpWI92+LoEMs+w7Q9W9bVzztMBInbKToLf2heKyT+BapybIq\nFLQc2S0H6PxmgPYvthRN4cf7rCZVEPYNNvSoqBOooPcld3NT7gVZLQ6jgjbk\nRzDC15iBmgYUYqaR2382m+ruFaatz/pOyaUDxVhQ/9MLV4ro8IQRMsHsACwN\nH0Qtef5JdcOdJ0oQFni4oGrD7jBQeMpqfSYzrQHw/HLXMqfgG8DJKz4D5b7p\n01Yr\r\n=aaC4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDujZtZnSf+wo1iDooUT/st+2jl7QGRxk7VdXDARxv4KAiAydNELiUdPbRp2wXAUq3i6UwteyfXHUtYURuSZdwFlBg=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.2.0_1625486932409_0.5909351253511925"},"_hasShrinkwrap":false},"2.2.1":{"name":"next-with-split","version":"2.2.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"982a7e827cf7c2e4acf48cf6a5e4d4a46b50ae6c","_id":"next-with-split@2.2.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-N7ZmvmyjJL/a/pGopjX0h233GBRz7gRaP1GkeOg0uD2KJwByr9h6YXH9N8UT7K04PGMnpf/Up5CcjRQzBonXPw==","shasum":"63ffe730a86bdf9e8573e8689fd8033de8537332","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.2.1.tgz","fileCount":21,"unpackedSize":122519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4vyDCRA9TVsSAnZWagAAlTYP/AmgN/1jAkuQWxgqMibq\ngizACaIhlckOdRqmER/gxtgw83mJQqMkKd8qIybP55lxmreDwthLZyRQU/6T\nOOsaP26s9EmzLV6wGo2Am7DOrHubYdXrnnvz9NlntOSzAgbkB7LJFHICmz3P\nL08ghCVQpaeXUjdjVcgMa4I7Km1vrq8rAQVuWa/clQX+w9s7Z4XTGisXDw9X\nte7xUEuo4WedpVQaW0jRipquxWDG9q+F3zXlllmeDK2pFebd8VfbhukBp38g\nGem+I+srsh9OpbaIBGBO01EUFc0isB+0xtwbDuyzXIz/vonIRlroIJjhMZ5B\nlLLu0mL8nJhFo4Y6LPbJ+yp6q/5XSSp/hz6myZpPSUw97wAWSjrKXODM7tXr\nZE7gGDSJ4Plnqx5owQNP5rPwhZ+4i3EsXhGIOCYFK2uGS5F7rk8okGVQNQFw\nrrYh1NjJknVwGHbDK3paFsPyILv3r7a/OV42ZO8F2T71pGAbwVODveJf43tN\n1Grfct7oo168UkU0gBPVV88oxDrd5dNPl5WAsoFWXvTYQ1Qwx4IvBoyvsdgt\n1Xe+vuZF/R335fz63WWDKvpJoNV9G0jXydwygNOXSoG+ROOMPTaV/jNBnz3V\noys2cySmqe6wXomQbIscpAviJrCKM6/lYUTLS0ejzMINbUSHuJL+wB5Gh70b\nWOVF\r\n=94ZX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYLKUSr5erQmS+pamVpBX8sLRFEJgi+ST0FdE3kQ/zNQIgUXAx6C+CwT6sJIKH5HmiPGd7nEoAHcshr0jCr1r2pO0="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.2.1_1625488514653_0.8178101058909086"},"_hasShrinkwrap":false},"2.2.2":{"name":"next-with-split","version":"2.2.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"80ad5edbd0541a0964aeead9d1d1c5cfd02cc89c","_id":"next-with-split@2.2.2","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-BV6SHZcrEx0nVRoyhSg/2kUGj6OGK3xLSTQl5Qi1FJmIFZgG+ehM5swtTjMjftmoOAD1a3NP4zbXZqaRb1Sn0w==","shasum":"435c4873bb41bba714b60c8ff36ef895bb70ca38","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.2.2.tgz","fileCount":21,"unpackedSize":122743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4xffCRA9TVsSAnZWagAANikP/iCtW1SXPGLvJrOa4XTh\ngpnv1XZV4Baim8OLtHSZ4fRSgwoYt4B6eDfZTCKsyoEXcOZAlaSmVh7h4I0/\nzMyPxHG+4J/SbWgAzDPFsGdMbt9OblEFtpYoxT4P0BbPMQeWO7MRjgVf+9wt\nZFmr7iJIp7SYbbXqzYEYVBetRYSzZt7SN7WTVhQE2KlRRICOhxp6HMSscbv5\nB0AgpItMwee/Nq0mObf9z142EroLK2QVCwNfY/HTT7h7YgOjujmDIiIKyHKe\nKqv55aQxs5i76kuKj0YD0jPxz58Bne9uJlUprSojAdximacrfcov2Divd6Lg\n1SHlwSn+65D+NCT3t5kNSGFVaA1Ot/ZX2PQ+9ZyYlwuztkXz7sFUcNA1N0PA\nn5IKX56cCDbzPlUzUh1Zygg1OzPN6SaWuVW4kfmC/E0K/Ny2gjzceexvYs1l\nrSz5mB3BtXyBI/TDCBFyA8Gnw1rqEsR+I2db3sSt9RdtGQedfU9dQPiJabbK\n0SdJUe3/CH6S3sL/a2uhry/dWD7YVMcr9IRr7YSp4wyXrUPgsBwkHrVjHjIu\nbHaMJoqEBVPK5gQpz9+Jii1WZgbj+u0c3C7et/XzzTagxtHMskzmzHuLKK9b\ncBZ0/TdnCEOLQ4d2tTS7vAVYwUaIOExv5EchRvqETYfPG7QWiV/OLBRRir06\nREAE\r\n=oAQU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKzjh3nt0lURy/FhwCLfOY0W7MjwdTdQo26F9vlSkoQgIhAPNqTqozZMwjylY5leRV+uH/4AN+VYViuXhfqU9hn8GV"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.2.2_1625495518863_0.4081605487500366"},"_hasShrinkwrap":false},"2.3.0":{"name":"next-with-split","version":"2.3.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"3676e44222cbdb44efbafaafb7914bb12407a070","_id":"next-with-split@2.3.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-TF8ouudj187jPdXNtTYcBu9IUKfdUg4lJYVio9vVXNUrvLQbo3G4X17qqdkfBuCUFTk2H16tPqodr8QD6+CEhg==","shasum":"dba46b2e15ce2ab1a9df4bee829fcc69a3cba982","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.3.0.tgz","fileCount":21,"unpackedSize":114213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5GTuCRA9TVsSAnZWagAA0tsP/0zZak0O36w29cZsBN11\nAOUOzQ9Y4+iLKnxmZqWWFYOh6wwo6P62VLtneTEXTrtF6O+gKbPC/AsZyGKa\nd9DIKgCTc/ZrukRGS1i7opO7k7bE+DWpLtm2YD9itmPwJskqaegnWQjDhZWz\n+wop3vzmUVZzIEK+RWraP4VELc5tEsshhXWcydJ3hiLHP4nrlpHwtBpL78hO\nwZxVDUEN9rj1fh6TMh41K9ryyI9/JckNJ9l05YpJMeAzGgS962CsEIUeiMo5\nVkjFLWYWgyVIEajX045TeqjC44OGJcrW1oTejMW0Q6paI/H1LWM35jQwtDZP\ndo+pj+OXtv6UxizbjvnpP60zwC3l+CD2e+JnoksHE3rzdvchf7cJCq+Irb+j\nEwHp2UptR1DTrJp0zxGbbUTn/yNL4TI0RRk8ilYgO/q4AX4CFv7iu7ianiaD\nVsKNiWT51AABRvUIMTz7lJ9NJXT6Wi8YeLwdMQ/ZhvkJdDRR+KjKqs4i0h+U\nl4Y6oQ1yQGwFKOayi7F1bnhLppin1H02d1ise8PbAWT2iEP3cyUyacxZtruD\n7q5NbHV11mclr5y/b8J2ReBjlJpyu1tYUbo6PpWjo/bDaNmFli9SMd4hq8e+\nmvlNg2tLZTZBuxv94Jhu/RRGbxSHfo06oZxzSUBwWXcRRrOHiRygxcq3KlBP\n3e6T\r\n=PZr3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1YenpKDDYpqU/M5agRnW/XV64nevTPDQWrCWlP8n84QIhAIgFdj3rKUVhDxV/iAVfouwZfqOyw1ypReyPYW4lOD1Z"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.3.0_1625580781910_0.830092794144023"},"_hasShrinkwrap":false},"2.4.0":{"name":"next-with-split","version":"2.4.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"f635e0b70debe496c8956b10cd2fc64b297864cf","_id":"next-with-split@2.4.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-IZHKBVTi8Jq1iNrmojFjFWy1b91MMpWMotC36t3thLfJr61n++WwXj4+eBt28tlFfIchQkmlZd6Yaol/Cd8bTw==","shasum":"16f8a2212372ccd3fd8b39bc69c0c6c804ff2dbd","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.4.0.tgz","fileCount":21,"unpackedSize":114949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5G89CRA9TVsSAnZWagAAlRAP/j/pdJI1KgU+BH/g1kar\njZbVsMtb0PUE+Z8oSXVCxB8slH/nHcSO3OTPWa6N0zJI1VhNUvQ6mq4DYWYl\nNECve+KsT/Bdsw5LQveSy8oupfHmVs2k3hdp8GQYuFsNr/GljqapshqROLNn\nXeWTIm/rsglpeWgT1hK6i2RDCUuU3WG5cEZg/G7VN9AE6bH01ru+Q8DXVCY8\nlCX9RlRLOEMqo/vJfYCgfG0xSzDISvhWZSo8tG3G2vTshMWPsJ543L3okmtj\nRCg2d8SjIkjAiVFvoL/Rkw4pk1gtgJYoVUUGsHqoBr9Ft4XTSfANd+SPS1pg\nfoKKMSDkAHXsJQB8mUOZnTudWtlgwwDn+SSro+NGCvD7zL/S7Oin7cjNfHj5\nJHBV06BLhtEQa+nTQpdE1s3lP0Oz3T46ODsFZSo0E7dyE9t3GKyX4qtr7ABq\nYE6wjTgzitEBCXJC41ybP7UL3WRPbRoDOQPPLhAZb/J5sHCA078itdb2YYby\nFfkRCoz2+r8lmpFxza/4A1fx5fo6PxB/FEpUlwe1q9c+fUs8ajp0TqUaN+vT\nt17OiPJzcXZqOar8LjJUEaMss4Zlisn0tF9S4Avxy9oTbsDcizJDzzut0TBG\nvkNFnG4DrGXD8doyCjRoS8+H+Z5voHjl0vt7JiC3s6piDiM43X/PP1Og+VAd\ncgfp\r\n=IJ+0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKO8wbd9iLoFVj8Kl2DZH9g2+o1DYFkxVOF0iqz5KovAIgH9384eyqBj7bMws9fDDNErgQTGA4pKjuZfhhAt8UWvU="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.4.0_1625583421151_0.9140085873987311"},"_hasShrinkwrap":false},"2.4.1":{"name":"next-with-split","version":"2.4.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"56ea0233117f09ec5f1ffc1f0c8ba126186b1178","_id":"next-with-split@2.4.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-NqGzq1zxvggu4EUdoqOBogAWKjviw5gxakGRTTGm/bIt1wCblXQsFbRkXRCoP18vEelY4CejfH+efkO0d2gGXA==","shasum":"5eba031166f3e47ced46fa8d93667d427e154580","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.4.1.tgz","fileCount":21,"unpackedSize":115026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5HQGCRA9TVsSAnZWagAAo8MQAIuykb2+UsCIlaprC6Pv\nyiK+I0SxMJg2wpl0TMNGg9tEffAFTc65Fdg7lrOUzXMCK25ihtxSst3n5w6z\nX1k/SYWjSGT/1vXfN+87DPFwsdgc2XhDQFYMUJTmxkS3F34zt2XKZVM3y/pB\n2xComXGuZMdRDlvHS7CkzJB4frTzfeonv0/yDOU3msUe9aq8+1q4s9MxR+qg\nlgYz5n+iaL85kU20yqDj/CWyBayyXDTLrVvp10QASxkUtw7G+stC322xqw8e\nnfZlobDQw7pOYBKh8LfMuJMeamuf0RE7VLY+KGBLJf7E51TZpbCCA7Tt7Y8v\n8DiVgdOgNalO18p2mXli1PurtyXOztp1jIXE5c1/2Yr7QIHFqH0H9erYOewV\nzl95HjCtMeOmQZFnfHyJ4fQ+yEfT2oBpC0k/NI0/KCXMJm6c8BKrbN1pemXy\nUe7a5GgNLZP1B0vIJfZOMi0Bvavm+o9wSOa6Z7tj8GpMhjwCqZtozRSgAYtO\njM8ScOSs7AYhebZpCm76wquLtECxMf7rmsyVkMk5/eoqLWp8Wn69eXEyEk65\niN2KrY6doEPsQi+jcgA8HbBQs7NQQ2FXZ9s9tzjy1T2+ccKnXoyFawns/WCv\nY7wzkvGpMogMrB/+QHTt01mzYQj2bTUsMFghDeiIqQVMIsWxtt+ACTu2Wq42\n7bNn\r\n=iPyR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6BHtDqq7nJb5hWV7DWRJv7YJ0otOl9HOPOmYw9zyxmAiAbSgpjRolYOZNWmsUj0Khv3tjzF1amKT7rgT44SvPKcg=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.4.1_1625584645584_0.5273876805849658"},"_hasShrinkwrap":false},"2.5.0":{"name":"next-with-split","version":"2.5.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"cbab41d81f5687a58081e61ebe5d24178bcd4f1a","_id":"next-with-split@2.5.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-Sxo44G8WgK1cOWJe4fYpy3v37B7U1zGVF6u+FDSAMOSgeYmWNqRRJNDNnLKZGn8V9R0+wK5JDkaTkolAIDrjIg==","shasum":"ec338837ed880912f500742f2c4107a5257057b7","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.5.0.tgz","fileCount":21,"unpackedSize":116657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5wxBCRA9TVsSAnZWagAAR8oP/jfjC1LfILGdGVfxUjKX\n0xKFov7g/9K06QfT74qKzNadNqGrypFE8AJlM3VXc3as9a1Xzlng7+N4O/au\nZGAQJlHAvcIsetyrQxX/EbtVfJn35Np6Gp4fm9PsjVcEeIdNsdqxblnEyiWN\nSI/URQcMsXiOlKmqFJxI+VJepEqGGQrrUg1ixYcerYcwdu3jYyOnqtZkkc9R\nGLcsUt0K5tnQG6idQeIq6RzVjLX48aL5d3PgAigmH31905nzYekyzvsAmqgv\njj+4Sl35I8JvBYF74Fhh7tkLyuncgR6bNY51bIJvIOfD9P40KOkKg84wgxf1\nEjEJ/QCNv4rs2RkACBzZ/EEd3xvHLizkzJfATJHwD4XgnoYBfDoY5HnwstjA\naHeDnm+DeLOeSu96U9qGL4+TxIBaJhSqdLO6R9QbTiWuRYOWyi5rhg36f83R\neMrvcUUDwo28477LPjyuQoDsRHfyLn5Eg1PAcaGs5dMCUwpeV5gBJQyXtaxP\nKUDWGwETCSA+Pu3s8STkSlOFYrxlPP3D2UkAk1eNOpiH+48pxbvfXQcpNLNm\na0rq32bmqxLlUvo+emgwp3R+ZF74EB3ySa6YRPiqJN+dvCi9Y03nTuMDFZ/9\n4VOMs1euQToZR4AVS69dCvoZ6cUCiL9cmZZhHoh1/RxLOaAnJgzjjG2YO7NF\n5wca\r\n=7eDL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTNTTnFFr3UmBzMDuQiCqFKgmMIxgV8Z6B1vJBm33xqQIgGoLuItmZaEc18fY8wQIJFOERG7LQSFtavHrceDh/dS4="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.5.0_1625754689078_0.8044346768237665"},"_hasShrinkwrap":false},"2.6.0":{"name":"next-with-split","version":"2.6.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"8e1bdc4f3b1a0184a4ca18787c9f6d367ed7627f","_id":"next-with-split@2.6.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-LW70YUdL+/GirjM1KU/U0AEhIEykh5aHxwOHPP2x5l7lZt5x6tFKVSjkgt8LyhbIC/0dutzdAih+EnWRo/CMJQ==","shasum":"456912253f09b8f554d8eaca77bb5fc51ae7fde4","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-2.6.0.tgz","fileCount":21,"unpackedSize":117075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5xO0CRA9TVsSAnZWagAAcnYP/R4i/GheuQ+b8DA2Wd65\nOr7lWaOtVTnuNbhFZIijhU5AWaTjmksjiLdTKtnBIixraWf4ezol013aQu7Q\nlLNAhj0v1bq25idJ1/6J1boGuNFVjcE1goEwy838P8P+BYslikQTonjCFL5l\no47k6927E+H50oNH5qGgqVqSKZgSiiQyGm+tF9YkQAC0Q7rOtnIZk6ZMEwi+\nbvncMI2987yKf1dOjIbbu7RBdIFckYg2xZ2H6p1zE7lHM92nFPnEF7Yspnue\ntLWxsAzgshivfLNr0l+yNK38Mcc+c7usfxQwEv/JafBTyEpPUHGZYa1OdAxs\ntkpXKEtPFwXGfjGjG+tU7WVObpSahRkROnH5zoVjHmhZg5E9vvptJMu50GGM\n3VEyMMbinnclZCBeuK8yNT1I6yifcD1ybu7NDTa8j56t52BBYwkN2oezqEhV\n0fpg7i23yaeXxkciXh0jIx4aMin2tEe8Z0ik+vRpd9IMECeK3vAZk3i7u12F\nNTLtm8+SZu8F2XEjfoaG0ZpcPRx7OM3Ur3FonHv9VwnFB8kp1WNy66F51sb9\nbKKoMMPShFjYa23dAsjFL1H8waiMS0xN/L7w0MUhDinED94qFxGf9NC5q881\nO8h6b+GdcrfYDKk8XZ1eTIM23msZ2vIeUQN5ejpLysk2LUhEDiHsEAq4XBRu\niN66\r\n=3jxD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFh2hZQE05o9byl8cfGoUMNZZ8rqBrKKT3lwNFdQY58fAiBtl/niY3Pv776g2q0FXJv2lr+43xfcxnGOZ0npOXzurw=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_2.6.0_1625756596023_0.19434971308233528"},"_hasShrinkwrap":false},"3.0.0":{"name":"next-with-split","version":"3.0.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"1ac7c1b07b4f7940076e2dde0ced20e83ee46e49","_id":"next-with-split@3.0.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-bnLgyWQecV78NDDcXw/kgTxtXjo7wbBqJVjJiDtSeAJwfXjLmUVGpbn5jGAOTkweqnYJqg9Kdi1FiArfTT5yiw==","shasum":"63275b8f7ed89c676fb7160709bd36240b530d59","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.0.0.tgz","fileCount":21,"unpackedSize":116596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8ugZCRA9TVsSAnZWagAAwrEP/3z7BZwTSauoST3yICZX\n1Ml2y6oEw7zAwNHIrqYJculmbqkBZXwyA4nLvpLS9OWEZcCYpfhh7+bWJhir\n3OkOEaDw6uxnFSUJXAebvR02KU5VWpUXsVix3Nc+omLnByKgNFk3ygZwvnZK\n1ZqAoqnmzEw54I8IjC4e9+xNE/6e3nKqQp1ya3j2zymenuS0JxIi6Q4jATuM\nVlh+Q2sg0wTJVeEGW/fUYCrbwl2XU/gqgv0EIxErjx/ZCgj/blaxwzDzBTf1\n6ciHWByoywqWk+yuZDnGHqKUWbfPFVktB6cd/SSzyslBhOYPJpNmtRLE5FC1\nZmXZeG0BLSiwoqBFnZsftG4BK3d0k5oYil/uZknUFLtRcLLhLvYq5YXBLryc\nid44L5IuS0geWSdqsIr0dkJZSms4JZWiQVsOx6WhJDAVQwBQ4xd2EErce/gQ\nznGRVUkiZJK4JnVuj8LXrTBn3rJNKcBf0egxGrvFqL5xcGhmwa3bx+LfkY6m\nDYrzkjk0L+nSik7E2hmWLZJpMgG+o522LGhmt3LVkZ1Ni1jKVHjbD5lQC/O/\nt1FmP3Y0TuwZEvBz9RM8L/mk4NWK2/LNCGgqajkFtW6lclvf8L0H57mDRkOL\nOrmoObMDdvub3WSLJDwfrPuqnDmsBysk1JOEHnbJJ4o9uOatgJuPhVXxOAxz\nBZek\r\n=iLeO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAlSZ8lOfM5LQApGSimQJZ5/y5QbAhHft02XMQIx1Xd1AiBs0S9zhNBmaPSwohQ7fjtw55T2H89s9UWPqA+6g31isw=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.0.0_1626531865258_0.02310578839115185"},"_hasShrinkwrap":false},"3.0.1":{"name":"next-with-split","version":"3.0.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"84f73a994cc42dafa86b9a7ff8806512a18fc3ba","_id":"next-with-split@3.0.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-BvLm2jd2H1FyGmG0qF9l6agpXODC1H0tIcJTSp+aMtx1Yhs2TCBffXisOqgIZ/xt1b6dgrB+bUVzlPp3VRCdAA==","shasum":"884f04e2bb48e11e08aeecdf4a4fc1034afcb3c4","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.0.1.tgz","fileCount":21,"unpackedSize":116580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8ujxCRA9TVsSAnZWagAAk/IP/0mjN6BmWmUlgVj7UQAB\npeXPo+57o4yiVes3j+UwjUKrFYF6+DQi0vYFsejz1qGMCSw2AqNRRQ6gwZZZ\nTNnEJLpPpU47fj+HGQphEMkvnI1X38gSvoeUC6P6pL0/6k5OTp8QXP+uApLd\n+XQDaozDMqEWanU1GFEpntqy4TM8bPHAE98CCblL8sJ39DAQXx1CvQqSWk8B\nv1dQNcgQycBKxoz1Gb1VdXFbqaF19DgeAcdJqblnRU+16i/+1erHOkeZdgtq\nj0J2vFSMcYu/nGHYlB2Lwe2tLswH8c6B1U0IJC6oEyp/pYpL8LnzqRtreZ1J\nlvsJaF3T/hcQbSb1dmN9ozW7YzOBwC5CDU682vMNXdn5CGiBSlkRSK72pr7G\njsG7L4fzNIeyydd4D4AUQpkFQ8NCsvC+AMaHF56MFcr95wE1my+R4SJmxcyr\nOl87UkRp7kcq0KScsQtCU54ZyhI6ugYmRwnfhYjwOxUlBTlFYxpXaBegyqJp\noofhvedXT5p5jym12sNPAZzikYDFxTfHbnwNOeZ+Lotk10bpyl/28JV5KL+w\njT5swb25tJM4fLudWDxRK0r+g1MuoVpQch8ikXacc9X3ey0l0cNoxjmm6cX7\nqiqL/2/d1jQTKj4BmN1a8E+Y0PF6F8mbPQLQWj8v5LhebJOsSE/8RNUytzd6\nmUAV\r\n=x912\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDKE502pSsROF4G60R6dNZZEKoXPJbI4fhsaDUO1DiqAiEA6+Qlw/nZu22H6HZ2MkZikwTnQ2hnV9kiU6aC8/K9xG4="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.0.1_1626532081810_0.9112516988900785"},"_hasShrinkwrap":false},"3.1.0":{"name":"next-with-split","version":"3.1.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^6.0.0","jest":"^27.0.5","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"a4c81215e85307d3a41404d3ece6e8f2d03c8dae","_id":"next-with-split@3.1.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-DqRKDgxBlJL3avz3e96w8i7BxJAo43chkDGnLIIoUr4Pvi+qbmCX9MqqfAmRE/PdgQEGBclPg4bfLNzdKJ4ZGQ==","shasum":"4b0e9f32f4413d784474c1978beab5908394b6b2","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.1.0.tgz","fileCount":23,"unpackedSize":117323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9/bXCRA9TVsSAnZWagAAlToQAJPjDlrwKh0URmAbARpB\nQrs2Eumy4jYK9C2gFlISRUEDVb9sBgEpPfYjU/p79Dwd72N/pArRhJriPcWt\nEcHNCKy2TeORdGAabo8kAIn8fjGQeJpK02vF/939uwB0d1Mljwa7VHq8/gYF\nmleBzjc6NkRnZYtQSwkxU2XZUHH4ouSROdjjEybhO8SerqmfyovQaXzqDtNB\nQi23sgP0jeCJn983rvoUisdx1awAAO/pQKQDQ+LcYD1ThqQ9aw6jxadqhim5\nHi8/Ms3lV4kPij0kvh27WHxpi3aq57TCKQHTqfVacpPDq63hUaDN9lXbxwLe\n1p/+WW5D0qSIKBTZZXFf3fL2hhsxwRBD/rKG/LWUeLYu7y+t929MPrawtAAI\n2LtdNIHekUBdNwmK5XL2smd1ND/bhSYQ204hINHlzPlNZ4s6ZjJ3M1B7fxJ0\ndEaqBenQjolpEnKQKJTDma5sNwi9Eh9Vq66W6BvoLcmKJ7hWpYmKPRKcyAqG\n5dm63kA2NdjvlLPIky3kM/u4o06Lyk6ERSWjc+CNEu9txcxHaZlQ9YF53JU5\nrObO8aMbVYfxtAuWgpPRwGPIZ7S58Qo8kNK/zcPpojR1qQrhsWVgzXhrkdQi\nGXh+hJm4VG+RhBLYuXklB++VgNc2LfJ4WjELZLUHZtdUnBFndsmC0+V70S4N\nkT+t\r\n=XcJX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbKp+qnp6S6gsc1u8C74Ebem1WxQ8kfuC3soKzk65mmwIgH0WFSomY2kE8VHL3DQl+6W8l0yo5F/HyDlpGevifJbw="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.1.0_1626863318925_0.03932660110794961"},"_hasShrinkwrap":false},"3.2.0":{"name":"next-with-split","version":"3.2.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release","postinstall":"husky install"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.1","jest":"^27.0.5","lint-staged":"^11.1.2","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.0.0","typescript":"^4.3.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"b988b898b73f47ddbf772fc89d777e89bd74d026","_id":"next-with-split@3.2.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-NxZKDpxduRPvXmhcnFJXmJEQpce93SERLxa3yxTjghn1uFrFA9Pr6/Eqp47eqpaGERSu2z7veFHpp2XMO3kuNA==","shasum":"1ed0a9a30e312fb18303aaca1cc32a011ebeddbd","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.2.0.tgz","fileCount":23,"unpackedSize":118831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE8Z8CRA9TVsSAnZWagAAJrkP/iyeRxyaQrOvFHOczCzg\nDhREat0qcZ9FHg9fKtw2CpYES0uZSJAyul2+eBOc3F0w62S2AL4yA/1zAj63\nP1+f9o5L21nYu0oBeDDu/dGL/KTrdtXPnxF0NCcQpjgM2cl09u7FiXDHPjDV\nySEcoSL9Ia8OZBIRKbCffAZIYWHO9/gEyNZpsSYn4ptFwYgb3aBRO6tcXrGe\nUVrMz2ekg3NRZoiHhCMYbiQ/m6VrRldIrIBqSlK2xs0GvM2b3EjsHI+30Vtj\nAJoU478ko26TKYZ16J0BRa+uq2mw1/DZIt+gMabScuXR4Eye9uEM5Xszc13x\nrdi0UJ8U8MdAKEG593vjBWV+SeeR9CYRRK0N0fJjPwEaK91GxyWWpYeTL/xd\nZxwFYEzxVJ4LK8gtU6iB5ovoxcXMRYVOVbT4U2FT6XRUHbpcvBiB2xm5p1kA\ndOskRarYbW/3eAEEhe90dytQ7df8jXUI4zyO6voQ5iGcoGm8Or4SOGYmOQiG\nQQa8cuRwhyMBXBhc9KdgD6ybUVR/8usgcew5c9zuE/01VqEM+jZX8kWsM1Wp\nU5o2jqb0lLqeT8NAi+nmMB9ZT+N08InAyuaeWpBpfeQH26m7inNG0Tqng1qz\nUgvUvCmPXFZ7n9pX39IhlucIm8x4PbxmHQmR9XEgGMr/0IbN/5iFmbM9HFrW\nrGj+\r\n=MkFc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFcNkkSmUWfJFmyCu51HrolWVfJxSIi7W8WJPmpMcUYHAiEAutDEnXR/xcVG/OH4viAcICu5wlgtskf2v+SG/vSOD8Y="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.2.0_1628685947785_0.30206766418055775"},"_hasShrinkwrap":false},"3.2.1":{"name":"next-with-split","version":"3.2.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/cookie":"^0.4.0","@types/jest":"^26.0.23","@types/node":"^15.12.4","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","babel-jest":"^27.0.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.1","jest":"^27.0.5","lint-staged":"^11.1.2","next":"^11.0.1","prettier":"^2.3.1","semantic-release":"^17.4.4","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.0.0","typescript":"^4.3.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"a92ae4062dc52ae66af5bdd06a454b7bf128ac21","_id":"next-with-split@3.2.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-FvAfJplyP0aIWtaNyK+3NnAa/6+0iDzaP+W64+y4wmARVs6Mg67n0EvOtl2uolqIA5JcWPQi4NWOdPGtak9xVg==","shasum":"8cf1f450a6f4d2b7217e488f9c6652648383ddc0","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.2.1.tgz","fileCount":23,"unpackedSize":118827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFO5HCRA9TVsSAnZWagAA5kEP/Ro8rtnIqP9TmYKW5TbP\nlc9WMFlA5vyRrt3yZY38zCoY295NhRhaqxuN0ir+PwanvfcN7Xs1SJ218hwT\nToXh1FInCj8wJIH9yhrcxm+4lSC8tNSNvPMiVlwbz+Dd1RdWFvcjb7fn4Cap\neDkTNgca/olEQaPbbFrsXptE8NkvDuMctqGtci41IObI15jSN4CqGBp+LIh7\nispUNK7/Dn5rWB/jqav5LoKC5zHw6qHbrTDjujkxeyGrtlzmNIzFDNNL0s7R\n8qcMKhiYD+Qp0Pr3h0bdcV7XeHNp8bKcYf9r32LKiouoBy1E192A/Jq7QBQh\nF80uKPm0tkRL1LKQJG6mB7EWsBNuT/GydUvHdf6phrYZsmpUXLf7eFlfsFFu\nSuTLXP+2jEXbbb/fwpxPf4KPU6Ttjd5RWWPkGPZrsQDibtB0gEecjueTVv5+\nh54ldxssDLVVJc74f1aEl0KSB3M1n+afKRQ00Vyn9nqQAfT2Pv8hoEMZcGcg\nmOm4Pb+rLb7Uv9pdErogfetb47yn6qTBhWWTOLTXg3u11tkK3jT5VG4I4flI\nweil4gb5ZDTAo5SXCKfvy35gdXNMOzweaRWoMH1L5C2RTpQlIbDD64rxsqaH\nvVUuozHI6AgR1t+OAK/5HfzPAKqFKwEoK5Bd7lyQcW5aN7LGFvalFvxMAWbI\ngIk1\r\n=er/1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICxQTWVHHAFsja99Vg+NCnu57dYamePdUmGJajA6FD9dAiA9bfouj3ByoyzKHqMpheMkEUWXYgkaxFkloiCXDJdn0g=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.2.1_1628761670833_0.10407107762667445"},"_hasShrinkwrap":false},"3.3.0-beta.1":{"name":"next-with-split","version":"3.3.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.15.0","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.1","@types/node":"^16.6.1","@typescript-eslint/eslint-plugin":"^4.29.2","@typescript-eslint/parser":"^4.29.2","babel-jest":"^27.0.6","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.1","jest":"^27.0.6","lint-staged":"^11.1.2","next":"^11.0.1","prettier":"^2.3.2","semantic-release":"^17.4.5","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.2.0","typescript":"^4.3.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js Rewrite Rules and Cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n:bulb: In getServerSideProps, it is running an http(s) server to act as a reverse proxy.\n\nNote: Vercel is used as an example, but other providers are supported after v2.5.\n\n## Require\n\n- Using Next.js >=10.2\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize next.config.js. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n2\\. Derive a branch from the main branch as challenger. \n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/:path*', // Paths to perform A/B testing. (Follow the notation of the rewrite rules.)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 // Number of valid seconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/:path*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n\n- If you place `pages/split-challenge/[__key].js` yourself, set `prepared: true`.\n    - This file acts as a reverse proxy to distribute the access to the target path to each branch deployments.\n```js\n// pages/split-challenge/[__key].js (.ts when using typescript)\nexport { getServerSideProps } from 'next-with-split/build/split-challenge'\nconst SplitChallenge = () => null\nexport default SplitChallenge\n```\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  // You can skip the automatic generation `pages/split-challenge/[__key].js`.\n  prepared: true\n})\n```\n\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/:path*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weith: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 // Number of valid seconds for sticky sessions. (default is 1 day)\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"62ccf37ca73785c819372b0ca22d1f7178aa4e90","_id":"next-with-split@3.3.0-beta.1","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-Z1K3yd/4rTNXFgMT7Z+4FgpvTV6fyRTBK0L+GT4Ie69oolfbCecsHwF3mtleweEj7t8pfSl5Zf4YLuujHmhCLw==","shasum":"95eae3e10a0b72aaea0feec2a9a22d32fc34a78e","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.3.0-beta.1.tgz","fileCount":23,"unpackedSize":119090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHRBkCRA9TVsSAnZWagAAwdEP+gNGWxcvwDdFcnM8JehH\nzzHeHYVkRPNPmYzGDsQoSYBi9O2abqmZL8CgolD4hOdkHQFxSJI9TLTyX1HU\nXro4bnC6UI7C7Vb+2YYUPM/QSzcGIMrA0s2vXYMEb+xgdbz8l6XZnUlwFsks\nWag4nimy2PeNJioTJjLWoBIOJ8qzSAKt7y7a+y/v4jCF3yQbnS78urX7eEqy\nN7PizFn4Kvyag4iv7hBFYB1lFmRS8gQiSfdUJ05kKNuySPNcc+PIE/Khltq5\nxcE78jSW/dUq93QPdtSyYJFDo3+o1puwPnwEXeNuCkDuJt4HZLYMVfrQdhFm\njlK244rLOwn1sjjEwDInJVKIVkUKpmNHaUVU+SbMbWAXIUXpdypwj2U6gScU\nO1ImUeBwidiwq+2yGbfaa95Fw1Q4Cthjznwa6uKWh5FZwVjXqX/bB9F2jPSd\nAiaAlSKMmQOTy3DYJNUY49lofp2MupdkZkCgWjXzgFSgr/6fc2PTO9XIbGiS\nGjvSTvSlHNvCGgz4rT/sXdtoqCAcrcN0Q2z6nVDuSVKnBE8pHH8odNTCnsCg\njFwsoLiDs7rwwu89W8+Khc6t3+fMb2ykAdCmJ678N/BWgJQapJg8s66GOJ1L\nmZQSUPCh0jrQQUyCC+9TWQiAFq1cMu4hdtpRz1dhus/ks5X83RWCUEOEwBQp\nvMuO\r\n=BXAA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGg8+/wtZFpuZEyqmd1FnZ+4N5LMQ9JvDh6rdPAJNl7+AiAmarMXO1HV1EPp3Oi1HSEMMMza35whA+atXdBR6ms1vA=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.3.0-beta.1_1629294692571_0.5039941695821104"},"_hasShrinkwrap":false},"3.3.0":{"name":"next-with-split","version":"3.3.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.15.0","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.1","@types/node":"^16.6.1","@typescript-eslint/eslint-plugin":"^4.29.2","@typescript-eslint/parser":"^4.29.2","babel-jest":"^27.0.6","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.1","jest":"^27.0.6","lint-staged":"^11.1.2","next":"^11.0.1","prettier":"^2.3.2","semantic-release":"^17.4.5","semantic-release-cli":"^5.4.3","ts-add-module-exports":"^1.0.0","ts-node":"^10.2.0","typescript":"^4.3.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"12927c6aec509271749ddd3b0c091e7f074b40cf","_id":"next-with-split@3.3.0","_nodeVersion":"14.16.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-HAVF9W8CpohNCJpFFltDEnMM3kZIa+S5/borjtNDah7Ugkfefi568Dsdmux6WOfti3i97e2nPQp39YCnPSV2tQ==","shasum":"6e1279eddda28f049562fa4fe5a3bf0ab6f205f8","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.3.0.tgz","fileCount":23,"unpackedSize":119083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJPXICRA9TVsSAnZWagAAJUYP/R3+xQIESpmwdADxus8v\n/cYM9mZmJfuSdX9MMfyNy9rKGnZ2kdIZQe37J9I95hoF5595DhmbWpwQTzzm\nRfum0SncvVML78r2vm+YjQ32cy7n/bLnRXsigm6EyggBT3bokK5krFh8CqgB\nroeEAsQ5zEsLJmnekP1vRia8VHdL48utj4q17JcMcstYcAYSCV2RsLHMaK14\nSrtCnyXe+zP/E15koE2NY/LpWgdfdhNl1tLPHRLkCob1SS2tO66rVe4KrFbQ\nIo0tUN+axy5JePzlypjIcr4m+bThso+vT371+iNVlqHG8Y7rzxnBk5UbXEIu\ngg8LE1yz5Afj96FkQ3cFRpXSqDi3GIsB733rLKN62x+Iy3obp5gcq+yysWIW\nFviMH1yNr3N15T/5bDQ4K3OUF1lHA1refJZ1TKMhipT6rXU0+STHc5cJi7Dw\n0dBddFSwL9fK0JFgPadjhEKp2M8YGEOSb4dD7l164ufEWADkzcFHtcsrXUcv\n/GyuKDXjMbm9PmositB0CcgccrI+d6FV1NMk4hiw3a/w+PvJe/d3jnElePTx\nF1ixtLvy74a2fyhrFCsFmEhv9ldk0zxbRlLDRdTocAx3iH7ze5jwpDOnvHpH\nf/7Ze20kCMUBmvh2ijbRQwjc5VDyqUo4y/sjdw95p5EXSCPR+nOPJUJxzACV\n7wV5\r\n=7hQp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7r+m/xeE0TPYVqeqdTSoTemIxj+xrn5kIRb4t+MHoTAIhAI+or9OZDPklxKZU8mE6W1mfRfzSBpSfCujXJ66mv0ji"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.3.0_1629812168079_0.8191125254086757"},"_hasShrinkwrap":false},"3.3.1":{"name":"next-with-split","version":"3.3.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.15.5","@babel/preset-env":"^7.15.6","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.10.1","@typescript-eslint/eslint-plugin":"^4.31.2","@typescript-eslint/parser":"^4.31.2","babel-jest":"^27.2.2","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.2","jest":"^27.2.2","lint-staged":"^11.1.2","next":"^11.0.1","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.2.0","typescript":"^4.4.3"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"3d177fb6bbc61e6632155933621e70cd83cb8dd5","_id":"next-with-split@3.3.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-NzBhQmA9fSwHRO/BVxyzPYWvZiZjCeqQ9WnlCQByK+Rnp+mxEqu8H45JLOLEvN0fc1n5dmdO4UH2x8uNAy8SYg==","shasum":"ea21c5669c483cc89f19ede86e65be3929b888e6","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.3.1.tgz","fileCount":24,"unpackedSize":268924,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIoXHgGWxn8+IYpaSDFC7yhULW7/Osz3mr4kVAxJehvwIhALxnXTX/pzuSRVnFmNUsPBYqTFNza66djqHqdpHm1Jxc"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.3.1_1632656271019_0.1507440445233219"},"_hasShrinkwrap":false},"3.3.2":{"name":"next-with-split","version":"3.3.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"nookies":"^2.5.2"},"peerDependencies":{"next":">=10.1.0"},"devDependencies":{"@babel/core":"^7.15.8","@babel/preset-env":"^7.15.8","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.2.1","@commitlint/config-conventional":"^13.2.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.10.9","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","babel-jest":"^27.2.5","eslint":"^8.0.1","eslint-config-prettier":"^8.3.0","husky":"^7.0.2","jest":"^27.2.5","lint-staged":"^11.2.3","next":"^11.1.2","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.3.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"97cb72d9b5b40073a78029ef408dce78a3152d11","_id":"next-with-split@3.3.2","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-cVK4Spw3p57Yd1wQaZXdcNzyBP5yr9oDO4nM2pH0NZhpCqs6sTr7mlzSKHTGR9L7TiqHvRJnE76Jk3ZvjdV+cg==","shasum":"d8edc305dc9e386f71d363683f3c177a00b8b952","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-3.3.2.tgz","fileCount":24,"unpackedSize":269223,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE4lfmmPHiS28SZmBhLg6M3CuQO5+IvVk4klH1y4CMRMAiBsQ/v9sq9IU9HIckmRgeUED35W/JO4ktweehdmP1fHFg=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_3.3.2_1634227025877_0.44204908922507724"},"_hasShrinkwrap":false},"4.0.0-beta.1":{"name":"next-with-split","version":"4.0.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","type":"module","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.15.8","@babel/preset-env":"^7.15.8","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.2.1","@commitlint/config-conventional":"^13.2.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.11.6","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-jest":"^27.3.1","eslint":"^8.1.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.3.1","lint-staged":"^11.2.6","next":"^12.0.1","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js Rewrite Rules and Cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## [Spectrum](https://spectrum-kappa.vercel.app/)\n\n[Spectrum](https://spectrum-kappa.vercel.app/) enables you to control your A/B testing from a web console. Please give it a try.\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n:bulb: In getServerSideProps, it is running an http(s) server to act as a reverse proxy.\n\nNote: Vercel is used as an example, but other providers are supported after v2.5.\n\n## Require\n\n- Using Next.js >=10.2\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize next.config.js. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n2\\. Derive a branch from the main branch as challenger. \n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/:path*', // Paths to perform A/B testing. (Follow the notation of the rewrite rules.)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 // Number of valid seconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/:path*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n\n- If you place `pages/split-challenge/[__key].js` yourself, set `prepared: true`.\n    - This file acts as a reverse proxy to distribute the access to the target path to each branch deployments.\n```js\n// pages/split-challenge/[__key].js (.ts when using typescript)\nexport { getServerSideProps } from 'next-with-split/build/split-challenge'\nconst SplitChallenge = () => null\nexport default SplitChallenge\n```\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  // You can skip the automatic generation `pages/split-challenge/[__key].js`.\n  prepared: true\n})\n```\n\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/:path*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weith: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 // Number of valid seconds for sticky sessions. (default is 1 day)\n      }\n    }\n  }\n})\n```\n\n## Note\n\n:warning: If you set the target path of the split test to `/:path*`, it will not work correctly. This is because the path conflicts with the default paths `/_next/image` and `/_next/data`.\nPlease specify the target path and set it so that it does not conflict with the default path. For example, `/:path(foo|bar)` `/foo/:path*`.\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"cf061d547bdd8cee3e33bb35dcb8d362a67227bf","_id":"next-with-split@4.0.0-beta.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-uuaYbHgJQ2liuyaDUzHBcDSGIXnavciTAk3gzz6b8Tqy4yzzwwG6O0IjedvwgN1ZWdkXveXnbJOuW/hF12A/DA==","shasum":"f9e5da5e643441f59935324359d4b9276a65ba48","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.0.0-beta.1.tgz","fileCount":18,"unpackedSize":258118,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDe7pmNcQ/STEQm4UKCbzrYQyKUL2AYJ97mi/V1vjBHAiBWdM+3BHGaJunOe7qQHYDbyllNrQldco/hcQFqAfj0Uw=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.0.0-beta.1_1635692715598_0.7358114197535546"},"_hasShrinkwrap":false},"4.0.0-beta.2":{"name":"next-with-split","version":"4.0.0-beta.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.15.8","@babel/preset-env":"^7.15.8","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.2.1","@commitlint/config-conventional":"^13.2.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.11.6","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-jest":"^27.3.1","eslint":"^8.1.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.3.1","lint-staged":"^11.2.6","next":"^12.0.1","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js Rewrite Rules and Cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## [Spectrum](https://spectrum-kappa.vercel.app/)\n\n[Spectrum](https://spectrum-kappa.vercel.app/) enables you to control your A/B testing from a web console. Please give it a try.\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n:bulb: In getServerSideProps, it is running an http(s) server to act as a reverse proxy.\n\nNote: Vercel is used as an example, but other providers are supported after v2.5.\n\n## Require\n\n- Using Next.js >=10.2\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize next.config.js. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n2\\. Derive a branch from the main branch as challenger. \n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/:path*', // Paths to perform A/B testing. (Follow the notation of the rewrite rules.)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 // Number of valid seconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/:path*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n\n- If you place `pages/split-challenge/[__key].js` yourself, set `prepared: true`.\n    - This file acts as a reverse proxy to distribute the access to the target path to each branch deployments.\n```js\n// pages/split-challenge/[__key].js (.ts when using typescript)\nexport { getServerSideProps } from 'next-with-split/build/split-challenge'\nconst SplitChallenge = () => null\nexport default SplitChallenge\n```\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  // You can skip the automatic generation `pages/split-challenge/[__key].js`.\n  prepared: true\n})\n```\n\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/:path*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weith: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 // Number of valid seconds for sticky sessions. (default is 1 day)\n      }\n    }\n  }\n})\n```\n\n## Note\n\n:warning: If you set the target path of the split test to `/:path*`, it will not work correctly. This is because the path conflicts with the default paths `/_next/image` and `/_next/data`.\nPlease specify the target path and set it so that it does not conflict with the default path. For example, `/:path(foo|bar)` `/foo/:path*`.\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"3d110ce3a3b80d97a9098b4d86a1800904327f36","_id":"next-with-split@4.0.0-beta.2","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-c2ygq70bjq8BpMf3huQyVTFYZZ2W++CgQFYUrXJXA7XkaVNp1veCQcTuv+J+kzs5bQoDVURyWIWY5OOa4UKjMA==","shasum":"78e206cdd64dc2478a66c48e41a1085bb944a4f9","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.0.0-beta.2.tgz","fileCount":22,"unpackedSize":259687,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8MzZiP0MEFWUPL/RhzGEmv/koxOvhRIhTr+yVx/LWTAIgENkWUGtNgKX4niQNbrXk2roEppY89eXMIFvR2c1PfAQ="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.0.0-beta.2_1635693367523_0.7284205375872717"},"_hasShrinkwrap":false},"4.0.0":{"name":"next-with-split","version":"4.0.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.15.8","@babel/preset-env":"^7.15.8","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.2.1","@commitlint/config-conventional":"^13.2.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.11.6","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-jest":"^27.3.1","eslint":"^8.1.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.3.1","lint-staged":"^11.2.6","next":"^12.0.1","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"51232b5de1ff3ec40dffffa6a86d21f2d1bb39de","_id":"next-with-split@4.0.0","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-3IaUQh/kTxbmcx8TVBOJ/TKupmxBJLvUO/xT0+2C7WjxmS4ARsqw6yRNEDx+UQzOt6TabUiUZC+6HkE8DIvw3w==","shasum":"c4f40bda557f23f83fa4476ee69c5ca7a9a54e0e","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.0.0.tgz","fileCount":22,"unpackedSize":256311,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnV6uwKLIjJZce1bvlFAtmaokc9xrZklyygXwVQt1n1AiAfVjSLNVW6KI+dHx3OcF3g31KjtbT4hK6NIjjwyJV04w=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.0.0_1635779061018_0.5396365877576377"},"_hasShrinkwrap":false},"4.0.1":{"name":"next-with-split","version":"4.0.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.15.8","@babel/preset-env":"^7.15.8","@babel/preset-typescript":"^7.15.0","@commitlint/cli":"^13.2.1","@commitlint/config-conventional":"^13.2.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.11.6","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-jest":"^27.3.1","eslint":"^8.1.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.3.1","lint-staged":"^11.2.6","next":"^12.0.1","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"79360ee9b726fd1cb15c63a009886598437f1958","_id":"next-with-split@4.0.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-6onuMQTaIMziSozU9fDvSOtm4uuRgbXM2mVdjEn3g/VkOPOnT7tM9M799AbLhIDdHs7LhWRXzEyQpOXYO0u/ow==","shasum":"19d5769622cd4c04442183d5ea0a0e15c676baf6","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.0.1.tgz","fileCount":22,"unpackedSize":256375,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLawUka8DPYA9e5SJKchYzas0N656E6N/+IGnI/w8MbQIgLqoQMqawvRYVHncDpPOr/4B6oGXPT5hRAbJjzAva9CM="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.0.1_1635789155676_0.5810509295516928"},"_hasShrinkwrap":false},"4.1.0-beta.1":{"name":"next-with-split","version":"4.1.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.0","@babel/preset-env":"^7.16.0","@babel/preset-typescript":"^7.16.0","@commitlint/cli":"^14.1.0","@commitlint/config-conventional":"^14.1.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.11.6","@typescript-eslint/eslint-plugin":"^5.3.0","@typescript-eslint/parser":"^5.3.0","babel-jest":"^27.3.1","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.3.1","lint-staged":"^11.2.6","next":"^12.0.3","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-iylfr42lu-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"e2e7b983d79f30aa9d77b5baf0ad52c789c6422e","_id":"next-with-split@4.1.0-beta.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-N4amxoaey1abib9/i3HhO3ynHn5B75Qhh3IMT4qrAa8UvNUklufULalISuSbTLfoPtiaDxe3QESMHlteAeiY5g==","shasum":"0b5ee5262009bec0472f29775fed744fb6e5724a","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.1.0-beta.1.tgz","fileCount":22,"unpackedSize":256782,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTgZ6yfnPgJN9Sd2RkvTJ9gjt52S2eCVd1PbSPF0rxcQIhAMd1Fe0jKjINaM1sBM9gBNuX/xnw1UojrPbIkSD+PqN5"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.1.0-beta.1_1636380455616_0.3845733768177084"},"_hasShrinkwrap":false},"4.1.0":{"name":"next-with-split","version":"4.1.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.0","@babel/preset-env":"^7.16.0","@babel/preset-typescript":"^7.16.0","@commitlint/cli":"^14.1.0","@commitlint/config-conventional":"^14.1.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.2","@types/node":"^16.11.6","@typescript-eslint/eslint-plugin":"^5.3.0","@typescript-eslint/parser":"^5.3.0","babel-jest":"^27.3.1","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.3.1","lint-staged":"^11.2.6","next":"^12.0.3","prettier":"^2.4.1","semantic-release":"^18.0.0","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.4.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"fb2d3227661c267bb924edaeae2180b971e94c52","_id":"next-with-split@4.1.0","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-fZoqqDCM+bBSFxO55QXHKuy2fFv2VTNookMFTZ+g26fidL/NmRTDcbvlOe+KuDAyzvz8Ly7Ya8bneKTccGd6Nw==","shasum":"43099b33a552949ab7a2d162c3fb4e8f463bfb1a","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.1.0.tgz","fileCount":22,"unpackedSize":256775,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7UVb4Zy02vS8/l/7BKK/1YbgMHHUmhm3Hc+BiKIASqAIhAN53UKNMaiFF9KOOrMn4hOFhsAilSzTk9Sl5aL/q6z3y"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.1.0_1636380817214_0.26928218925779657"},"_hasShrinkwrap":false},"4.2.0-beta.1":{"name":"next-with-split","version":"4.2.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.0","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^16.11.12","@typescript-eslint/eslint-plugin":"^5.6.0","@typescript-eslint/parser":"^5.6.0","babel-jest":"^27.4.2","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.3","lint-staged":"^12.1.2","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.2"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"b64e920c0e6ec77575aa1e89e97f06e807335434","_id":"next-with-split@4.2.0-beta.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-keBs/QWGwyX8oYM5zGgkpz9+aWzvJQA723CkULDRu6A7YlcLqYkASWhEoGya7gtKdZ4dgun9W7cH3FZ/bAAq6Q==","shasum":"6768c207fb0d02373b9331ba1ecc785b1f536ca4","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.0-beta.1.tgz","fileCount":22,"unpackedSize":257385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsMWyCRA9TVsSAnZWagAAfbAP+gLbK1fUc2qHN4Drd+dL\nXxadKvUKu+K9sr3IgeOfNtAaLjOozHSlMGYsMoJS7lc9+3DjN2/xxGMK+bjn\n+KeuDTA+mL+GVaj0s/6COQYE3oW1Zj5wakDKk/oJcQr8WIBpXin4zRrsf1N2\noAbj+dLRWFMh0uLWLGwIMppWRRBtMgaaNIpOPppC+KWQTxvRs0dnDtzd55US\nGrzzX5ieq58jU5r+bGu192dq3oCgQ/WwRIncr3pmj7pkqugAtvBSOmt9VOSU\nkvii5Gjhq3qwfcYuXc6XEzj0ISAyEaLIcQVDhIvYYLE947iGk982vzLRx2jF\n7SMXVn/ESs8sMVi7g5N9r+EMJj+jrb/IuVl6War3DQ8UAP7fS3FXlicSwu1Z\n4MpCS5xWFkUVloQNNoua0pN3nPoaqGv35yXD+oP/kuKXNeLhHNTXLbpQyAoI\nhG7dVie3XEiauWUjhmK4rQOjArqfFBdI2S5XNjjJx/N/C/dT6zJH0rjV8DCr\nOT9IKpzYKcA5hATK7TUbuaDs0Y8/vm+icAhGP2VBi+iCQWlFRdFPI1aCNpIX\ndZzA+Zl/+z3VUp9SLumX7sPUyZlX22r7mrajJjmKpT+WLUrpVh8LOwFNDWO4\nROnmwlDMaAJ0RLzsB0oG5sQkvAPFLqwu/kXLQHEeUWNpOLGPRhhSa4Wogn2I\n8XhK\r\n=Wiuz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDL+qjC4wOFUrdD6W+axzmmrmofoBfdbTtWRFU+2hB/GAIhAMKZojmgXjHTKvxzSzN2LiJ9wWQuOfVI2L+skCDbmJTG"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.0-beta.1_1638974898005_0.07151153954203227"},"_hasShrinkwrap":false},"4.2.0":{"name":"next-with-split","version":"4.2.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.0","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^16.11.12","@typescript-eslint/eslint-plugin":"^5.6.0","@typescript-eslint/parser":"^5.6.0","babel-jest":"^27.4.2","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.3","lint-staged":"^12.1.2","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.2"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"1f4a1526d90b4d6fa8cfce96edf639bd24625af9","_id":"next-with-split@4.2.0","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-k0ECLs3pnU6ZC2QKcoy1n81+NU4wQsghvXvVjlUEmjhtpGQq9bPBR1AZj2xqDTt7ebwE0l37uriKWclp6cfsBA==","shasum":"4aef94be06b9dbe42720e14297239a25d99ee0db","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.0.tgz","fileCount":22,"unpackedSize":257464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsMluCRA9TVsSAnZWagAAciIP/0uFw2a0JT1rE5+5UZVe\nFwJNMcVaTlNJ/ZPQFoVqiJXa6ojTwCq2RtdaZGc3IbziCxw9pi18VQP3nkS6\nnKx8Fnk6l3FwE8HGezRo+StpK2L7YiZ5/IgroAWKWIw6sFtsYpyQ55u9I4UN\ngl/9mH1/w1nTdxvjxw0wAFJ4Wpzc232HWFyih7SpDPuy24a3P4MZbGsj4ANy\n54VPBzNpmHom5mfvBLiNuxFg8tGqAG83cx1IfGyJRooF7N3vr4ggGTD/og+A\nAqlQcXioPknblO5NLGZO1Cly8wIwrTQW2Y8bomUdbB3JUpbsXz9wP2lQJ3Md\n7pID5cW6JIWeYnUI0PMPrtvykcAdlX7S621UbKHmzoqAYPI2TcvTCQWRUqGz\nCyH7XrIW8ljZRIVWKaVPEKYBNbbkHRGVJURCIC5ggL0n9L3+GE/nULyLLt6W\nzrpx2UH9oFqjrSthZDV+fSjugGfx6GhNahye8RIxCGB3cKsDibQCCQYiX41q\nGmOW4XC4wCuHpzIVHl+AZK7b1UPx/AyvtV6uXRw9Ve7s6tqI7eTxkcvrZkAQ\nUbcrVM+Nx0ot4O+jvgjxBQfZr4so0YJjg9acxe56At6YK0fiZwdbIle5OWA7\nvcQw1mMqI5TJSAuvmtQbGOkAXyMRz9UiWg21FlfkQ+3i+hVJNms4E+s0EMTA\nbDO8\r\n=XCZw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLhkzHVpQv+a55BjOC37675O6d7uZx01oY3TZU+ckvMwIhAMbISZoB30VothpvyFFAqUMdXjvsUpBAzRXJ9U1j8bEU"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.0_1638975853742_0.5115838420540688"},"_hasShrinkwrap":false},"4.2.1-beta.1":{"name":"next-with-split","version":"4.2.1-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","@babel/preset-typescript":"^7.16.5","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^17.0.1","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.4.5","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.5","lint-staged":"^12.1.3","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"bd30e96b9e8ef6eec3d54006365470f3065e04da","_id":"next-with-split@4.2.1-beta.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-9k23Y7cr+IrPGVFeiQh775y4KC7zT6/aKi9apKsK2LF70azwtgssm7qH0y9fWKNeLX4lkJw0nHxssvH5NSHQ5g==","shasum":"4250f971507ab4222d76f8f269812a22ead1ce56","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.1-beta.1.tgz","fileCount":22,"unpackedSize":257946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwAU8CRA9TVsSAnZWagAA1WcP/iDbtFVW082mmXTTS/sD\nz45e7lT53MnfLOxb4Il9Uypr4vHfhkEqT2ZzffGRwgzp3dtRXfLzB/FQfzZr\nVDuUHjhIhnQ+WyXwgHUiynNGM23VxPr8a/cV40I8zs91pKC0VJJhyKtCxXPN\nJoFbWxN0iDJwFUJkdO/6EvUSZgBNmdpjFKWr66AHoSX3xPWhsYk6gW7lFpWu\npVyS04BDzwQqnPDdnFf8gLqlBAW3/s+6s3P3BBECDjcNOQ6PNFtimghQp+4J\n++zjApOQEYThtn2i98HwVF/sh5oLxxbGlh2i+vrSZTR4Nnzvcvjri3/WruxP\n3KJUCLmBaawK8/WYeh+UJ6mfAemAxSTzca+pOCFrFzCDk4Y26Posp0PyvYQS\nPbAT5g35jBBwira2Pl9jRkb1K3fmQqmEizaFW7PvB4Z/4+xDQP4KJCaA7nnT\n6CT6ii3c4Kyj8xftDf87dWJn25z6u1cloAQnM0opqcv1GKB4NPaSQI3EjLIf\nLp8yYvrm406BHKAeqoeTOywtzKBXykp+FOx796c6cenusE5f8QurtyAkpK6C\nPk1Qx37gVTnPHbSb2XjutCFRmub2SOUF3Hb3V+pf+vVL4HRvMvb6TqDLrnH8\nZveygerRP2rMEgqf5h5YKZdBvUb+pHzghVKpcWPXZSK4xFT5RK7xE4n2Fpmi\n2l3I\r\n=uxKr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICExIPMpISr+4w3WTnV5MV8ZXQJlHj5CDQQ4aOxOeYdpAiBS62PRyEffe41Oi+bJFXBRufZpTVTeELpljEuZ4fWAzQ=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.1-beta.1_1639974204636_0.9153584850302605"},"_hasShrinkwrap":false},"4.2.1":{"name":"next-with-split","version":"4.2.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","@babel/preset-typescript":"^7.16.5","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^17.0.1","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.4.5","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.5","lint-staged":"^12.1.3","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"64861d3cf68862840b5eb62294e2fb0658512cec","_id":"next-with-split@4.2.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-lYCI42uvL0K9goQjnRFwRHgOiyKEsBr6HaczozPQ6ldt33C0B4H3LVte1x8gFsiNsAYKSA0JSEngip+O+7NlZw==","shasum":"bc16bb278c02964ed1bd42b87dcc756cfb10ff90","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.1.tgz","fileCount":22,"unpackedSize":257939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwAh2CRA9TVsSAnZWagAAXawP/114RM7pFQranwjMJsbI\nQc38Snx8WVQ3niHXnBrNLytia+z/hm2/cosgKcCtofPxe3KAL+RS631GuCF1\nlcImXg0WAcsGyJCSl+P8RZKcDVkq3wTYmPrYXrOQ9BCF158OaWiH/1jBYLKA\nb5upSkxZR6o78oQL6yzpNY5T8/KlhBUkCjCTADwaVXUjyBsWLTAIuFp0FZDe\nI4g4lUc6DcXBYllgt2c4vpDQZy1N7DrJO7HQwXxnaDwRbzXzp60EFXy7yUqG\nOAEO1zcjeYbE1S4B+vIXBbk82yvRpZj/rcKa4fCdeW0MnjgwgO97HVM+BcmT\niTc3HpQl0rHt4Jf08NZWL+r0I6Q2pIDpWBB7DxjRor+B5okVWATnLvI5vWkp\nzakFkePamSSdHQlNc55KU4IC6H4Eytb4I9vPOA0eJhkk8QXebJ1B0ufRH7Ti\ndmoNQWuPSOA9r5mizNZdtD5DarwHiC3KPnV4vEI/j+F8/033quES80wIVJbr\nxQZhWysfcaCk+xO3Ap+YhTxRd88IWezZCRuNX0pRlwd06ctcwVDMVAQwSlus\nUThbppDdla/7JV7csH9YtCSyYJnb/QvjGJPEElKldR2RPpRtFvdMdXXkSMnL\n95oVnD4k3U8Ntff8IBigjmDuxmzBpgbpnbbfmCjwW/+MFST9ixxPOU1YhV/W\nvks1\r\n=Ke0U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBg/yLeYl5w1BpRQYQ6iuUGjE4AfMibN40h0bQ4uEt3ZAiEAifXqvHpDk1RB3T87xGjscMlg8H2fztl97cVNIwwTREs="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.1_1639975030682_0.12239792189800269"},"_hasShrinkwrap":false},"4.2.1-beta.2":{"name":"next-with-split","version":"4.2.1-beta.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","@babel/preset-typescript":"^7.16.5","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^17.0.1","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.4.5","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.5","lint-staged":"^12.1.3","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"5401d213368994c8b1d94ce848a925062eaade09","_id":"next-with-split@4.2.1-beta.2","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-pyXRW+8eif408r8RbE+qx37hexeFk3RtEaIsyTHxXlPviC6e87CnQdllxB/tjGo27hLpoTzvYh+Oy8/CTokp2w==","shasum":"75476bbae257d2dcac31e8cf61578819e30cd8f3","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.1-beta.2.tgz","fileCount":22,"unpackedSize":258648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwVwYCRA9TVsSAnZWagAAltkP/2Ds1Rct2vXZruvSou5C\nnTAbBekXVPB0X5m4vRzZpsMjqZe92tQXKLwPIb7JSgv5s3tgrJFnJYRhJUkK\n3bqpGcXf2AOTLXnCvQCMtY1IG7pRSHoS8vQwQE4vE0mlJkxvu50Hh6snQc+K\n+Puuyroe7nwP1x8vYmtVQGstt0QSFcQopHiU42ZV+bmePXcdyA6eaM0OZpYh\nSDz+JwccRkEhhHxqSLhacTyrQj0tlhg7zx+Lcap4wQomVFcwGqDz3lzhFees\nrnfiEDVbKswzMs0+afRpePI+mZdcWNn4tzg/m5UUDGYOzxkQ5p1YrlDwYP1D\n0Nh+/HtiiRaVQEriZ068FJHk91IKdYXzTWOgSR4CmqliE5oZpsWlFTgoLXzz\nsN6Z1ynoWd3K/GLotoo6RofBq3HbuLNniD6IOa5LteOdufSfQusaBdPNt5AJ\nQPaC5JZHXV1zqxi5Avev3KT8mwD5GrpJpthLxV99f8Jt5yvLEbUKxPTREImw\nc1z2a67m2lIhd6ijd6ALs8/LBaIDsmLPqsdr0AuDQJ9QWaiNnWxJlCBHpRyL\nzr7N7eIOonfs+3E2AmjG1bHO83FeH0WyoxxvswwRKR86d4vqmEt8RSyo6irV\n2o4d+dOOUOHe5Tdwa0jU53HJlZyOljxZL7Ihlgjgb5q61gGEBs1CjLwNfCYu\n+cEf\r\n=nUXt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHD1FwBV4VCHYh28SKx64ptdZQ9ron17qMyL2TdvvOjXAiEAmLLOVS4MugQ5elWy6mdKkIa6c9LLk4VpbKI+8kdAdOM="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.1-beta.2_1640061976702_0.8748219893819933"},"_hasShrinkwrap":false},"4.2.2":{"name":"next-with-split","version":"4.2.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","@babel/preset-typescript":"^7.16.5","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^17.0.1","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.4.5","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.5","lint-staged":"^12.1.3","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"46bbec293d8674629a0c67d1b9359e0228ff5d5b","_id":"next-with-split@4.2.2","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-WuhAuaUwWSZ9bM5eh1W2ziAfKYP7uYPv+1oViVK3qvlXVXCdaLpf33kagE+dDTyf6JmkEiHX1ODF4yOLw6nIFA==","shasum":"7575f3d9498eeeaf816c2e3851c12aa8bae8f8e5","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.2.tgz","fileCount":22,"unpackedSize":258641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwWJICRA9TVsSAnZWagAAaZsP/jLm0WNCWoFeRHmJN/Hi\nb2Jj6DBGX4RKePZmkRZuD2yzCEsQcQ9OsbqQx5OFIbDrMiZfT8ahZN3ZAmQ7\nbK9FNt1aYJSkRzmTrNwZUNNAP27rR51vGVfZ4VUk42/B/40Ef77RhEqQzo5x\nOrnwt1mXExBOpZJi9r6bJp7frbPum5i3OCL5Ck1+865E3exxcqtZt/m/tDUn\neyexu3nw+3pJ7PjVGkvekp6gDh2zvT5auPBjb0b71F7EKaLs+kgWFKIBXqmZ\niqMF5fe3Y6D6HEYZrGGgGkbt0DbCuMSTK9HDXBzzFysqHw4CmSGToTQM6zyv\nHhRfRPRdj0fobM8w2aQf/wMtTYVpSgxd+tBK0cINhc9VWCq4W/DaiHL3w28W\nnbx/2KimJnKgRUSo+vPz+RJsT4wHmVk4p+SpleLpGKwrs8PTpmdWdpN5uyPX\nAjO7HxVqnjOKlchUbJQyF1zxtMrxz7DJKzsD+9K0edB4uL5a7Sj8B8G1gTS/\nxa+ha75fWML58jJ9n9eO+Arag9ugSFfzOvnwRElIAW7zk6Uo1uUmJqZ4EKwT\n54LB9ndhPLG6+S1ffP19qEHo+ds05n9oyPQ9OO2eL+snQh5riCP2TTxyoCT/\nxwXdSk3J+Jk7c114yWhiw/aAea1QXxpLX9kfHR49TRWNtVuTBVv/DmrZI/ap\nIemQ\r\n=dJtL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnQkdCADyZ+zaGJ/NXV7RB3l3d+kqgtRm7jcTV5BC9jAIhAPC/FB6m+h0khj55v/QWRnN0Md3ML0ZlUmCMHCvyJqs/"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.2_1640063560665_0.4690303210077418"},"_hasShrinkwrap":false},"4.2.3-beta.1":{"name":"next-with-split","version":"4.2.3-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","@babel/preset-typescript":"^7.16.5","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^17.0.1","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.4.5","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.5","lint-staged":"^12.1.3","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"a17ee9d0d19648af39dfa653d070502a6ea2bfba","_id":"next-with-split@4.2.3-beta.1","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-J4Me+WcP8LWG9XUqvfKYU+hX41lUwwtyHAq8j4qzJud0FlFAGnFJJsKADvMYC7Bhi75z64PPQDaJi+zzGqsY8A==","shasum":"85a854eea2c0d02c81fb3b44bbba76a96588e8b8","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.3-beta.1.tgz","fileCount":22,"unpackedSize":258650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwtchCRA9TVsSAnZWagAALWYP/1oaTM05KAP5QIMQyKVj\nkZNaG9InfsxgHSVp4uMxa2gs0dtHV4TnQ1I2Qyh7dRUDRzaiHep/Cs4Y6aXg\n/uKHru5BXBlcW977ZakCKd2eI3245v2GwP8+he+0kBbt+RvRFtt8TVTKBwP5\nd+PqQBsfl2VYJ9Gu8QWjca6M1fNiDOZM9HtJ6dNXZgQhBanQbQwkZWwimZFq\nL1bj+9/my5JS2RIzQZBNbY9VxNLrk4TXHT/yRKQVyQsZormXJ8uZBefHSXUD\nj4xRexOGUQ7Bmb/VTX2Vdb8Zp9qJCXFruv5JSsVftr59XoQl5hKd0IXcMgcH\nhxy2MiWNcZTTZqFr6uEdY8A8HFdO1sNri6ppJyhDApG/6dvc0gtR9pS8fIe+\nKkETl189FfmoWPmKUFB/AKm9yZBHz+CoRGXdCP23p8Z0zLIUT2EKld9hmnL6\njEQR7Tjb3wCWxIbnUoflCyZbUovfDxTIKxf6ee73/IJ+K7eJ7H7Fz1XLlH3p\nKKRcpGymCjutOdWBYcO/O1KIuBZMS0Bf+3ve1BVAQqyPA/79ir7xBA4O6Cg3\n2A+9AcFot96GfKkak8aY7PLuKmsAmiPYplLuBU/+brrnxA6mDtFzKw/iFXkJ\nNf/+AgRzZbI1RS6EdsfT1rRSJjfQgTCWhggDutXnb4X2nmLWiVfYAGknm8GI\ngnbD\r\n=JoUE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH+JE/3utOU3WYXv8sMGin1M6ZvmtgdiOLJ39+ucpbg1AiEA7OA9KWcwwuGveVFWcPZAilIzBh9JST/2SyWTASxHJ2Y="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.3-beta.1_1640159009181_0.9850590715090926"},"_hasShrinkwrap":false},"4.2.3":{"name":"next-with-split","version":"4.2.3","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","@babel/preset-typescript":"^7.16.5","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.0.3","@types/node":"^17.0.1","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.4.5","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.5","lint-staged":"^12.1.3","next":"^12.0.7","prettier":"^2.5.1","semantic-release":"^18.0.1","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.4"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"e685111d83b7a27ae51197f47c161a1fd9db4ffc","_id":"next-with-split@4.2.3","_nodeVersion":"14.17.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-TcgLARkNwJDLTmGfYDXokGMYoL4N0oxqA7eQ5IcTUM1hDtb4tysm8nGQkYW048n9dZe0gIfM/9w9YfeUcwJPxg==","shasum":"220e18a724c153e1104c2fd6c084d06bfb95df91","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.2.3.tgz","fileCount":22,"unpackedSize":258643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhw/pXCRA9TVsSAnZWagAAz0kP/3SNQXBJQsSY/J0TY9oH\naFXz/9QoyP1pfgoXnGXutLh0UNWxvYviht9MDw4Jy4X/lO2x9w+fglr0tA/+\nbJ0v0eRpmie7/wDX3pZJijT6cvG0GwiAOfEW6JPO5KZtGFxggrOiity/BVIk\n+mMG6crY8rCF+9FeXVKWM7hk2upUyhM06wjKkutzoqdInb+qccNctYxtnCmf\niQcf2SHEBKPLMTPBuSORa3MNlw2DPHj3qHu9eHbp2olt7k3Tmr4lpFt8tzvq\nmmuC600cXZVEC6hse/333FShtsnQ+6Dnqu4BCDzrWFuP4zvMJ+o6fVVYKpbS\nUs5ykH/KG56S9rmujgTkQNAXdLGv8mXB2KUdbsYt8YgfDmSech70tPq7H+4B\napFyijwUDZR+KEBNhcDqFUHi9iVyB95j4RmjokoGbtaoFMn4cs20ArRkyHX7\nIqfuOVctqdmhJN/1F3ZNtnsv4hYYK1IOA5RPZ9HZ8lSFLtdxhZ7NvXdUq3k0\nR4ivND09DBalYh19P/4f5U9X6JUXMX7qFaL3tZs619AfYH+zszVqiJbOVz5s\n7vYLYsHGw9Xcq+HldnXRMVt3QHtf0rXi0GBwOIv/FbcPiOXUc0BSqCSQQUH/\n24dEFrxUZQBE6Q2MoLWWSHtkgDTWIMpHyFl3Bb+L+A6XtDQGf9DlaBFvSnYF\n1mzC\r\n=yiSj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/C0cVBFZx1RpQQHGIBRQvtwsLq6eNCYZ1SctTCh3aMAiEAtnA4X3jvisTVX09cTGoiiAT/A4QhrLkSd2lZKWcOaXY="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.2.3_1640233559392_0.05623984155691053"},"_hasShrinkwrap":false},"4.3.0-beta.1":{"name":"next-with-split","version":"4.3.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"with-next-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"9c928f23061e2d8de35d14438b1e8147d40ed6d4","_id":"next-with-split@4.3.0-beta.1","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-Xkrnz5lSUMZ9Atr+jV8yqpJlGDACMO78tgqXEvN1klgXyABPjPAfKm2Nln5sZfu7t7rBvjE/3nXS4jxuk150Vg==","shasum":"31cec6bba1e6704b8eae0dc6a64363ef355b7500","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.1.tgz","fileCount":24,"unpackedSize":260387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7UWbCRA9TVsSAnZWagAAnOAQAIm1Ejmtn08dw1l0cVhv\n9oN5UwFUb6ueUD4tyo5MrgYAFVvHQv6CMQhfDdMwRGLuLTlcuEojM4V3Ja4c\n0bNnMMOlP+OAV/ABnOBSLSg82T8njOCpc8fgFcKCYAFzTTWqMLgughjuF33s\n6A4pwQlrFYtWSbAVFLmUPortfOsE0IxH2eQGxKgod2AbcJtOKMzzlr27dCLo\nJywzwzuyVZ1HZGQNp2MdrisnHvJzW1d/KSOAAPEDn+9+UaPDYjIghG3VEVn5\nqNiRV2e3e4N8jiUUc9rkYKjGRV9hvGcLQeZ6IksTdxyjCk7xe+B0DeAMMwQg\nT9jrVpUH1+XcR6QhoYWpyxeXg7tCjTJEiO8EjAXaPZ5BscLvNy4K6XMrrr7b\ns9VkdgQ7G7IcuDm0/7QJqCdfi2m+EH9UXPjIYCrJpEU3pOiCO5tEeYjoUqeu\n52NU/TcdEYiBMC6lL9ZGYXU268LD66nnvL9VBFf3qIrGDylt1OAEBRq51AGA\nKVvCukLP7XrP4y2J2vJ18YITsDNq+JxzrwBkM08hBS1eE2fIUu9mvp2hP3Fp\n9Iy0ff7mhN4lQLlDs0FrpDHR3CPo+HU63RJNfSxt5pSja7jEh4ekra9x8iTk\nMaOYblhfEfjjNS0tB6FoK2qwcr7ilPglzKnW+nAX5ggRpMBZ2vWmhhiGNwNd\nfQS+\r\n=wAoO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlATsNLYQOlwLzfhSQq7ueL3KNgOfTT69VHcMaIU9N2QIhALTbxPhh7y5/bMwl0EeAUnA+lNourOvG4PrpMrXq7Cg2"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.1_1642939803356_0.8499197212817691"},"_hasShrinkwrap":false},"4.3.0-beta.2":{"name":"next-with-split","version":"4.3.0-beta.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"b94a728c89ef521433acc0d42e72b73c36080d4e","_id":"next-with-split@4.3.0-beta.2","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-NxIbg9CjYHdATPNV6XI84NHi2zRZyLV2BiBSPmbKf4mkpetWJhlDASZuNENFwcsvmmH8SY8EGiVSNNB5HqAc6Q==","shasum":"c0148ce775659dcf21ea23ac4679e436503af313","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.2.tgz","fileCount":24,"unpackedSize":261673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7VXuCRA9TVsSAnZWagAA+C0QAKDphkJ70A4xjAUQz6zC\njZbspLQeShkcF+c0PlNqs+RJBJHg/2FS6dQTaqP6MIm760YzHKDMZOvh55Bg\nD5CAuTbCT8tQCnqUVQ4vGuMZoPNZgfEa2wmbnpLOSB7kJKTX6qSlr0zrTjz3\nBiu+gCrZc8Cx4J+5cwhRzHuiHHGL/81shhM5NVPG6MWBEfn0eSa+ZEycoa5O\nNcH4/eSFMYl7JBfZ9Uc0CbIE8RTrD4oVjxO74GMbF03t+Z6z+JhcouK8QB0N\nLiDDweL2qYWcVrgupqHB3KnHkAPu4351Nygt5/6gKWl9KxqRnBE2kxEXWnrz\nt1XuzYrcSOP87kVYqh0naCM2RE57HJqsOcV4A4lCWtH//dsu0UqSv6zvX8KI\nZGrhBBuXnchwK1FCbpTOzuHRShNFMmxWB21w8zuNnmGMPdZHbr9vTdAvbqhu\nLF6zdKioKielwNCEZk8UtgWElMdxJE5XJmQ4Bhg6ImnhKDTZlKtstYEaxhBb\nDEsAA6TFgxDZ0QHzXSt22pBEXltiOcD8EXjqukRpZ3Mv1rzPQXEH1BrypHub\ne0DD11W9jz185uMcc5TfK8UQzkhEiTOiv7SffHuA/LszYloNUKK6Nm+2MFCX\n6cbJJp8rvbOnbhI8OZ8ReJm89zA7qY5dftfjhLOkxTZOmFtSo9wtPrIErcvG\ntJpT\r\n=qmf4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHBAnJTrSRflIrhzCD0gxL3CWT+Oj7kKCd3ZDUTg5t5wIgYtCIYF9mdIrC6DhCoa+WkTbFBwAYJVg4dlT/088kEhc="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.2_1642943981915_0.24800773818231225"},"_hasShrinkwrap":false},"4.3.0-beta.3":{"name":"next-with-split","version":"4.3.0-beta.3","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"0f5b9a0e64cecc23da89431ceb1c00a3618a63e3","_id":"next-with-split@4.3.0-beta.3","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-CxO/jWlDvs+CmUIRmYxF85BnwUrpAJmYKi+5SYbcDXPg1xzZhbhJDxy8FVWXZOuqroX7d07BeZlArse28y93ww==","shasum":"fd5ebdc6274d852bf5414c5d5c6185c07043cf2f","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.3.tgz","fileCount":24,"unpackedSize":262227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7WBFCRA9TVsSAnZWagAARWUP/joK0e7kRzI23eKxBF7g\nAtgH2ysuHczM+zYGXTCOlBeURDDINeMaJDwotWhdle1xBY5OF3FK8wbhxscy\nIbBrFk0pvAIB5E5afkekZ+3EKmbFazAUehom4yrU/v8YPDgeyKNacI/BiJIs\ndWxOLlJpK7Qj4YIQS2ovdiEazNnwIB5ijn08/andvy6vFTgXnapNMEHq+MjI\n36MGXpMWyifQDjcm51OC/jcb4WYavAKSTq55gS1J0/CtYyVH7t39r+5XWOcR\n5uEAfi4aVvdMUeFW1qvH0AIxJjK560InpxN8MlLZrZBXWSCIUBzRSrswvfK7\n1Dbszrf6bqyzKX3cS1KJ6nsZRyhRmsuo0J/AUrHtb3gMIuR4U/IyyMJrvEyT\n/7pojVysg0g8B2spspYSAhSWIH4JOTyZ2WZkOMpcpjoJuT5E2P0Nv7lHpr+5\nz/icfd3AmMz664KYqOUaLd53cp8v0RYeRuZqPyaQUMXA8oxhX+zRTO9/srPG\n7V7OvwTqC7dNol92R3XflXu3ElYLALe1BS06sawSPb/uMtu+eq1grY5RlJc/\nDTa/tmUyncQrU1YoT+4Q4nEF82ystU4vGdicLcM3aFfnMOjHfG+tW+kBzsx4\nVoh8xy1PXmIJGugie3KCPAVVtdApRdlUn1vKluMl9W1Z0+BSk30r7Nv92I9N\n+T88\r\n=3Phg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtpdiA9uvGio8a/9X2+kq+gJHVtWTURmnenJ64TMdZmgIhALDOGORjpAa6cqzQFemFve5c5KQSKt2lsH95Z4VdqpU9"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.3_1642946628824_0.5060423824452951"},"_hasShrinkwrap":false},"4.3.0-beta.4":{"name":"next-with-split","version":"4.3.0-beta.4","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"997247ebe6f188d0c527e2ef302a8264860fb2b4","_id":"next-with-split@4.3.0-beta.4","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-JW2GzBSCi9rK/YweitxvS6tvdcQs6JJ5GQxQVFfZKO85oB14k/+4JjFdeNvvJKV/xsbSoqbj8G7Eqvt8FTh3Tg==","shasum":"1186ba1579e58ce0d7c16264ff0ba9c2cf205b62","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.4.tgz","fileCount":24,"unpackedSize":262227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7WJ6CRA9TVsSAnZWagAAh78P/jfypSahDjkGaw1hEIrF\niE6gevO/MnVxLDVVX/UMt+rAhM6is8R4YDRe4la953CGNcwma/qkywHmqWHp\nWfB8Rpq9PD7vNhoMwtXADcrp+ejAuC5qKzENvwmZuuTFfRToDcFhysJ+tpkB\ndU3i5w9A0KumF3nctNiozxsxK6ZpQso68BZcmnLHhbWPBzkbdMkzuFN4l0+R\nSY0Dz2g6gSWJUbqez2DoYbO1VgpkW4CmIUZd26cHd0n6fh10ND1/yR+hAN+D\ncLFjjewoFWx1oh4u2KpHvF8ZLqoc/4xToBUcBhVwDx/F32FWyIWeXz1nUnFu\nMHTlIAfR5nPuHMhmlqeVbYwhz+f4q4RbbAVbbf9Ixm+RiFSWnHK2Ztrak3b2\n4XEMOb96rmYXev0sKrq8e7RqQd1R16TSTnBvaexM1W24swjiGwM53gmjx7Sx\nM/hDZTesusGvx2lxFRFiAmC+wPl96sBnG6kMaBjmyFwIfRLe7wMJz13v0Kg1\n+EBRC6t+CBE3WlITEVteJV5f1t8g5WZtEKx15K67cH37kI3LSCHSqsY+/qrQ\nPeKsQnGBBBK3IRcpHMEb+2iqnzYrvKgn22vr/f86Fv6g4QkYF5wYhr+KUX1a\nzGzVi2fPKpmFHy0VuIp8JuqPf5kDAhWMWt+NNe7lji1AlSMHN0OmJAhemwfW\nqWRp\r\n=PmYl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMlXkCTxkm4ISwJOa03l0CteP1SNkY5j7YhBpf4X/9hQIgNGF6PI+N2OMnJ82FXEjSwJc/jnNRUvIGjphRxwIS99Y="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.4_1642947194503_0.4453722414011876"},"_hasShrinkwrap":false},"4.3.0-beta.5":{"name":"next-with-split","version":"4.3.0-beta.5","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0","yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"c31e5a30562e1ee7871a30a694fa89aaffc7b25f","_id":"next-with-split@4.3.0-beta.5","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-SH3zgyWOJ/B1sFkz8CaV5fiA/LFnYjMrAvpnizPi3EAX+0/+YHKupZzP85RfHByiAjcoz7Igyhb2KQr2K1o1DQ==","shasum":"1d32a541dded8525d9e868928dbb0b7629ec5671","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.5.tgz","fileCount":24,"unpackedSize":262685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7qBDCRA9TVsSAnZWagAAqIEP+QEuphgTIhPngADNW0qZ\nc9EQcq+n8fcqf4pwyX4ZuGoIqGhfIzyRRYYwlYy/lDI/2LcVtmsTXbyXeaA2\nh3AdODjs9iQIfubQwt1hhA1QDmqzy+UN2MAY9uSzYkBshshE6MxM0vqzzOrv\n0p4OBlvOR/qiE6e5Q/j+8j4DO/KYoVPc3S4sOGwrXcRcsqEMeMFDXVRjOcSl\ngenmwjvx5Cpf+18ez0LsK5IcY7JavK6UDLHUtH2X5v2vFZOD8Msq+AUvfKGL\nd0f6ngIQKnBQt7NDWt38yU07K2tsip8bPZOdb2kE2d4gqPRHATH9BpVpKREh\nrt4gokqVdfLXcyGnYF4OaDOArHZtAs8b3Tj6Hnz0oA/7XqcRBHzU5DIwN6Pq\nyAoBSN5S04tbGXiVvhjvX9t8CBqj6Ki20VfwWbmJHcfs9kbxP99NhOQqYUjE\nnFFqPA8+VD75BSr5C/9mqIQ3MoDemav9QQumg1OkhcfqeWozSzciDrz7PQ9a\ngzstYuxXfjIUhB8Ap/oshTy0ERvbjo+Er1srw6tM4VComlIh/lv0+yrbpj95\nqpL1B0nc4jPF26a01fXQA+vWZVcI9owzgcCmGtwEnYtEuXkrEonx1jQPtqkC\n2iq14RigPj2G2g6j/bAlK81ms3Bfs8BTdFPv5yS7c2+szp1yfmLMYOfLNwHk\nhRg9\r\n=C4w3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6CYOhSMdsokOGnD9wNyHKT4g3eqzhP2VZuQQ4mj/vdAiAGflrLJ1/k/lLUji7HmhHLNzdv2hT6uPD2qCO4CkfICQ=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.5_1643028547729_0.2716701803169994"},"_hasShrinkwrap":false},"4.3.0-beta.6":{"name":"next-with-split","version":"4.3.0-beta.6","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0","yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"50224a29848d7451684345a541aaf82576f115ff","_id":"next-with-split@4.3.0-beta.6","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-pFjNh5QPz5twZmeaIGB2AsHmIu0jXk8nQpPrwF8LBpULn6AJITjiSe05KTUAXPfX/Carh+uo312MoSCILAteOw==","shasum":"7bc420eaa382a91710f77a7cf68c18236a5eb0d5","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.6.tgz","fileCount":24,"unpackedSize":262863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7qNICRA9TVsSAnZWagAA00UP+QFS8ml89nUiYM/RZxu4\nLb05iPxwJN+Do626N4gEkOLATIZfhVVrtzXQKAUq9mUIr9qyzhnkLXdJl0gC\n0+zlRxcUjVw1NXF5Pv9sQG65rX3EFBEVzYQy1UemVKvDKLQA0hJ24WpCs6gF\nQxEarPuf5AucaH4dD7cQhXcPcbXgB5K3naXBX9pT2RWczd8xTvLtqDiAnSKr\nu16fSoNLRd3feGrLlimrcOEm0+TtbEyI9/ag4J8W6awTpyQt3uXtYO+gAOmX\nkOnvtFuVC52pcdVqeKFBrE1NQPxPlIlbNdnvQpcw9OJR78/XN3YRn6wKVpl6\npO01SK5koIQBkSE84E8fM3WeMFYbPPRmO+7RoBOwF86mgVkMvYYIkruhsKD0\nTU5ObNoH+fwBG90WAX2hICFkjZYhzmAxt0GN8pOtChNho3WSIj0m4GPCiyZ+\nmJ7enwXT33Qu8Tw+cZK6JcJ6kqIuaFJKFdOfX6vGPI5y0HY/Bk6t1xraFTlA\nY8WyIPyxfv1uljZJkkptBmJQjSGdVD0npg+2pp/1lA/bKGrCJimvpT4d5erK\nbuutIO/ZSqVWP8E2zHm4wto12fcvW6iraJ8bLIFz5LyqhPEI3oX+oYAaYS0f\nwIsc0OfwW3xOrBoIqaFNwuoApLMLqQc3DsD80Rr9NgqX28HGqVu8sEskDPuL\nbno6\r\n=MFGD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzQji1KBxuxQ3f8kx+io7SPynXOCBjBPjOIr8G4P4D5AiEA/AcB3Gd3Cxd65HeO+PNaphjblEI1ViyjY2YJ7cO5SRk="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.6_1643029319954_0.3861699883805214"},"_hasShrinkwrap":false},"4.3.0-beta.7":{"name":"next-with-split","version":"4.3.0-beta.7","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0","yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"343193c5d1b74287c4a02a4ea6e18ba6fd695b0f","_id":"next-with-split@4.3.0-beta.7","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-ar0p60CfeK4Ruc9vsb5JNsfD87/lk3hZ1EE1B3Z7k7980vo4fUej9hoDFex59TyK2zIFvXQ4zSQgfK0uZYcyLg==","shasum":"dea58e0a3800763a9cf9190a42ff722ba59661a7","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.7.tgz","fileCount":24,"unpackedSize":263157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7qxLCRA9TVsSAnZWagAAOW8P/1qbC2FbjfZ3tH5qcnx4\nD/vMCyld+7wT3AVpoinbbPdx7Qca0rgxqwOji4PFTWVND5bcyVg/Ax7rU1Af\nKOvHldS7vYIpeyhEWcn+tTmIQDDGZqp4PB33hfCgD0cr1wOCEm25mxfJzeuu\nSo7RvHyo/5BU0bUAnZKXGLOSQR4YlDZQ8Sx9xShlMupjI89UMRAMI3THyoI2\nVhuhzQrjS2/HmVck8dEbl5EpcIri6oHWxFZXSC/JQiSyoeV0/Enp8FBQ9+FH\nefw0zeNb93VVGx23dR7IxpSDO4z12FAtxVq0h9I74cX/Y+FEDMSZ8NMdH8Kd\nVisirqQy7rackcngt4YLSqKWsXWqJmJXTTOqdPbduO23COjFFcSioYrt7bWh\nxXIXvpwzuFMEisP8ky3HTJLL7tax9Nh99lAvFhFgPI5Lkn1Fr9MUwCS4I8mD\nGw2xibaX12Sj6xDmc84JIir3MaGxIKc7MAaIDRdMGApz1Lg5jBT2hEtuBiDs\njInMxDtAUpsn5zeDNd9LTCetGLO8N24JWb5m3Ggt9Fo10rX85DEVLKvzm0EP\ntu+MST7ZX7mLgDl0gQSlify4CcvS31bWTdLUG6Mvy8qOXAgFHqhaLF8Dj46J\nBkAVGQIF/oYdQqM8VOv5SWUTgzFgSmdNQmH2alXJui6OhHTEiTJEqbntrCRE\n8aA2\r\n=zF+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAsTZwNVJ3di7g9dY1E5qpMVumYseZbQLwlZKqYQPQx/AiBdh08clynpvb0Qjmp65JuIzQMBdHcUe3TH6Tq8sHbEUQ=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.7_1643031627577_0.6776911652713196"},"_hasShrinkwrap":false},"4.3.0-beta.8":{"name":"next-with-split","version":"4.3.0-beta.8","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0","yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"7f97eb492e385ef09064b9ab3a227fd44929e27b","_id":"next-with-split@4.3.0-beta.8","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-pxeQ/RZt5+ErzyblRPA4UDS+qbPkbICZCTenLk4jSSpoofz3glB0WMGpyAxL2v+u2qtYxcLRCgxGbSbbEAkLkw==","shasum":"5733784243be5047462853c8f85626a6f92d2c74","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.8.tgz","fileCount":24,"unpackedSize":263263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7q/7CRA9TVsSAnZWagAASaoP/Al8IQ7+FXgeGjhqk7Y3\nm5zBpx9xEAzKlhdp9EYtMCnIydRwevajGWGY0j9SSYfLF7uCYDjLBHinOnf5\nHs3YoQjYiBRPj2v9qP5S4eA424fQt8+kKk4kRrWm4S+nZJ6L6IVVH6cODAVs\nOxcpu1VuroqPJjilPUM6mI7R2kbEgUii2s8csiD5FmJtsW5kGN7CnV9d7E/h\noXgBkJTzqhs0sS4kd/mjvzQU3kU9wjpglcUthldcskrrU2+5BQ+e3zmJnUkx\n9Ixr0sAr/t2vdqxWiq498zcE1FaDwmxKnvheduSDD9ZzhQCaKIaX1d31v7yg\n77dyIMM2e9g1vTO6vLowtp4l6qiNKx8J5qbyoRjJ+s/PZ5KAFBQbXtLyFCNF\nGXVbxD08b88W8FanQLX625TE+scqdbSUqinq/gUeyUPBGSDyUumECaSQjdrP\nPJ1cdabQTYtAB0Aj7JJ/N7gezThVy4mVmCbr6jZmEn/fefcBLkXMf1jvYQwz\n83SC0eDWiWFVdQi+uVqcClnHyFFqFFnDIK0hXkmv+3baOH5eDW+zeJVlDRRr\nzLjfGWm34L4Ul8OP2b1wKqv/qcpAKIdPxcoM7u0dfOAX7kdm40N+4p7zqDyf\nKOwbnXZBZ3E1S8tH17iOxmk0C4ZJQBrBfFdo1jSNQ+tvUoU80LGu4PeM6wLG\nD9l+\r\n=TD2s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICqQ/g4evI8xx2WVhu4CWyKPxLiAYl84cHFtVELSe2YoAiATIvka/8k/9nwrMZrJ3Hrg4g+Qnlcth3hoMqWel5bC1g=="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.8_1643032571703_0.9929785475106296"},"_hasShrinkwrap":false},"4.3.0-beta.9":{"name":"next-with-split","version":"4.3.0-beta.9","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0","yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.10","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.2.2","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"fb26aa3c8ca6c0964755ffb9e80cfba44e7b6f23","_id":"next-with-split@4.3.0-beta.9","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-BL82fFd+lZVxkx/PBgD9x1s0y36UJeeexCNwZgIJQeRcswFUCJtERmjCPj8qyxmkaLXkWKLZl/29P/0lgM14vg==","shasum":"97bf8b9c29d10f2a92661e4eec747a32e90f5100","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.9.tgz","fileCount":26,"unpackedSize":264033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7sHpCRA9TVsSAnZWagAAMcYQAKR70ouqbhIasXgy29D8\ni3oCh23XpO6EVRg/BfTMryVPGDCgGtzbxQPaTP0er/ONNdqSU4KRhuDD5MZr\nSIuCrwyGuPHajvYZ73AbIq5IP/zIIfqlAzOMm/UjxWhxhlJSSlFuaCqwYID2\n+2hjIoaMUhJ308RQ7JxXnCq23S91Z5uCYBLM/UV+eQCqX8uiXzX78iGPau4y\nMH9zubRXixK8ItQ3xEin5yfW+yv5nhD+9nPCyQc7laNhH0PuMEuS3qBOJ+IE\nXEKoIh7bjc0vYk0aDjFRS2vMuTNXYxDTnQ8/bVR0Y+efYokaYhOpmZXQnTLA\nr3ZXTPz2ySaeDRTn5rJl2sELm3Ok16vOGkTTwgk+sYuLO7lWVhmrAckSNPWY\nDcMuxdT+lyCsNFj4bujqKukgG32cIUN7wmjgEqC58t5HimssS+aXWz0BaQa5\nJq/jFkFuF8d023CSpgFnVSUPGotLLoKoxdknQDzVyH10DKUUyJ0vcU/vPh0R\n+Zq4UQWIoLLy0/fgI4yDXuq+SOxEYcsW/8thtyVcgI+RPujaH85Rnwq2mSXy\ngJgwJr9CKaSqmzaUzzc8vxD4mkJF6cvImN39XXS8D5DYiCh46AzAFzCt/J14\nZNdhM1D5sHCx0lrYVldyLbW/1nQNI0pHGTeOIN84mv23pzMHo9iUHr7l+3g1\ntqjt\r\n=hAM6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvSwar9m6bKdn0YJ/0Avqv/u/magZA50v/r8XKDH1e2AIhAL5sM80ukyjDnPDQXCkoLyZGBWQ6+rL7uyNDS/FZkzjR"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.9_1643037161431_0.9495586912982097"},"_hasShrinkwrap":false},"4.3.0-beta.10":{"name":"next-with-split","version":"4.3.0-beta.10","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","bin":{"next-with-split":"build/script.js"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0","yargs":"^17.3.1"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.12","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.3.1","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middleware does not get into routes that are not related to A/B testing.\n    - You don't need to place middleware at the top level of pages unless you want all pages to be subject to A/B testing. ([Middleware - Execution Order](https://nextjs.org/docs/middleware#execution-order))\n2. The middleware for next-with-split is not needed in challengers, so please remove it. (You do need to configure next.config.js, however.)\n3. If you are not doing A/B testing, remove the middleware.\n\n### Auto Install/Remove Middleware File\n\nYou can automate the installation and removal of middleware.\n\nThe following configuration will automatically remove the middleware for next-with-split when the Challenger deployment and A/B tests are stopped, and automatically install the middleware in the original deployment when the A/B tests are running.\n```js\n// When A/B testing is active \nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        original: 'example.com',\n        challenger: 'challenger1.vercel.app'\n      }\n    }\n  },\n  middleware: { manage: true, paths: ['pages/foo/_middleware.js'] } // this line\n})\n```\n```js\n// When A/B testing is inactive \nconst withSplit = require('next-with-split')({\n  middleware: { manage: true }\n})\n```\nIf you write the path of the middleware file in this way, it will be installed or removed automatically. (`.js` as well as `.ts` are acceptable)  \nIf the middleware already exists in the path you have described, delete it once and then start the server. Also, please do not change the contents of the automatically generated middleware files. If you do, they will not be automatically installed and removed.\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"253c89c0646c35f1975c2297ccb0eb80b3a8111e","_id":"next-with-split@4.3.0-beta.10","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-/tg3eszA5kANXBr9Kx/+b3sXFng204HcPR4FVUoqFC1IM3yf17gIrm2PkmFsFWZ2xUTNC0vhzm8frToj4ROytw==","shasum":"c7d06a1d8a8e3dafde5c84163501105d4f697a8b","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.10.tgz","fileCount":26,"unpackedSize":267169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8AIVCRA9TVsSAnZWagAAtVcP/1WMOR985PsLyAQLjDTa\nrgv5Moly1AA0mE8Rg9MxGfadGtvCv05GwcWBr4ooQmt4Ns53qVNnwPXOpNoF\n+3p9YJAi7amkqPZMdJolLIaUqB6b5Bn2g8E8slvFbzHdDaEvy6m38USjNmIa\nHwJQHB/6HD0SxeEvfDB2x4IzVlGvElg5veKKtLlRyiQICs4qQsZh4AhfP0VW\n4AWKLCF4uIOgeVN5pVMcx/JC/1M+aHXw3idf6oj9JUYijKBt/LO1uYnrtFPa\nt1gTw9UzqyCirzBRFhRLEsN1fI3wE3E1tL6StTGLCCBuqflJUY1LSNKE/Ubf\n15IbkFaiODKJ5pg+ksce1LsfRTPLX4CJV5qvqDTRziHhLQajjvB2+eKiXOah\nDgIWDM3EBsqXGeq/ajHECdIzg2GN4OaBXP+AFBkFkjNKrDWaoEignERvnm0J\nAI80QZvWXXKkQDNXWnrJ+Z3BgEokk5hVU0b/7gXY+pBlUVcQcVEsYPQyNg9v\nuQo18p7QkOC+yl7xolFdOyBuGvOiZZq6gcI4c+X3cU51a18p6aBjR2E1km/L\nralVoEU6fF2KUAow7VO6WEhMgHAZRL0psdpbWy6o3GSpaGaDcxizmMMcL9b7\nL277T1xdlAOVcOV5iYuukJPJrbo8cUKeM5w/HdHdGeQJGUmhcafZ/Z7fQWdF\nFe7H\r\n=yCAq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlnaH126D4fWZrFa+oVJR5qOe3UO23oMFr2M7bLrePJgIgQh05Wqfna1BoPe9rQQ0/hMVzxFwTTCCOmsKLfsy3Vso="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.10_1643119125427_0.5130942159823499"},"_hasShrinkwrap":false},"4.3.0-beta.11":{"name":"next-with-split","version":"4.3.0-beta.11","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.12","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.3.1","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middlewares do not get into routes that are not related to A/B testing.\n    - You don't need to place middleware at the top level of pages unless you want all pages to be subject to A/B testing. ([Middleware - Execution Order](https://nextjs.org/docs/middleware#execution-order))\n2. The middleware for next-with-split is not needed in challengers, so remove the middlewares. (You do need to configure next.config.js, however.)\n3. While stopping A/B tests, remove the middlewares.\n\n### Auto Install/Remove Middleware File\n\nYou can automate the installation and removal of middleware.\n\n#### Automatically install middleware while running A/B tests\nThe following configuration will automatically install the middleware in the original deployment when the A/B tests are running.  \nOn the challenger side, the middleware will be automatically removed.\n```js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        original: 'example.com',\n        challenger: 'challenger1.vercel.app'\n      }\n    }\n  },\n  middleware: { manage: true, paths: ['pages/foo/_middleware.js'] } // this line\n})\n```\n\n- `manage`: If set to true, middlewares will be managed automatically\n- `paths`: Set an array with the paths of all the middleware to be managed\n  - Relative path from the application root (the directory containing next.config.js)\n  - `.js` as well as `.ts` are acceptable\n  - Do not modify the contents of the specified middleware file.\n- `appRootDir`: If your application root is different from the directory where node_modules is located, such as if you are building with Monorepo, specify the path relative to the application root.\n\n#### While stopping A/B tests\n\nIf you always set `middleware: { manage: true }`, it will detect unintended middleware inclusion.   \nSpecify the path relative to the application root by `appRootDir` if your application root is different from the directory where node_modules is located\n\n```js\nconst withSplit = require('next-with-split')({\n  middleware: { manage: true }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"ddb3beddebe66c6a58d02d85faada0409638455f","_id":"next-with-split@4.3.0-beta.11","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-xnxQGfnn3Y5d8S8ZZ7/3QtCuM5vGAygIcStcS+qeH11C2IoureIgPMVzKVD15BEdmedFAuK4FaiLolyAPcKhWA==","shasum":"b122506ef1d06c790b7f1ed50aeed334a391234f","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0-beta.11.tgz","fileCount":26,"unpackedSize":266934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8WL7CRA9TVsSAnZWagAAidYP/jZLpsdJ9VoRlqvk9ByR\nGEdyBvguq+y0LDZf3kbS1IFRIPwyeG9HI2OBZq6875gyNbkLQPUPEqDj7OrX\nGVqBEo9nh2fKcyfPR8YoRJFsvIYDqIi5IaL5I8KFI3dxcxAZ1TQ3y+Ep+wdj\n9rUUzZq1imNn/INZeUYCsjMvD/aMT7W05VLKS2hxENO6r+RscUpdmoNsLSJl\nzwM0bhapcDHxtICQfXTozSNi0pqAtBUmxpbQQB80rWMSB1+PjjzcRdDuNCAg\nfa+ZoEJ1quVCFrrvlqeFRzniMRhsyteVTlicAaEXDRhSx94hjaH86qjgXv25\nYrY3c6oFYTogzaZhGm7Nf6eAMKaYPmyNUBuRohY3JHAkVYyR8mQ8yIOxb815\nararz4L/cUQPl7SX1l0bVzW3pfwOD1LaaNQzWh0DDFuAZ7yT6dTQuyAXRI1L\nlxJD1LqHRq06T8E1j6luCWSKmn9M3hhnsHUK1Fp2GhAfb318cvxr4RVBIjEg\nubifJLdBtfkIGT308zAkPwe192uVCD+td7LdJDfkXEgucT8xoxuvocG5fjOF\n8RM2UOLjHca0k5UbGD3aUhccBsB2zWPFUC7I6GvM2IZle+4vr+JzyHNtHIjl\n0eloyHWNz4MWKm6GeSqTDDGr8gsFczfFB3iY8oDykAY0r4nTT2LB13x+QwFE\nBUZE\r\n=ORwG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN57Y/Y7rBzHrVinlL8w8CTQlHSViRICSaUoqGWcd+iwIhALVlSdCuPKiYEFrwh3f3K3VOG5FBROkOj0D5swqA+/RN"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0-beta.11_1643209467457_0.9345739961645028"},"_hasShrinkwrap":false},"4.3.0":{"name":"next-with-split","version":"4.3.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.16.12","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.1.0","@commitlint/config-conventional":"^16.0.0","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.0","@types/node":"^17.0.12","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","babel-jest":"^27.4.6","eslint":"<8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.4","jest":"^27.4.7","lint-staged":"^12.3.1","next":"^12.0.8","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.4.0","typescript":"^4.5.5"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"770294d6fc055e2e3f3fb1003612259877f63675","_id":"next-with-split@4.3.0","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-7gQL7z0FmnRbticiPolnFPvIY/oyQeUTaQNSrreMM3/KNv6WAAeyQ8Dox4PNpEsbPb9ndqo3ma/1UTy7G5fi3Q==","shasum":"de940e2c8e75c9d5e2ae86983086b2ad4d97e55f","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.0.tgz","fileCount":26,"unpackedSize":266926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8WUtCRA9TVsSAnZWagAA1AQP/1AFDkeCH5ZYu33y6v2/\nTAQeAHpxQ2DdM34txQZjcglD70rAF3KIhF0glo4V1hVxsaUyDNXMNlJL/Rog\nDOdM76RKUhlmfMQI/pOzthvxSjKpBv6pSnAuHNDdvxNXvAQfyfr1HpfPlOlC\nziKawZjfrlBvNUTMeepfcqGniPX6NIXB6nvUmj7wYEdKZBw69O85SWRAnKwe\nh56AyNYGalFMd0BLmYdMRhnyS2HPFgcBHTl2Jw8WYefujCd+jZI9koVt5Hsz\nwgZdOUs3LTIgCzjPlXYSJCDnOuG6/VxJw5M3GzvOHcVDugUEWDLcWtW6nFmw\n5mZfM0Hx/rusgYUbbuls6rjlhO0aZ9+zOX9CZYuomj2URMcu0T7tG3UlRRSB\nVE8dZZXA+T5Yx+iuBDrVzkBCdGTqL/dJUZuFibQSOj6R3YMO7BJUny7dSVDC\n3IrTon8lnsPb+QkcJdpHD5C0qD5gtSsU8RxE5X49N144Rqfwkp/3hFGMsKZZ\nueo+VTG+jGDHm/U0Ohmq61OXy9CQYPYcmuvzygUKAqY0W7f3XIk4+FOI0UXb\n7CycNuiI5GT7sUIsB7NKIjqRXM9wnMLlUZ6X5v5d8qD5uk53NKLl+yU0Z7hn\nB1xlVlG3Y2t/BGjBnfADkMwGvpJnPPYawHwAQksoIpA0O+zegdNYdxPjW5DW\nrhz6\r\n=v5OT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCczDRXp3sXaoQwLl05YS7I5JJTVu37RJlCm/ZN+14NgAIgZdObrYUEpplFK1OGn1dfuD3TvSEne+Y0NNSMbVwDneA="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.0_1643210028858_0.20337415384663338"},"_hasShrinkwrap":false},"4.3.1-beta.1":{"name":"next-with-split","version":"4.3.1-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.17.5","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.2.1","@commitlint/config-conventional":"^16.2.1","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.1","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.13.0","@typescript-eslint/parser":"^5.13.0","babel-jest":"^27.5.1","eslint":"^8.10.0","eslint-config-prettier":"^8.5.0","husky":"^7.0.4","jest":"^27.5.1","lint-staged":"^12.3.4","next":"^12.1.0","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.6.0","typescript":"^4.6.2"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middlewares do not get into routes that are not related to A/B testing.\n    - You don't need to place middleware at the top level of pages unless you want all pages to be subject to A/B testing. ([Middleware - Execution Order](https://nextjs.org/docs/middleware#execution-order))\n2. The middleware for next-with-split is not needed in challengers, so remove the middlewares. (You do need to configure next.config.js, however.)\n3. While stopping A/B tests, remove the middlewares.\n\n### Auto Install/Remove Middleware File\n\nYou can automate the installation and removal of middleware.\n\n#### Automatically install middleware while running A/B tests\nThe following configuration will automatically install the middleware in the original deployment when the A/B tests are running.  \nOn the challenger side, the middleware will be automatically removed.\n```js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        original: 'example.com',\n        challenger: 'challenger1.vercel.app'\n      }\n    }\n  },\n  middleware: { manage: true, paths: ['pages/foo/_middleware.js'] } // this line\n})\n```\n\n- `manage`: If set to true, middlewares will be managed automatically\n- `paths`: Set an array with the paths of all the middleware to be managed\n  - Relative path from the application root (the directory containing next.config.js)\n  - `.js` as well as `.ts` are acceptable\n  - Do not modify the contents of the specified middleware file.\n- `appRootDir`: If your application root is different from the directory where node_modules is located, such as if you are building with Monorepo, specify the path relative to the application root.\n\n#### While stopping A/B tests\n\nIf you always set `middleware: { manage: true }`, it will detect unintended middleware inclusion.   \nSpecify the path relative to the application root by `appRootDir` if your application root is different from the directory where node_modules is located\n\n```js\nconst withSplit = require('next-with-split')({\n  middleware: { manage: true }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"191f0b9440d7130e76aed1f5867cfcbbeda939f4","_id":"next-with-split@4.3.1-beta.1","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-uyqQBrP+PSTOX5PRcdkHZ1NzJA/wZ3aZATI5P7WdXx92XvkYV6dTrw7+3XUFb1qNOFh/QW9GeyGfKGZGFRZMHw==","shasum":"09e802e953662fe076c581bfab6dcb612dfcad44","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.1-beta.1.tgz","fileCount":26,"unpackedSize":267187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIN/pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjsw/+KShgJM+JFDR0CZto0zHu+/fhktq+9X2vfW7RWYKfnONWCJOW\r\nSxcXi/zHkZbMlbN8zFp4qO+v5MM6ZPeOFYePQvHaWLwWOzBqKZWOrHfN4Txl\r\np+VZCbTAauNBP1MSW2XXC73d7LlBMMReTV8tpZRdDnGaKm8WfySXzkTvk7R9\r\ngz/+ot5i7kiSvTFflmuq7UgNux6e/Zy/6B8UQ4ZYIysXzz2FfC52K1/e4FBR\r\n1JrYaUXGWZdidy0UIkfIZKvICv5Ho0fdAtclXPzhI5xt0itOxaQ+UBVZx5Zw\r\no1T5P9wTyQ+P228hfEWeqrjc/4JdQxLLSJuZNmZrpp+zldFm3fLUwZrGOnrs\r\ngEMUfiWP1VlmHO+JkM3zmZg0Txxd6xx+S0O1INLKyBo1rJEiNerX+rdU4FTg\r\ngpkKJJd8jwP90NbZ2fRob45IM+LY9V7nfd7GKdEktdkTZDjHl2IoIdcDTquw\r\n89qoQ+PC5wwRlEMEvCy05immzAWAJCWgx8mPhtbUUhIcFBGFXp7fk4MlQvVK\r\naeSuVGbmavXqNVqGeZ18y0NY21MXAU59IvHTINA4cG9+OnmfKBRbefwgZSnw\r\npwbFr9DCHz2au4lnhZlMllxpNSrzCnn4o+D0d3NrjtJKZLNM1+/VeLD+11w/\r\nYqO7xFSkQN/M6YfBeE4dqkX2cVB3gkYooVg=\r\n=/dnl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDvhcE1b2/76zKrair/U/ztVwnqYm22ttO8xsAGMk19gIhAI2qdsLVVinI8XHHJjKIHYy5yRxW0WPkQkgwbY2pYXXK"}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.1-beta.1_1646321641368_0.10202765336102004"},"_hasShrinkwrap":false},"4.3.1":{"name":"next-with-split","version":"4.3.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.17.5","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@commitlint/cli":"^16.2.1","@commitlint/config-conventional":"^16.2.1","@types/app-root-path":"^1.2.4","@types/cookie":"^0.4.1","@types/jest":"^27.4.1","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.13.0","@typescript-eslint/parser":"^5.13.0","babel-jest":"^27.5.1","eslint":"^8.10.0","eslint-config-prettier":"^8.5.0","husky":"^7.0.4","jest":"^27.5.1","lint-staged":"^12.3.4","next":"^12.1.0","prettier":"^2.5.1","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.6.0","typescript":"^4.6.2"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"274552161778c63d0165200c49dd35db295c92b0","_id":"next-with-split@4.3.1","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-VUQWtOKRdaZL3BF2rubYe2XAMcBUOMnAufvv+UXAfW8Plj25I8T3qbVFEg4tsXrM4HaAoIMv+E0VqVJs9CHrcw==","shasum":"19d5c01d9b2df09aedeb89fc1e56d1c70c41e7a9","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.1.tgz","fileCount":26,"unpackedSize":267180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIOHMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorpxAAgIYuBmGLj8O6RXoM1jHpCtBGRjxOzEpa/FNr776jzrELiTUj\r\npjIfA3AcbgnFjk/zeP6wwDOIw0z7A0xtYTD+WPIGCIZgmhWwOMIAKqwMmpjU\r\nyqQafFfePeAabso1Inm2egRVniJVmoO20RGbK/p+p9XYurCgCR7S4S7ZvQ80\r\n5A7TB6kh7UWjA94pSssw6oCdaOxMefU+ETHUxh3+8J91eQZJ+iAZQIimamFP\r\nUDz0Tt6XZp0eLEISfDD8Ka/VB3keARY+V8HNejUFweW4Qdq8VIESGY4LI7fd\r\n+lb9swq/eTR1LlC1UFGaKqnIz/Gdoz0mYJ23Fvp7yUqz6yaK3+/Ryi1fhl4k\r\nqxl13hMpFHYnbcUbtzVdaWJ6G4MXOTnCfeaVTh4r8aSsIEzEPhvrxNkmd6nf\r\ncSWi6A1x2F7cvGUwKaSAwTyq6M6k11rS2BIRgXsI4xpujknyraccxd2/7pkm\r\nJcJsSmBuIsLGgA9piF6OW4FPM+VDbA07Mp+8jqQnGBmcJDpbf45vRYmC+fev\r\nf3waxcIXnFkLAk1U9109KpzOd9LE+rWuDq2XFRBcqCe8jXwui7b1wULBhhUs\r\nxDarsHEtVrRXOIxpydk2D8fGBujroo9Oj8O1mVXZPwiyFaz9h1ZW/2DyPw3h\r\n1he75Z+4nfmYhz5B5on5hokAnEmQReDF6mw=\r\n=tHi3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPx9jQs4+WIa6e3guLiMMUyBbdeAjcf5uDH0pQxMz0TAiEA8GcesTjHG0nNCChy0r9L7Zb9kWD2ay9b2z1H9Tus0E0="}]},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.1_1646322124631_0.8874291080801591"},"_hasShrinkwrap":false},"4.3.2-beta.2":{"name":"next-with-split","version":"4.3.2-beta.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.18.2","@babel/preset-env":"^7.18.2","@babel/preset-typescript":"^7.17.12","@commitlint/cli":"^17.0.2","@commitlint/config-conventional":"^17.0.2","@types/app-root-path":"^1.2.4","@types/cookie":"^0.5.1","@types/jest":"^28.1.1","@types/node":"^17.0.40","@typescript-eslint/eslint-plugin":"^5.27.0","@typescript-eslint/parser":"^5.27.0","babel-jest":"^28.1.0","eslint":"^8.17.0","eslint-config-prettier":"^8.5.0","husky":"^8.0.1","jest":"^28.1.0","lint-staged":"^13.0.0","next":"^12.1.6","prettier":"^2.6.2","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.8.1","typescript":"^4.7.3"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// pages/_middleware.js\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// pages/_middleware.js\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middlewares do not get into routes that are not related to A/B testing.\n    - You don't need to place middleware at the top level of pages unless you want all pages to be subject to A/B testing. ([Middleware - Execution Order](https://nextjs.org/docs/middleware#execution-order))\n2. The middleware for next-with-split is not needed in challengers, so remove the middlewares. (You do need to configure next.config.js, however.)\n3. While stopping A/B tests, remove the middlewares.\n\n### Auto Install/Remove Middleware File\n\nYou can automate the installation and removal of middleware.\n\n#### Automatically install middleware while running A/B tests\nThe following configuration will automatically install the middleware in the original deployment when the A/B tests are running.  \nOn the challenger side, the middleware will be automatically removed.\n```js\nconst withSplit = require('next-with-split')({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        original: 'example.com',\n        challenger: 'challenger1.vercel.app'\n      }\n    }\n  },\n  middleware: { manage: true, paths: ['pages/foo/_middleware.js'] } // this line\n})\n```\n\n- `manage`: If set to true, middlewares will be managed automatically\n- `paths`: Set an array with the paths of all the middleware to be managed\n  - Relative path from the application root (the directory containing next.config.js)\n  - `.js` as well as `.ts` are acceptable\n  - Do not modify the contents of the specified middleware file.\n- `appRootDir`: If your application root is different from the directory where node_modules is located, such as if you are building with Monorepo, specify the path relative to the application root.\n\n#### While stopping A/B tests\n\nIf you always set `middleware: { manage: true }`, it will detect unintended middleware inclusion.   \nSpecify the path relative to the application root by `appRootDir` if your application root is different from the directory where node_modules is located\n\n```js\nconst withSplit = require('next-with-split')({\n  middleware: { manage: true }\n})\n```\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"b7ade673eea6ac780bc5c04295f87a3720d342f6","_id":"next-with-split@4.3.2-beta.2","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-NCt7SJS1k1sbH0NF58gL9BgXmxv1N6ll6OJch92SeBMa4kzQ9ELrHKgSsYMTzfky6NZZrJc+MBdWesxe33rsxA==","shasum":"5847d84ca921ce0246e7fcdd1dc008ca2ae88a58","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.2-beta.2.tgz","fileCount":26,"unpackedSize":267023,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICydWsOHYD//PQ2uFTer3clEERrgxmmA9aG22i46uRa0AiEA5g2LkHlEs6dzvpop08P3P7emv6KIbsDWd/pfE68+foc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiniAOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouzQ/8Ce2f/POv4a5MTFdkcphSdtT1qBzOuuZ+A2gfGdbEYqHwDaeo\r\n7ZUi6xNPMtNfNHh5eIFwnM4Px3J03wpHnRqrbKKuNj4R36i9fu03LMWrVUJg\r\nM8+g+M1IUgCssQbudQWyLBpx054PQBJGBuKBVc7lS0naqtrdS75IHCiP2hiv\r\nI3/RDhYztYoPuwKDfsC2GhZd9gjRSd4uv0sLax0qxnpzgtTP7YqLnvZXCl24\r\nAawW7n7y64AmA1R/o4EbrSMBSrbUulIzD+4nY5EfJpNN1Ry/9pxqcEDzRooT\r\nhfXM/gBZgIXbb7ZXKcCZJEzNeYl/z15LtwWxglIWnWLSZ537s4M9BpeH2jMs\r\n82OwkcnMdLEXP/nyqmWpDedTDVNq8aA9fDRZl8zzxA0ZgEIQlWsRRTf1WtH7\r\nuXkYASZAjeJlcOkrdcroHp2Fq3PJEgcCxEPc2FR80aS03jbCKwMvC5KrJXyy\r\n4HENcazLWzJqG2nfNNS1ME43d4r+RyhoR9W6p0epmQqK+y6zZJG48TWdyCKa\r\n+SNmwsZoVG21f8TTdQp2s+LPzj2XaVcHqOVX4FdBVSe98qRUp04xPChTL1oM\r\nQXH8xwXApUi2/c+9iVfZAxWlqpkBlR18n/DgrSl+01BTlrOiUjBNTdyTlRgq\r\n+mkZoAEVy/MjYyf12vQ0+kSu8O/xxp+wmoA=\r\n=XTB+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.2-beta.2_1654530062216_0.515870721102796"},"_hasShrinkwrap":false},"4.3.2":{"name":"next-with-split","version":"4.3.2","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.js","module":"./esm/main.js","types":"./esm/main.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"lint":"eslint ./src/**/*.ts ./src/*.ts","format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"jest","test:coverage":"jest --coverage","build":"tsc && ts-add-module-exports && tsc -p tsconfig.esm.json","semantic-release":"semantic-release","prepare":"husky install"},"dependencies":{"app-root-path":"^3.0.0"},"peerDependencies":{"next":">=12.0.0"},"devDependencies":{"@babel/core":"^7.18.2","@babel/preset-env":"^7.18.2","@babel/preset-typescript":"^7.17.12","@commitlint/cli":"^17.0.2","@commitlint/config-conventional":"^17.0.2","@types/app-root-path":"^1.2.4","@types/cookie":"^0.5.1","@types/jest":"^28.1.1","@types/node":"^17.0.40","@typescript-eslint/eslint-plugin":"^5.27.0","@typescript-eslint/parser":"^5.27.0","babel-jest":"^28.1.0","eslint":"^8.17.0","eslint-config-prettier":"^8.5.0","husky":"^8.0.1","jest":"^28.1.0","lint-staged":"^13.0.0","next":"^12.1.6","prettier":"^2.6.2","semantic-release":"^19.0.2","semantic-release-cli":"^5.4.4","ts-add-module-exports":"^1.0.0","ts-node":"^10.8.1","typescript":"^4.7.3"},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"gitHead":"8c173620586e231529f5e8efb23a1c3823270ba1","_id":"next-with-split@4.3.2","_nodeVersion":"14.17.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-JQwVFXfg2Pn/UUIcErdY7C6dayk4Iff/Bk/jM85iRAgITXIEfLO33tIcl+FTa+JgafrQ8cVywZpeTTG6Tis1Rg==","shasum":"17bf8b06fbfb56b12db23aa1061f01699bbbe4f1","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-4.3.2.tgz","fileCount":26,"unpackedSize":267016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDT70EzVTM7qHs/MZrWLzgXzOoZ8okI0ounhuv7hdGhOAIgcTORWd35N/OOjhhw8T936Zu7Fly0ZgTroSS76SDSD7U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiniJmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4yA//UcSCFFLkL/mqfcGeoVVd6HWJYSqX6B0BYn9pw8P8BfSM3wsB\r\n0oOXYwM9zm6b3gnWuEn4IByb2U6mENSB1DG2f97X9D0/WvaA470GrrsZtf6d\r\nWMALPbhWYxAPKeY4yDY+jeCpFSLBjyEwdzCaCEAEaGO/N+pC8zqTsNAER3Js\r\nps8APtJWHrnRkg5VppYqHpTk5zKi0kuKq77cYyt3B24TxvT8lnTsw20x09OG\r\nkLKslmSYrwvQVb34JzwqE63jftafP/cLBaFIsWfho0wNbmxi2G6/QkSVeyd0\r\nB1w63o0S3WbwDUQuoPlaRQBfAqYLFxMgCuRwuqEcjtkET75AB4VYoz2gNKoU\r\nobrcl288szUZ46oM4OJAjhf/2JPOP7DsKSjtOr6R7xytXtxUTxT57wyRNVUe\r\nkQp773zN54SKtK+yJDXdiEmxDzaGkk/yAjGxgp/NwIGoPMU8rgAIFjKOd7sL\r\n6/5Akf4EvAnwZDgDjpPWXVQoAP2P23okcWDtX4rpJJswoMN7ed+d0yUGoerG\r\nzM2NX6Axg+PvrzuSaKIsVLYyeviJaM9LuBAKfAwMpB1TDRSOiiA6JTSm3mhB\r\nJdDhiv21lLbj9t9ziUylBmtNCnzo6EbYQhs9pZqt/F1V3atQTAFkiSOMciuI\r\nVp9YR1T3j5sJjdjZX8H4ZcXvWSx/bhKqJNk=\r\n=E7Hg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_4.3.2_1654530662678_0.31805005258211905"},"_hasShrinkwrap":false},"5.0.0-beta.1":{"name":"next-with-split","version":"5.0.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.cjs","module":"./build/index.mjs","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"vitest run","test:coverage":"vitest run --coverage","build":"node build.js && npx tsc --declaration --emitDeclarationOnly --declarationDir './build'","semantic-release":"semantic-release","prepack":"yarn build","prepare":"husky install"},"dependencies":{},"peerDependencies":{"next":">=12.2.0"},"devDependencies":{"@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@edge-runtime/vm":"^1.1.0-beta.11","@types/cookie":"^0.5.1","@types/node":"^18.0.3","c8":"^7.11.3","esbuild":"^0.14.48","husky":"^8.0.1","lint-staged":"^13.0.3","next":"^12.2.2","prettier":"^2.7.1","semantic-release":"^19.0.3","ts-node":"^10.8.2","typescript":"^4.7.4","vitest":"^0.17.1"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12\n\nThis plugin depends on the middleware of Next.js v12. If you are using Next.js v11 or earlier, please use next-with-split [v3](https://www.npmjs.com/package/next-with-split/v/3.3.2).\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `pages/_middleware.js`. (in main branch)\n```js\n// next.config.js\nconst { withSplit } = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// middleware.ts\nexport { middleware } from 'next-with-split'\n```\nIf your A/B testing is limited, `_middleware.js` can be placed under the directory of the target page ([Next.js middleware](https://nextjs.org/docs/middleware))\n\nIf you already have middleware code, please refer to the following.\n```js\n// middleware.ts\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middlewares do not get into routes that are not related to A/B testing.\n    - You don't need to place middleware at the top level of pages unless you want all pages to be subject to A/B testing. ([Middleware - Execution Order](https://nextjs.org/docs/middleware#execution-order))\n2. The middleware for next-with-split is not needed in challengers, so remove the middlewares. (You do need to configure next.config.js, however.)\n3. While stopping A/B tests, remove the middlewares.\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"4c65e81d663da551e481d3072345c844c025c7e9","_id":"next-with-split@5.0.0-beta.1","_nodeVersion":"16.15.1","_npmVersion":"8.13.2","dist":{"integrity":"sha512-seqSLUQwRGR727C0rLKQjCwCCrZnvhNOtSg8Fk6HVrGwr8Wni+MsjR0JRWrRYUe8Ahk7+FikWOKepmsgu7UoZQ==","shasum":"fb552af3c0e4f2e1fe9678532e9b378b07ed097c","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-5.0.0-beta.1.tgz","fileCount":15,"unpackedSize":256932,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAQEZMIFDodP+sqd8G+Dw9jejwKhI1R/vzVSfpXvyDtQIgJ9OGz2P9hHiCwt21WhnB01INWXvwRqVwCyn7kx50/5Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyoGfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoY0A/+IXsTSELmrQRANh0l6PYZceD4zByVJ0fBMAF2jD1t6iLnatF9\r\nzNE4YGu2aQn0KdSrpn2XUPr/T9jRaj571Q3cn6uAS6iL7vesUvVCFvSkilA2\r\nEIVSgyX2hKJMTl6IZzK4lrwzYi0dbItV9cHi5tVbjiDfLiQ5nl7iY2W3cYao\r\nR7m4cTa/x+IRKu3AFkMbHSX/bkB0UmSveXxtKBXFAymJO4OvLTQvCxZdYHyt\r\nSU563HjWNQeSMgZ+tGvMhFgH4OtOd5OdRycBS+i5CxPNNAaSyfn8WFSWbH61\r\n3Q/rQJUdWNsy7NbfyS7J4jrsz9GxA/ut02Alp8KPeV3I+UJY4B8JZfZCnn96\r\n7sVgpySR/VEjugRfXlTxLC4eZcvkKEHq0KQ4P2EYG3PdhtgRy6irnLOQWGDE\r\nEZmnVN/8q5Llm7RBemtLhjgoZWB/z7WvFsXaRQs7skNyUIDNTage25Um84P/\r\nuKWiSihY4elF3FvhFqYu4rJMU3ttDFNTo/kiWIh1697zKeXp8QdZ5xM3OyNp\r\nu4c0tEOZpQcqik17xH4ItpqUi+vefIY51d4I0P33/PFBAySTh8YgoXI/lbiT\r\n/FV/8Lgvo8K05+LxQmpszHht3SVH1BHA2quGZWGggb+zUuShBcNC281yRvzw\r\nqa6dStz+2OSqKgSJWwwnlFEyRrQIbfmSVs4=\r\n=oZuk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_5.0.0-beta.1_1657438623176_0.9279562822789051"},"_hasShrinkwrap":false},"5.0.0":{"name":"next-with-split","version":"5.0.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.cjs","module":"./build/index.mjs","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"vitest run","test:coverage":"vitest run --coverage","build":"node build.js && npx tsc --declaration --emitDeclarationOnly --declarationDir './build'","semantic-release":"semantic-release","prepack":"yarn build","prepare":"husky install"},"dependencies":{},"peerDependencies":{"next":">=12.2.0"},"devDependencies":{"@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@edge-runtime/vm":"^1.1.0-beta.11","@types/cookie":"^0.5.1","@types/node":"^18.0.3","c8":"^7.11.3","esbuild":"^0.14.48","husky":"^8.0.1","lint-staged":"^13.0.3","next":"^12.2.2","prettier":"^2.7.1","semantic-release":"^19.0.3","ts-node":"^10.8.2","typescript":"^4.7.4","vitest":"^0.17.1"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --write"]},"gitHead":"7141f09e4a5efb0f8b0560844b0227d0be6dada0","_id":"next-with-split@5.0.0","_nodeVersion":"16.15.1","_npmVersion":"8.13.2","dist":{"integrity":"sha512-qTuN8m3IGkqv+FAd+elyM0KlJM/X/9DSoPl0FeqLXdqZrpFfI6Ua6vUTHHp+xN/apKnbVpg1e+/9JTcGo+likw==","shasum":"35b1a22d90162834019703fbafb2584475e01bd9","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-5.0.0.tgz","fileCount":15,"unpackedSize":256705,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnfnL/4IldZL2bJTA682mmMPUNPTXgEILgF0n3gdBQpAIhAJFCHy7BKx3DGxpXoAxzE/yDujG2dEaqoo1Comt80odT"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiypl+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5/w/+LkVtm7DHPh1Jf25vp76sJhnMdmNIcaxxHQrVrK6Md/Jhee8P\r\nSu9yr2wg5kCMpEQlANgXYsWx7CRdWvzgYmcie7PO9u2kMlb7adr3Bxt/5QXl\r\nWiCmwo5w40RCDajezUt7PoY5plaubEAw8r5euYcmWfa9SQUJfYr1g4edeIPm\r\n/DqJVo/o9moqwj8f/5zt9ld2PjavpaYrJwYBAuQn03sO2yiXaLqO+nLFPhH5\r\n+unYbRY0qkt3fxdMWS49kt/At6eKgMicKSd/KPLzB5W57yDavQa71/EQyvpn\r\nrKD+bmTbClfe/4fr9OMHZ+me5SyYG6qMXATgCf8H+mJkpAv2ZRNew/Rsi+ox\r\nMwVyeUteAD2UPViJg7A2CtaCgq2msubVLwFV/WVDiKIe1SxChWOq6kL7FjHX\r\n43dF0JsF9ZgLNO69kCYMd8i9hx8F/E2jHz5lKq802zMxIm5srQXBVrQwfkA+\r\nCGsLZahOJKAwzEf1xJV9wB5HtnVybH2+MpKNMZuXTGTpNNsqrVP2jUgVY73f\r\ntPDzc386fo0PpA1FWwUIgCccemCuMzzibc9IrvGJ6YAjoSl3PLyxLcseY3tz\r\nP5xrNh4YwVGcaT8VKGgnGuMfL5R7Ym6Lh7iIEmjgjJ9b4tAMU6gu0Bzyhfp5\r\n4HdGb1MClUkYUWsy5Sqy9Z/xJGZRroMY6gc=\r\n=raER\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_5.0.0_1657444734035_0.48229553998057106"},"_hasShrinkwrap":false},"5.1.0-beta.1":{"name":"next-with-split","version":"5.1.0-beta.1","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.cjs","module":"./build/index.mjs","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"vitest run","test:coverage":"vitest run --coverage","build":"node build.js && npx tsc --declaration --emitDeclarationOnly --declarationDir './build'","semantic-release":"semantic-release","prepack":"yarn build","prepare":"husky install"},"dependencies":{},"peerDependencies":{"next":">=12.2.0"},"devDependencies":{"@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@edge-runtime/vm":"^1.1.0-beta.11","@types/cookie":"^0.5.1","@types/node":"^18.0.3","c8":"^7.11.3","esbuild":"^0.14.48","husky":"^8.0.1","lint-staged":"^13.0.3","next":"^12.2.2","prettier":"^2.7.1","semantic-release":"^19.0.3","ts-node":"^10.8.2","typescript":"^4.7.4","vitest":"^0.17.1"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --write"]},"readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=12.2\n\nThe specification of middleware has changed significantly since Next.js v12.2. If you are using middleware before Next.js v12.2, please use next-with-split v4.\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `middleware.ts`. (in main branch)\n```js\n// next.config.js\nconst { withSplit } = require('next-with-split')({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// middleware.ts\nexport { middleware } from 'next-with-split'\n```\n\nIf you already have middleware code, please refer to the following.\n```js\n// middleware.ts\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middlewares do not get into routes that are not related to A/B testing.\n    - Use [`confit.matcher`](https://nextjs.org/docs/advanced-features/middleware#matcher) to limit the scope of influence of the middleware to the target path of the A/B test.\n2. The middleware for next-with-split is not needed in challengers, so remove the middlewares. (You do need to configure next.config.js, however.)\n3. While stopping A/B tests, remove the middlewares.\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"085e5bf7c2c3a2c1cc81b426d52d787d931dd752","_id":"next-with-split@5.1.0-beta.1","_nodeVersion":"16.16.0","_npmVersion":"8.13.2","dist":{"integrity":"sha512-7MBt1bBTJbg3ObsHbQhmZHk6aAQqfyzdf5+g7LrhebWxxO5d/a3uKBPGS3sR//uEuB9loKjgrCP0eoW69YMa+w==","shasum":"1f32aa5a2f0e616985f04a18308d9a03858f1754","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-5.1.0-beta.1.tgz","fileCount":15,"unpackedSize":256339,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICq2ANJtIaTTC66njAUrTIFCaatzoTHG+6OYf4tmRApoAiAgKwY++TLYs2ZlsQkpmH1v6yHZJWtItLehyycMpgKoSg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3q7AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoROw/8CUqyc1c3nHeNXxdB/xM4r3qleSo5s+Gcy0m+WnlmSSbD9UAJ\r\n7jTgBuCi2LDtug5rimYswERdJXniWPHZlmNpLREghqBOtOFEi9S0cam44I4M\r\nIml0GNq/j+yi274r+N1iWPC76ivrxSExrxXjBxlA8v42V2uKvLLAgJUoubyr\r\nOa+Me8j2Ll5xUDSSnxGFoxcZFEBiwUjxUkRdLymrkaS0UkYitQ2Xs1fHdZ8V\r\nLspoRYQapjv92yvznDFHwyqVSYqMHHi8cJfrKe0jfslB09w4O9pqHDBkaNjO\r\nel/MZ1EHh/VY7rZedMgnFTvWrn6MPTBy9mvYyKfEdRcNbdKVBFfBHGiEufvq\r\nBxpEq+kbNvDT8ztcq2FwpXbp8oscPMCUpLB9VtjLkaAYASsDWPukztzuCWzS\r\nBcwLW8OkAHFJY0dRHI3OlaU23o+AT9enZdQZiUVBtxx5Kl81ck6+fObxko6A\r\ndj8L21/qBxDXrFJFZ9mGIG25X2u99dKoZI5Ueh054v47U/w5EBOMAYRCNl1D\r\n3ikVh9qjuZBTkaODaLh0+ZXKFol2un7RPnFCiXazZT7zhPBO80gFPaYLom1/\r\nRMoS4h15p1gNbe/t9/5Em5EXJjSEJNBDFAuMX/CGT6Z2tpueLKboWsigr1na\r\nX18uY1UQZPfsHrjmrHQ2jSijYjw2IFyCYTQ=\r\n=2Nir\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_5.1.0-beta.1_1658760896552_0.06856162273102306"},"_hasShrinkwrap":false},"5.1.0":{"name":"next-with-split","version":"5.1.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.cjs","module":"./build/index.mjs","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"vitest run","test:coverage":"vitest run --coverage","build":"node build.js && npx tsc --declaration --emitDeclarationOnly --declarationDir './build'","semantic-release":"semantic-release","prepack":"yarn build","prepare":"husky install"},"dependencies":{},"peerDependencies":{"next":">=12.2.0"},"devDependencies":{"@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@edge-runtime/vm":"^1.1.0-beta.11","@types/cookie":"^0.5.1","@types/node":"^18.0.3","c8":"^7.11.3","esbuild":"^0.14.48","husky":"^8.0.1","lint-staged":"^13.0.3","next":"^12.2.2","prettier":"^2.7.1","semantic-release":"^19.0.3","ts-node":"^10.8.2","typescript":"^4.7.4","vitest":"^0.17.1"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --write"]},"gitHead":"d17458cd78834bfa7e7e63e21cec24ab604f68c3","_id":"next-with-split@5.1.0","_nodeVersion":"16.16.0","_npmVersion":"8.13.2","dist":{"integrity":"sha512-XTdhMLnaBpZNKU0JCwOjKXg+astb2eonJx2eJ6V95MfEIHKL1PtJNNdVkYcfV2u8VwnYHcOoRiGf6B8M3GKoIQ==","shasum":"130ddc6ced71f954e8400955da46f79dd7ed300f","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-5.1.0.tgz","fileCount":15,"unpackedSize":256332,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTv1nydy0xFIchsqEwTtX3ufqCUWEf4FUstMXX2Q/FKQIhAJi2AGRnFAnE91Csd9cfOLSEz7Iayf6PAXidxIKhPs2K"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3q+lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpl4BAAg+WE2yY5Hn5Pu1uPLbuGVwMMGB77T4ogd1IIw1qeJH4jnSzW\r\n0cmB3w+tMYP9OiUtjIBCHPdQ6zlki38yIxeZ0rnk6lJWIvdjXdkCYH23W7XH\r\nyNhDw0EQtVpzTZIttaO20BNBX03tfHmCjfUmP/oYE3BWnLfijc152l+W9UH3\r\ngjxClN/EBSdDhgUthz89kWGsPsDjxoKli5BGDFg2ZDY+1Y4X6BOU6KiKJaUL\r\nYhn+H+tNONnr4QiMiXzmwtxc/NN7+XqlfJf2/plNitb0w6oU3QDzkE948Rho\r\nrKioFrhSdwKsX94XGNwXbxiNqo1YexVEtcmuJVybQ0fE+qEwO0vmsFXpYd5V\r\nqrLB9M3iJvtWmd4BjNhWpnmjys1OUb4+L8q1vR6JunHjexAkwzdwS4KyQQJP\r\nzm1pdw/UG2rhJn+OV8hWTTaIcpfwJTha9A02RV4Q7pD2mdMi5NbGm/whyb8T\r\nDN4VsyTr9dOIO3keRUtDfDvDQUw1NGXg+lYs5+aiL+Rhu1X9T0ge+O5Q8ZX4\r\nHhoR9f3wy9yUYc9pUdynKfoHccufesQiF0Xic2CVkF2oCsGIAMy1RifbV3YU\r\nxA0PLI9Mk0uz87ddwcomDFLgLL37LIVLgxsJMvwUms6DaqStQSJNqYwtvxPR\r\nB5B2kyMkn/ZjfIiLiICnmj5X3Qnf0ZlvRUw=\r\n=EqdL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_5.1.0_1658761125497_0.06597033575725364"},"_hasShrinkwrap":false},"6.0.0":{"name":"next-with-split","version":"6.0.0","description":"This is a plugin for split testing (AB testing) in Next.js.","main":"./build/index.cjs","module":"./build/index.mjs","types":"./build/index.d.ts","publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"homepage":"https://github.com/aiji42/next-with-split#readme","scripts":{"format":"prettier './src/**/*.ts' './src/*.ts' --write","test":"vitest run","test:coverage":"vitest run --coverage","build":"node build.js && npx tsc ./src/index.ts --declaration --emitDeclarationOnly --skipLibCheck --esModuleInterop --declarationDir './build'","semantic-release":"semantic-release","prepack":"yarn build","prepare":"husky install"},"dependencies":{},"peerDependencies":{"next":">=13.0.0"},"devDependencies":{"@commitlint/cli":"^17.5.1","@commitlint/config-conventional":"^17.4.4","@edge-runtime/vm":"^2.1.2","@types/cookie":"^0.5.1","@types/node":"^18.15.11","@types/react":"^18.0.33","@types/react-dom":"^18.0.11","@vitest/coverage-c8":"^0.29.8","c8":"^7.13.0","esbuild":"^0.17.15","husky":"^8.0.3","lint-staged":"^13.2.0","next":"^13.2.4","prettier":"^2.8.7","semantic-release":"^21.0.1","ts-node":"^10.9.1","typescript":"^5.0.3","vitest":"^0.29.8"},"lint-staged":{"*.{js,jsx,ts,tsx}":["prettier --write"]},"engines":{"node":">=18"},"gitHead":"443f82f1b231f3438f0d64ca71928e4f704ff5bf","_id":"next-with-split@6.0.0","_nodeVersion":"18.15.0","_npmVersion":"9.6.3","dist":{"integrity":"sha512-QTKWhsbUlpXuWtJBlcYzeLdJK01DNrtGmsk9kA/H0UZ1qRVF90xZH7Na6j5L0jV7O08MpbRfYPDkRTdNkAmXHA==","shasum":"e95b3d01e0d0a878fea113a26f52d11bdb70c263","tarball":"https://registry.npmjs.org/next-with-split/-/next-with-split-6.0.0.tgz","fileCount":12,"unpackedSize":18088,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgb0UtoL3+Un6/9rb5AnWQTFKdaatlJB9TpUeODBy6PgIhAP6SGS66jNb+AZljBP9GVnQPmAUB9nU+OOU3SYdqRpxD"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkK4/EACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8Wg/+Oyt6dQR77knmgQ6W9G+LYOHBXGRSkLVysXNwxjQHLB3Vq01P\r\n9ARdtYzrjxh2ZvGpmZ3z7fkdMn+J/Rclv7onoc6ccVTPv6Wglv+7QGnaq6cy\r\nUGKp27rWUk3SkLlp/krkcc1Dihfnn12Luuz0aWdjL5bjaUsnsQQW5V9sSGO6\r\nor6LqxdWyPtIHFri+AKsO5uE8oiUq+9I9F5xwcr3TWm4s8aFIVR6Oys/PwKu\r\nt5+xSth0/stU1EzE27BqAH8ybXZRR37rIBZ1a2uXnkfa+bno11zHjVkxuK2m\r\ndIaUgSaqPolrP1r0r24mhtSJs9zT+OTDHtkXPR0l3hP7mTir6G0/1z6O0Uo1\r\n93LnhnEDkQW+VRH8mOJPRNwWrjacjyoT7WA5XM9Neuc3SI24cuyUs0rJRDa5\r\nOYQikGbmdPbztHuqZFkdUQM9TphLGiin7DdE4OMPwWCJkNlGpVDhuXdXDHUQ\r\nLqL+kTAmvsQdeopNsP3UhZcs0VmCQ4+Tj4kcUcNo0Qx72IhU+p04+GfE3FHo\r\nB0uPA022UYCH43BuD5TTY46/5OM1xIN1NSEsoMiak13Z1ceQKnPLV28AMQz3\r\nJGCj4vQBj7OVDQrzb9YpInXm5omZYl7h45EPH4Z1IDPThyLO0Il84RmATrvt\r\nqU6Bq8hCn7aiRSo3oyIRWujea6ogVafbP50=\r\n=343E\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aiji42","email":"aiji42@gmail.com"},"directories":{},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-with-split_6.0.0_1680576452199_0.24369474828428395"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-26T13:26:31.831Z","1.0.0":"2021-06-26T13:26:32.055Z","modified":"2023-04-04T02:47:32.488Z","1.0.1":"2021-06-26T13:49:17.815Z","1.0.2":"2021-06-27T13:25:31.249Z","2.0.0":"2021-07-04T07:40:47.777Z","2.0.1":"2021-07-04T10:29:39.310Z","2.0.2":"2021-07-04T10:56:01.260Z","2.0.3":"2021-07-04T11:09:48.594Z","2.1.0":"2021-07-04T14:14:47.693Z","2.1.1":"2021-07-04T14:17:38.467Z","2.2.0":"2021-07-05T12:08:52.553Z","2.2.1":"2021-07-05T12:35:14.803Z","2.2.2":"2021-07-05T14:31:59.009Z","2.3.0":"2021-07-06T14:13:02.059Z","2.4.0":"2021-07-06T14:57:01.343Z","2.4.1":"2021-07-06T15:17:25.712Z","2.5.0":"2021-07-08T14:31:29.252Z","2.6.0":"2021-07-08T15:03:16.141Z","3.0.0":"2021-07-17T14:24:25.442Z","3.0.1":"2021-07-17T14:28:01.973Z","3.1.0":"2021-07-21T10:28:39.097Z","3.2.0":"2021-08-11T12:45:48.151Z","3.2.1":"2021-08-12T09:47:51.051Z","3.3.0-beta.1":"2021-08-18T13:51:32.728Z","3.3.0":"2021-08-24T13:36:08.227Z","3.3.1":"2021-09-26T11:37:51.189Z","3.3.2":"2021-10-14T15:57:06.112Z","4.0.0-beta.1":"2021-10-31T15:05:16.045Z","4.0.0-beta.2":"2021-10-31T15:16:07.714Z","4.0.0":"2021-11-01T15:04:21.201Z","4.0.1":"2021-11-01T17:52:36.066Z","4.1.0-beta.1":"2021-11-08T14:07:35.759Z","4.1.0":"2021-11-08T14:13:37.422Z","4.2.0-beta.1":"2021-12-08T14:48:18.718Z","4.2.0":"2021-12-08T15:04:14.008Z","4.2.1-beta.1":"2021-12-20T04:23:24.887Z","4.2.1":"2021-12-20T04:37:10.925Z","4.2.1-beta.2":"2021-12-21T04:46:16.865Z","4.2.2":"2021-12-21T05:12:40.828Z","4.2.3-beta.1":"2021-12-22T07:43:29.363Z","4.2.3":"2021-12-23T04:25:59.580Z","4.3.0-beta.1":"2022-01-23T12:10:03.492Z","4.3.0-beta.2":"2022-01-23T13:19:42.123Z","4.3.0-beta.3":"2022-01-23T14:03:49.056Z","4.3.0-beta.4":"2022-01-23T14:13:14.728Z","4.3.0-beta.5":"2022-01-24T12:49:07.973Z","4.3.0-beta.6":"2022-01-24T13:02:00.221Z","4.3.0-beta.7":"2022-01-24T13:40:27.811Z","4.3.0-beta.8":"2022-01-24T13:56:11.937Z","4.3.0-beta.9":"2022-01-24T15:12:41.643Z","4.3.0-beta.10":"2022-01-25T13:58:45.953Z","4.3.0-beta.11":"2022-01-26T15:04:27.728Z","4.3.0":"2022-01-26T15:13:49.355Z","4.3.1-beta.1":"2022-03-03T15:34:01.583Z","4.3.1":"2022-03-03T15:42:04.829Z","4.3.2-beta.2":"2022-06-06T15:41:02.452Z","4.3.2":"2022-06-06T15:51:02.884Z","5.0.0-beta.1":"2022-07-10T07:37:03.415Z","5.0.0":"2022-07-10T09:18:54.271Z","5.1.0-beta.1":"2022-07-25T14:54:56.748Z","5.1.0":"2022-07-25T14:58:45.728Z","6.0.0":"2023-04-04T02:47:32.377Z"},"maintainers":[{"name":"aiji42","email":"aiji42@gmail.com"}],"description":"This is a plugin for split testing (AB testing) in Next.js.","homepage":"https://github.com/aiji42/next-with-split#readme","keywords":["next.js","next","react","plugins","vercel","ab-test","split-test","ab test","split test"],"repository":{"type":"git","url":"git+https://github.com/aiji42/next-with-split.git"},"author":{"name":"aiji42","email":"aiji42@gmail.com","url":"https://twitter.com/aiji42_dev"},"bugs":{"url":"https://github.com/aiji42/next-with-split/issues"},"license":"MIT","readme":"[![codecov](https://codecov.io/gh/aiji42/next-with-split/branch/main/graph/badge.svg?token=P126VM3CI1)](https://codecov.io/gh/aiji42/next-with-split)\n[![npm version](https://badge.fury.io/js/next-with-split.svg)](https://badge.fury.io/js/next-with-split)\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/00.png?raw=true)\n\n# :ab: next-with-split\n\n**This is magic!:crystal_ball:**  \nIt enables branch-based split testing (A/B testing) on Vercel and other providers, just like the Netify's [Split Testing](https://docs.netlify.com/site-deploys/split-testing/).\n\nThis plugin lets you divide traffic to your site between different deploys, straight from CDN network. It is not the traditional split testing on a per-component or per-page file basis.   \nYou deploy the main branch (original) and the branch derived from it (challenger) on Vercel and other providers, and use Next.js middleware and cookies to separate two or more environments. Since there is no need to duplicate code, it is easier to manage and prevents the bundle size from increasing.\n\n## Example\n\n[A/B test example](https://next-with-split-aiji42.vercel.app/foo/bar)\n\n## How it works\n\n![How it works 01](https://github.com/aiji42/next-with-split/blob/main/readme/01.png?raw=true)\n\n![How it works 02](https://github.com/aiji42/next-with-split/blob/main/readme/02.png?raw=true)\n\n## Require\n\n- Using Next.js >=13\n\nIf you are using Next.js v12 series, use next-with-split@5.1.0.\n\n## Installation\n\n```\nnpm install --save next-with-split\n```\n\n## Usage\n1\\. Customize `next.config.js` and create `middleware.ts`. (in main branch)\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n```js\n// middleware.ts\nexport { middleware } from 'next-with-split'\n```\n\nIf you already have middleware code, please refer to the following.\n```js\n// middleware.ts\nimport { middleware as withSplit } from 'next-with-split'\n\nexport const middleware = (req) => {\n  const res = withSplit(req)\n  // write your middleware code\n  return res\n}\n```\n\n2\\. Derive a branch from the main branch as challenger. \n- **NOTE:** Challenger branch also needs to have `next.config.js` customized (No. 1).\n\n3\\. Deploy the challenger branch for preview and get the hostname.\n\n4\\. Modify next.config.js in the main branch.\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {\n    example1: { // Identification of A/B tests (any)\n      path: '/foo/*', // Paths to perform A/B testing. (regular expression)\n      hosts: {\n        // [branch name]: host name\n        original: 'example.com',\n        'challenger-for-example1': 'challenger-for-example1.vercel.app',\n      },\n      cookie: { // Optional (For Sticky's control)\n        maxAge: 60 * 60 * 12 * 1000 // Number of valid milliseconds for sticky sessions. (default is 1 day)\n      }\n    },\n    // Multiple A/B tests can be run simultaneously.\n    example2: {\n      path: '/bar/*',\n      hosts: {\n        original: 'example.com',\n        'challenger-for-example2': 'challenger-for-example2.vercel.app',\n        // It is possible to distribute access to two or more targets as in A/B/C testing.\n        'challenger2-for-example2': 'challenger2-for-example2.vercel.app',\n      }\n    }\n  }\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n- If you use a provider other than Vercel, please configure the following manual.  \n**Note: This setting is also required for the Challenger deployments.**\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {...},\n  isOriginal: false, // Control it so that it is true on the original deployment (basically the main branch) and false on all other deployments.,\n  hostname: 'challenger.example.com', // Set the hostname in the Challenger deployment. If this is not set, you will not be able to access the assets and images.\n  currentBranch: 'chllenger1', // Optional. Set the value if you use `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING`.\n})\n\nmodule.export = withSplit({\n  // write your next.js configuration values.\n})\n```\n\n5\\. Deploy the main branch.\n\n6\\. The network will be automatically split and the content will be served!  \nIt is also sticky, controlled by cookies.\n\n## Features\n- If the deployment is subject to A/B testing, `process.env.NEXT_PUBLIC_IS_TARGET_SPLIT_TESTING` is set to 'true'.\n    - CAUTION: Only if the key set in `hosts` matches the branch name.\n    \n- When Next.js preview mode is turned on, access will automatically be allocated to the original deployment.\n    - Set the `hosts` key to `original`, `master` or `main`.\n\n- You can control the behavior of `withSplit` by forcing it by passing an environment variable at server startup.  \nUse it for verification in your development environment.\n    - `SPLIT_ACTIVE=true yarn dev`: forced active.\n    - `SPLIT_DISABLE=true yarn dev`: forced disable.\n    \n- By default, access to deployments is allocated in equal proportions. If you want to add bias to the access sorting, set `wight`.\n```js\n// next.config.js\nconst withSplit = require('next-with-split').withSplit({\n  splits: {\n    example1: {\n      path: '/foo/*',\n      hosts: {\n        // original : challenger1 : challenger2 = 3(50%) : 2(33%) : 1(16%)\n        original: { host: 'example.com', weight: 3 },\n        challenger1: { host: 'challenger1.vercel.app', weight: 2 },\n        challenger2: 'challenger2.vercel.app', // If `weight` is not specified, the value is 1.\n      }\n    }\n  }\n})\n```\n\n## Impact on Performance\n\nThis library uses middleware to allocate A/B tests. In general, inserting middleware into the route of the content adds some overhead.  \nWe actually deployed it to Vercel and measured the difference between the original and challenger, and the average difference was 70 to 90ms ([#137](https://github.com/aiji42/next-with-split/issues/137#issuecomment-993518576)).  \nThe challenger is rewritten to a different host according to the configuration in the middleware, which causes a round trip.  \nThe original also had an overhead of about 50ms compared to when no A/B testing was done (when no middleware was deployed). In other words, the challenger has a delay of up to 150ms compared to when it is not A/B tested.  \nOnce the user lands on a page, these delays are not a big problem since navigation between pages is resolved quickly by prefetch, but be careful when landing or processing a full page reload. (Google says that TTFB should be less than 200ms.)\n\nTo avoid adding unnecessary latency...\n1. Make sure that the middlewares do not get into routes that are not related to A/B testing.\n    - Use [`confit.matcher`](https://nextjs.org/docs/advanced-features/middleware#matcher) to limit the scope of influence of the middleware to the target path of the A/B test.\n2. The middleware for next-with-split is not needed in challengers, so remove the middlewares. (You do need to configure next.config.js, however.)\n3. While stopping A/B tests, remove the middlewares.\n\n## Contributing\nPlease read [CONTRIBUTING.md](https://github.com/aiji42/next-with-split/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/aiji42/next-with-split/blob/main/LICENSE) file for details\n","readmeFilename":"README.md"}