{"_id":"@carforyou/cookies","_rev":"12-a56dec404978dfecda7758a9a55beb97","name":"@carforyou/cookies","dist-tags":{"feat-create-cookies-pkg":"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3","tsc-pkg":"1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2","latest":"1.0.1"},"versions":{"1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.1":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.1","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.1","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"18e885a0d664a0a691e3fc1cb31eae51870b102d","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.1.tgz","fileCount":13,"integrity":"sha512-Dd+NExFkErmkF23bv/wTqBR5b/cvKbZM0EccJtqbtLkbOB0UadrnvQ4iBbinkAFARHa+iAEDzyAat9Q5FgrT6g==","signatures":[{"sig":"MEUCIE9F4uXIScdVuKZrXXpp04A3CxCyzl2YBHFg5IWhAlmqAiEAq633+a4k2yR3pwYI+oHg3aIu1mVcazWAg6VU0iowhzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrfnNCRA9TVsSAnZWagAA6FMQAKTAtyCAuT29Uu0T8+Ap\nOrkILDR1DMldfRmSz/Z1L4gKnziLVLI+UkulfbOW2xVfZmZjp9BB1e6xaBBA\n/iJ/aUrvqRfALCZKz/R1dNv28wkSIuRkEijc2DycybdJOqN159lm1gXW0w7A\n9RISjehYh3w2y3DV/SEtT2FVUwPYL3hElDArkgZJddOHNgC7LIuR1ub1Ll1n\nhUvOA8jOemnJDjMIC1w2ivYHr9gjgpakOYVk7EzuIPaVRWmOj+d4e/ETlSxU\nOLRKTgFWS6YYd/pdTBKE7LAd9MCnqV6vBrXv1hYUY/8FCsYKWUbz8H+vdXE2\nO9SWqeCnNT9h/SJNiGGuKqUXlmoYMMAYaDJf77LUfpt2KPVmZfPNsexdNanh\n2SV1PYwX19DRdnHhetaHMIrT+bZW5zlvjHXXMVWv0vs1SOLWrCliAm6Dl65m\nv+ak+TRujS7/JavYkpULg8fGsq3EBmD8wsKcTQefnll5od+J5vxGJ/TugqRx\ny/E7zNTucgFZEZEyiWNGBAsPqsyiOOd/rrgX3zyutoOOPPBvzwkhvwxDquJ2\nTv5Oaq+LF0nO0wKfDmU7IVuxIk4seKX0lDMJ9KF7XTmH8XN5ngjjL+75nhIq\nWS/xydiz+RnGf43NHD1HjLXJVivJlSdTRuma+4RHKVB3AOFadxVJsp5XFAis\nVinS\r\n=ewkC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","source":"dist-src/index.js","gitHead":"922b5504cd351d9deaa77a92d2a30f7429208a75","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.1_1638791629256_0.00856520787034487","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.2":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.2","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.2","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"6fa24f3f5f81957275a96fdf47e700cb895ea870","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.2.tgz","fileCount":13,"integrity":"sha512-NazkjGrAjBXloPiH3eP7zvOaqz0x4MduP/1V7l69ipIXVRXVoEZlDywOYlbAIlUyfHq/rK86if14BPo0m3xwag==","signatures":[{"sig":"MEUCIQDDd7EtLb8hvngJygWmTed1qwvY6WHCrbz6kHOI7ABYmAIgNfI+deHAbY8Tgii50G0W/WLu9hzTH2LPhL7zi4AGBMs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsobVCRA9TVsSAnZWagAAZ88P/iV3uNAIjnLgmCmZHo70\ng2QJY8UfQ4L9F8whICNSqr0JEOL+mPeDq4tUOSqma2dZ82KQNl7mPo1tAxkP\nMGVWPEL2jwrrARmK4X0IFsiXa2ToN5o1A9LxC8Iw7MKTwdPgccf+KpI5gl9W\nKobMdVJlsgtEjsn271WMYUOSap275HvpIFBMxNo80eKWTBbQfyXzzk40R4Cz\nhjiBED1uoK5hfffkP3cnv8fvCzO9vZd/goDTY5d1PQg91p7XvPn+S0yuDEQM\nDdw6exU5NPByFLlJuJH4ddhLxT8mlq8In4AlnTpAq0LaGMX3sgxD1DnMSkLN\nMLp7gk0eTYE1Q/AC204kvV68NnmYLTnno0DdF819KfK8fxRx0HpoqQhmR+mp\nIq/y67cclegmN+c8tjv64Qq+nR4ouEFe2l9uV2aqgdhXgfT6Hu8r+5P9rMli\no8WPALJuZG3okSfsrqIgr65FGkIR8Rrw7xyVz1aoPV6EGoUdQRnjGSREiFIR\nHUgkBhrkeeYYONzN4WtGlAktgX+S7umacY04pFuKgBZTyYaQv/lyXKddf9Vd\n8+xW9np1pUL6TS1c1zWmBOns5MKRdbldoMolGua40BVS/lyjENYHW8YUbKBH\nk3ZPtuMOz5K3ZEFHiya2EGwr+10nmFv3zSbfLsFH/lgDzWYotreeEIixbijB\nEiF1\r\n=hsQD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise, \nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg/pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","source":"dist-src/index.js","gitHead":"3e7c610667e2d1ab266dc7d821ef80fa77866e99","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.2_1639089877128_0.004629763054491143","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.1":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.1","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.1","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"42c5ce2e2782c0e12cda852bba1634ec89a186b6","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.1.tgz","fileCount":13,"integrity":"sha512-hceM/271e0iA0ShmGKQev9bug/FbXXaP7mA3m6mniYO8279LlcvqhBcnnsZGcVwKgz+H19cay+QPw1xb/21HSQ==","signatures":[{"sig":"MEUCIQDmAspGh7ozyUoKDKNgMXcFuKwig8YLCFvP7QKgvuM6UAIgSXccENydp0kFP345KZB7GO+FMbfygNy48/ww1q2WcLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsp4yCRA9TVsSAnZWagAA3wwP+wfpaMgrLYFnAMDztjuH\nezxPVJokSnBuMbrw2P8QmvbgwE1pvZkvLZlrAXnypgWFhHOUYG96Jfyq8VlS\nYk6DL4UVyK91KLke9JOXv2KQAj5rZQVIUr9bMk/94ebEYypJprZBAJMBLgIW\npzLxA7dcDlobwTHSsFV3QuwHrOwqAi6YPLtR+9YneHkTL9ml93/nZfLezl0i\ndM8Pe7J318wnRBg+HPrpKE1eU2UiCBgUpK6LzMZH52fc2ha9d3RVSx5/Iv3m\n36QmxvYl/kI/5B8CWZ7xUk7MwbWGEggF2xIYhpa4NjJF732dEE/pIv76Qaa6\n+kNFYybckAKP9d6M4lQHBil4VDP1oh/hKf7rsJLS0hplRVxgfng9bNTWxPw5\nmJ7o4TQYTq51lBXWBkOFQR8KB5sQAdAJei+z3ZcK34oSOPvngXN4Z4mvFL9T\nOchIccDPh6JDIZXKGb+tTVYeLGiaYVUxS7cnNP4e0m/HF9+I4RXL5k4iI1sF\nXp3umeti5/5UDdjJtMSbJMCnsVnMA4GKLa+FrXO7P/IXqKNIHk1hJmN3gn+E\nGZ1V0ZyhIWy9pQLwDNfAl7ZZ6M7RZPFrxT8KYWClm7m2A3/1E5cQO30/1SbO\npf0HinIW6VjWiiUpkMswrOT4kLO3Hi2lGRTpzK2t/GjqXp81zhwCPSig2/Xo\nKldh\r\n=y//T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise, \nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg/pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","source":"dist-src/index.js","gitHead":"b39c07c1c21d072e29ae0da2f9c4774b88fbeea2","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.1_1639095858285_0.7778225569489812","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.2":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.2","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.2","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"bafc93c2fc4b2c0fabbcf51884bbdf9033ede6e6","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.2.tgz","fileCount":17,"integrity":"sha512-UiO7rokA0u+yRuefZh1+p80MOP0JNUJwcU/3nNy+qyuUZP2tlD6MV8cBQG5jMKF3HB33KcjvmNZXAemr6C1jLA==","signatures":[{"sig":"MEUCIQC+yVYO0xSCr7/2TTvkH0MBlu3lSwWp2XbHORuH1gsuawIgKS40IL2jBPOvO/iCS4XC0Dapsga5VW0HoXKrt7gt+KU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhszFRCRA9TVsSAnZWagAA5oAP/00fBEmT6DnBqgUIki2s\nuRkXueul1q4tukLHzkXCDm+/TNNHtIfQX0tYCqeOlEnlqcuTbYAcgO94nwVx\nTiXg1+lkd6npY3YoRGijsiNlEHwo8EJUl9WfC8xYKxxaLKTP2RgeS1kngTX0\nki+xJmGyzf/u2Pcz7S1PChCezzmXYlLs0VLd2VpN+rne8N6EGWgk9gVaHydn\nsj9Zugg4RjDfbVQs7cbIIElie+PcoRZrL9ijkFCosGwNJ/ni0wIEuohNMN1m\nL7CEQT2CAsAWqV23tRZU2OwBSd7r3RomB/Cl8rIt/ILFbn9LO9BhwvFFLYA9\nhOxrklSPnycFtPNciIgsgHScUZx5vTqQawbenDS83PDRdgmIcb/nOymkc1/8\nJeYv97skOrT2pMSLO2uosptYfp5EhfH/LguNX+XOVg8gJqu/oIC5dDkO6lMS\nnSAZSi63dEC5CckIGObA2vBsuObAIC4kz3ALSmyCfWOfBlnhJcXdKogfkewa\noHY70rUrFjf2LjeQPekUQMUEEx+Z9cGjSbXJdXEOe/DJd97c+NefKFVndAx8\nV7nI/hKfM9/TzuYwJiFBCwGAB91viHwf/R/vUr87iQJ8WRZYQbggtjfl2SP6\nSvGCmPIX0qPd/nm/OJ4KTNKAmZvZwR4aHC6uWq9NQ1hJlsNf4or66P5GO1Yb\nDeLD\r\n=riiX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise, \nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg/pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","source":"dist-src/index.js","gitHead":"21585444e0ce74ba919c9604109e2d08cbf59b10","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.2_1639133520932_0.055729114337168095","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.1":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.1","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.1","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"f7f1cf7a4726802de4c3de688084b15eecfaa1b2","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.1.tgz","fileCount":17,"integrity":"sha512-DtPB+LFc64nxknxH7jKCz2r8Cd1Mwk0k95DwvQgjkTdBasCbigA+ME6sj+3HCyyEp0sDZsgIvvkBCNrRyqJ6cQ==","signatures":[{"sig":"MEQCIEbE1FdGQAQWwidLkgS+EqCWsJxDt07M7SG5nQ2afNkTAiBAi9p2OJFZHEQNKUIYrMwzO6cVzUGCTgWDZjEMyO2EUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs1miCRA9TVsSAnZWagAAReoP/2kzXrtOvaFeBoIq/RAf\n/RDTSv/YT4N3L89JiJI7B17lwCZmxoyv4ruMUd0+TmDrzUnKfyhyACtZckdq\nBe3VvTja+l6lsM6yxoiScHLkPgclX3Tn79hx8/9q+/XKDP9/4/KzEyvOcqvS\n4Nl/0zJxjB5ulqHbAFTJp3PIlYEJ56warC+8EP9wOME4vPYq8g/UHJbr3jUz\nzV9bk9LaEd+3whvlPllhrWKv+XQFp9diIWDYSzX/gHI13d5BIFEnuO5qr2IL\nf3dpjvOgs9tUyiC2AevbLXGQxd7+ACJx4XoGDNwgKE7W377VrUAntlnUoNgq\n9sTDim39bCQbh3Dqsk+Qstug2bZZT9t77qdnc2JSFzjtbHz5EJqZHwagKEU8\nlXPXHu/IbuZ0l6X/qM4bm2vVdt7KvKejuwhlhhmDm13TC2ZBFhmteb/sX0Y3\nWFSsdlGmN2wDfhdfSvTr96XCSNA8BOQRI5HDYYo5z5yURohWzMcBizidrmgo\n6J6AKqcdiBEbj+bOM9hAbqSvwfNqdZZGZ4R1eBqm+8syUMN0xIgzQKgkHtdq\nJFFU2p5sWjt/Ld8EEQEni34jgVsTL4wZweWJjoRLltY8ue+ZnOWgrXXyedAR\nwDLdAx57qwAjEETbpl85Tl8mx5w78aGjefjnMFLdbQOd3fDDzOoGBSIfDkga\nlw5L\r\n=XtRK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise, \nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg/pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","source":"dist-src/index.js","gitHead":"dd81eb61aff8df6c6af258bcb5a39c19cb851fbe","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.1_1639143842690_0.6377696399799444","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.2":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.2","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.2","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"27252996a87d8ac50ab1f638e5020c76732cc9db","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.2.tgz","fileCount":17,"integrity":"sha512-Vb3CKBZYmzjXVoNw7QSOK0SKaGdtn+Iwh2/3RLs3jCDPhYnOmS/JcDfOqmK3i24cCbuTZf2rMlBxYDRYfsc+5Q==","signatures":[{"sig":"MEUCIBS2PEn/+VlOZFA57f682cysz9i1ql+Qb9QyrOQ2twEtAiEAyWdAt8BuLqwhwYqIPE2AolUoIg2wQcq5CAzHVzx1xfk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs1vFCRA9TVsSAnZWagAA+ooP/ix8FiXVJvaQzAa5d61Y\nDySyrShK5CmBZOidgGz64NL2pzJZYbs3Vfa2xDsFUCXPUFclGMRatHbLIRQ/\nZM8IYzL8BeEPcOkMj18lAZpZKwIglIl6jm9kvNWUqAlmLYx2Hd2X34fSQeBe\nuQvT+vxlazawTm/1Gn63lAFksf5syPyhrpLl4ltHcM/OoiUpqVEZpHqMioh5\nEW7Pah3FrZoN1x94XuSfD1CIYNk/PZmHVNfD6Rup1jT8DDmGkU/BgKRBYlQO\nFycKEKHUQNt4BCnOh+ebv5425bFtW0VD8w5r8XomVbkCn5gyIgZW8jipMO/T\nVjS/sKo2UaLc+oHSR3dQT+bBmtUBqSh8leB18oH4Bp8F6ZvCo95lvVtgA8rV\nByjOVXgm6YdbQGtiN+f/CNyLUnvNrnZ5alhBBJHOdxR5rLJUkDS0tohpqMsI\nAdginnXyTOB1OibUzOsyz2Ss2Z8lkhBW/fgbstf77DWt3jUbDbu0pVbin9UU\n0008dwDAkydSinuwttgTKnW5fLeBEi8IfjAjh46GDfxAHCcrMG7r1Y7bgc3s\nWk90k78z+e+TvyRQui2D163AD+kcUU9+WqX89mDn+iDxokP9+eqf5+IltM5N\nHgySw3DgGRMDwtEJaeWAq7OshiyCStK+HfgktqOW30OayPBRlaNgTufqobEX\nhBOi\r\n=kMIa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise, \nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg/pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","source":"dist-src/index.js","gitHead":"6a92c5b091fab6cb42aaf1f19022a9e1abcc8d6a","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.2_1639144389645_0.23354235659403733","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3":{"name":"@carforyou/cookies","version":"1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3","license":"MIT","_id":"@carforyou/cookies@1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"2fb8c074b7e0ce2065ac254fa2b766abec455a03","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3.tgz","fileCount":17,"integrity":"sha512-3J7Pl8YLlyHMDbXRHTpvSniWVZHTrB3Vy8UQoyG7X0OElUULMr0aV/4JMiERQe6pvxXsnffwjI2EUF6wkpZhnA==","signatures":[{"sig":"MEUCIQCI80AnOiZcNNQH3C1py0bS1h5kMnMoMBwA4WFwOv6dJwIge2OUNP+8MYsx+FUOHv0g+AdogXFI+3ddCm9n/Tz1fbM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtwSTCRA9TVsSAnZWagAAEpoP+wajg77DUuMZ7DvPCXBp\n+4dCA0r6/IIN9pS13jeFUQ/3ykKDQm27zp/hlpHMHHBvmdyeEwBjsheUMrPN\nxT9xuIoNjIPAfsCjq4FgUv3aA8xntzr6+scG3lA1clfXPwLpgcujAaO2/4oz\nJod2lmnAUDJw8qH2xmI1IWDPGAINw+2Zi8yw7L8C4a4p6Jd46zbhLpH2TXQx\nel+UDcYGN2C14Ic7PoZOVuqSwuiJEbYGrSF/GdqDk5W6/DHWkfbW0G+XKNhi\n4FSg3C52Sx1umGb1u/ePOy1nXpFKSn7w3E4pcgQJ2pfDD1fDDupjoWr47Q7c\nEesXV/C55B94NR5VNXhv3DX1A5HzVl6hhZSjNGs+2kImWcOn4op0iC3Gfmcx\nxgInIbfH+//0aznJ5kvIkOv9CrJ4ze4TitvP/DSEc92qIcrGjuQYZoFVPxAP\nCSXmS3Z3iXIF6lxfKSUuvWqkumAEWU0i+b7TcKjumOF9UGEMxynwUVZscpA1\nqTr55XTwJvyD0BnIJyxDecMKd8w5RoOdUgsk6bqM3wMh+7nXqTTM3kgoOnXJ\nFbMHjt/dnF3bSmT9oa9L3a5Zxi50pUOAFTniwScV+R/tfyOVn6OfNiyDyFwN\nKPIWCvX30TLoetn45SY7hUYeHDSGiszqBFCbsUyGu96s0O1gIWOK24kyXYNQ\nYSur\r\n=DLVU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise, \nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg/pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","source":"dist-src/index.js","gitHead":"2d71f0ff231069285618ad461e2867fb3c852182","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3_1639384211642_0.4324831120459327","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.0":{"name":"@carforyou/cookies","version":"1.0.0","license":"MIT","_id":"@carforyou/cookies@1.0.0","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"7cfc85fee299252b0c6266f4e867daa14c47b0a6","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.0.tgz","fileCount":17,"integrity":"sha512-adifpgZpiTSkfqR+vHKJJitmVIsmEUVIZwHGtjxF5LUwpA8xUyxxCRzlSsUsp/VzgB/FZqi0NPDo4PQtE1REug==","signatures":[{"sig":"MEUCIEmxBZwxwe0GnthvrlLcWtAHnd4Qy6H4wSZi4RhYA58AAiEA6ikN37hH62xafPRbT0l503/s/vUXCcIzmGBqque/xgU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtwWaCRA9TVsSAnZWagAAcr4P/iQT0nmDC3U21H+DUPr+\nRd4FFwXjlh5zXBcrF9iYaWJ9qsPl6ghKw8mHEzVwKnb0urpb0nX6TpVc0G/M\naQywUftDz3KLctlisGvIDYyXETjl43Rx5TNHMOLXAzM4+a7f8YaqCLbcyjeH\nMTyNXc2nTbodMw4LS9gMW7ACYsQgAT1zsrFBY7H8Bdf9cs6TMJkl1O2gatPx\nIWn7gw+llZ6aCPfWvf+C/osvtcy1eD7ixmI5371Gsufa7eFWQi9upCs6dXRU\nbBSP6WXdx1y2Ofclhnulg7/9gQC9qPThFgyRR+ToWErut/yPWMQMkiKejEAD\nyJ3SMVRTLuwItlsGbeOY5MDZbWiafS4hWBQ4Yfa2xxm4xrjKT2PqY6XHfeRn\nv2A9B/8Webjy4I/s4GQItgTsweu9WYwz0N2JR+5fTWi2Qa6Ox0gCpWQQUQe5\n2gUlAUUTYS6ODsQFyY4MRnvCELZVPv6p+R7g+Ma4x7+IsBmKhW5ZrtIDfhwo\niGiIBWqZ9YwTyuG6zoIMPHMAQAuUu4ZOExPB6G/Mvv16l1CF3jP29NrlECqv\nQsbkJi8McjWFOWnpZtU3rGhrEolndhnmRK+rI0DQ69MG1IPuwFV/Tp5Rf99L\nZz11t5L7yrpr3aMx/sObHui6Adgm26gsMTzR4L+F82NMfK+TkG7t8sFjzNEa\n/sJm\r\n=XCHD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist-node/index.js","pika":true,"types":"dist-types/index.d.ts","module":"dist-web/index.js","source":"dist-src/index.js","gitHead":"90496aecd6751d959f412798e77ddc3e9aced8a0","_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@babel/core":"^7.8.0","@types/node":"^16.11.10","es-abstract":"^1.18.0-next.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"27.3.1","next":"12.0.4","react":"17.0.2","express":"4.17.1","nookies":"2.4.0","ts-jest":"27.0.7","@pika/pack":"0.5.0","typescript":"4.5.2","@types/jest":"27.0.3","@types/react":"17.0.37","jest-fetch-mock":"3.0.3","@types/react-dom":"^17.0.11","semantic-release":"17.4.7","@pika/plugin-build-web":"0.9.2","@pika/plugin-build-node":"0.9.2","@carforyou/eslint-config":"3.1.22","@pika/plugin-ts-standard-pkg":"0.9.2"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.0_1639384474230_0.5485988397982988","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.1":{"name":"@carforyou/cookies","version":"1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.1","author":{"name":"CAR FOR YOU"},"license":"MIT","_id":"@carforyou/cookies@1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.1","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"7e5a4cb97d125a2f359cf649950542b8af8028ed","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.1.tgz","fileCount":51,"integrity":"sha512-DXwfZvzqMHVBq4Rgo2Ap4xTtZ3DUoo+5J9941TLi9WFJBx3hcNaCJZCFAUbzgsG2TbIcU/7y/+48R12ElU8KnA==","signatures":[{"sig":"MEUCIQCAJUxOIO6CvuoDuVhU54k4HLPVrRZHWhCn88R4P/ddsQIgejUjJefgy8X4cEUocSge3f8wVxwC/QfpTeQkcBnM6LM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4TAFCRA9TVsSAnZWagAA1CQQAIA8Xrjs1IC6pMGG2UcU\nxsqxmpQsEiQ44/M84nt5d/B8433mEEc+ojQuqN55zFBK75mp5p2kitHmUCpa\nR7s7uOhwHMoyTlecY4h7hiaEzWP28JE+dn6WjD9qnHT6NT2UkAyGeRCScJYc\nfGtLClHWBtmcpYAjAKMkJaU7FQ6fq8MvTvCf1jrFDPFrSfDMv8c9px59MO7H\n3JXYeO8h+UJiufUU3Dq/gXX8D/ywA0BxjpJaLJSShbhKWN5X1w0MgYpWQIaq\nFdei98G2yW4+btMgN6LTo8801I8AKA/9Oq2z/Gqh4o5/vQSQts0G7Vy7uUKX\nXLgyg672ui/qZmMRR8vmV/yyoQpX3p5Yenyis/+VoVNKLlypl4Oqk77KxBol\n+HUs97WoFElYqDQrjIorPxNvofZjFFlYJVrmJa6PblpUyoh67CYfMn91BOUz\n7T/v/4p+kdCAMTDQQgKthmyt4OiWMfa7yjJbqfD6r3mnupTjNRKXjcZMxumu\nuZilKDYZbj0YWTPs3hrEJ2BMPd3wNbrrJ+TDEov248w7RXp+ILOVBxzpWNhs\nyJRL5M/y9Rz7dlBMLZLxdgUWW3rqVh8vsxyGbvGl0M7bDukAVYRCqQtEbBi+\nzQpMxqQAx3xVjyXQ+IHWVc/6of+bQ1yR1s/w2KpE6ZAXYlf3iPaAH6mLCTCR\ni7RH\r\n=WOkn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"pkg/cjs/index.js","types":"./pkg/cjs/index.d.ts","module":"pkg/esm/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise,\nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","gitHead":"d3b1fc6ba2a1889d39ec285c23c5609a5630b80d","scripts":{"lint":"eslint --ext ts,js,tsx,jsx,json .","test":"jest","build":"rimraf pkg && tsc --outDir pkg/esm && tsc --module commonjs --target es5 --outDir pkg/cjs","format":"npm run lint -- --fix","version":"npm run build","typecheck":"tsc --noEmit","test:debug":"node --inspect-brk --inspect=127.0.0.1:9229 ./node_modules/jest/bin/jest.js --runInBand"},"_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"_nodeVersion":"16.13.2","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.4.7","next":"12.0.7","react":"17.0.2","rimraf":"3.0.2","express":"4.17.2","nookies":"2.5.2","ts-jest":"27.1.2","typescript":"4.5.4","@types/jest":"27.4.0","@types/node":"^16.11.10","@types/react":"17.0.38","jest-fetch-mock":"3.0.3","@types/react-dom":"17.0.11","semantic-release":"18.0.1","@carforyou/eslint-config":"4.0.4"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.1_1642147845240_0.4973080253873916","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2":{"name":"@carforyou/cookies","version":"1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2","author":{"name":"CAR FOR YOU"},"license":"MIT","_id":"@carforyou/cookies@1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"4bbe222565d49bf1588973eb68d6cf6c5d65ca7b","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2.tgz","fileCount":51,"integrity":"sha512-23LUJ+4TcDh8Y6dueoGbHI9jgYeBr4s9YSYDGX5m08trlnenJoClRmwXUmEPZ9zUhXMfSuDfr+n8OIpajSCjCQ==","signatures":[{"sig":"MEUCIFzWS49wG+fch66O0x/RrI6YCjmU1xTJ+UvSDh6vAS4BAiEAjMRyzFpEyYL3VnPR6GoYn3QYNygeRsNTAD4vbcF6nEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh58TYCRA9TVsSAnZWagAAxr0P/1gw1UmKNShn3vOxbd/b\ny2cZtT7YrdoUrq5hkw6LgvQQ8QPQYZqzLsdCK+9KzvR174/8Zhh9yq4gQt0A\nj5UOomPoU19Ka0ibE1QrJPsRf3SGGAgF4cZQ8Gy79T3A9T7NWZJe3P952YtC\nDx4c59aGes9RoNx3AhYiy3hOIfBeaOY2PyoO500rZvO8SaUKipYliMC3S6BO\nz8KuWF5sHh/cB63wc1RCBheLuxHbSBE+NzfQQUGYRJDOEt+m1zm20ZhZxYHs\nvmCCpyFC0G7mCCiss6x3hEpBY5WrNRuHjCyT4kG7TZfKDQQait1hHcNhKU3b\nQaZa7ivWLcEsz6UsYwIEwrG7gapX3+w+/THmCDUSWqerjShCIMWMdB8DnguU\nCZKNrqE2x40pmO+0aHCMgAoRC9/HgaXmCTxI98RTOBtdT34mhNYktQlw9O/c\nLH7SmwGTjNXeG47J5nkwqcxllRXh/HIHfzfXubzc93Qb+8tnIyuG2Ufsz8TM\nqnyk/0AJM2cFqXAhnpt4KK1aIaujF3pMzECYewyQH6oiOHQmhtL+vo0gculF\nya0y54SLhbRWZ20QYH9Gp76mvuraqZflvr7f5byyyDr2wR8aEnvi7MWB52zy\n9t/2428iDRpoQ4bhEBXZB+8Z7xZ3VtGqFMMTJ0HlqFcIjszByz+m/mmoLRwM\nYGm2\r\n=gZd0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"pkg/cjs/index.js","types":"./pkg/cjs/index.d.ts","module":"pkg/esm/index.js","readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise,\nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","gitHead":"00e137ee8f632b0ccc9b475f247715a1f047b1af","scripts":{"lint":"eslint --ext ts,js,tsx,jsx,json .","test":"jest","build":"rimraf pkg && tsc --outDir pkg/esm && tsc --module commonjs --target es5 --outDir pkg/cjs","format":"npm run lint -- --fix","version":"npm run build","typecheck":"tsc --noEmit","test:debug":"node --inspect-brk --inspect=127.0.0.1:9229 ./node_modules/jest/bin/jest.js --runInBand"},"_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.2","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.4.7","next":"12.0.8","react":"17.0.2","rimraf":"3.0.2","express":"4.17.2","nookies":"2.5.2","ts-jest":"27.1.3","typescript":"4.5.4","@types/jest":"27.4.0","@types/node":"^16.11.10","@types/react":"17.0.38","jest-fetch-mock":"3.0.3","@types/react-dom":"17.0.11","semantic-release":"18.0.1","@carforyou/eslint-config":"4.0.5"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2_1642579160600_0.2655742010529132","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"},"1.0.1":{"name":"@carforyou/cookies","version":"1.0.1","author":{"name":"CAR FOR YOU"},"license":"MIT","_id":"@carforyou/cookies@1.0.1","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"dist":{"shasum":"21749a3ffc43affe0534c662b0f4e3dff6a82eb1","tarball":"https://registry.npmjs.org/@carforyou/cookies/-/cookies-1.0.1.tgz","fileCount":51,"integrity":"sha512-WHEQKKyKW9wt5M2Nif9zxNQ3YGqZrFxeWieYY2VfvqKAsXsEpsv0deRHqLSSegRQEfp7M5XRMg/y5ipZLR7e+Q==","signatures":[{"sig":"MEUCIQCWebGY/iVg7VSHB6Iz663JaTdV/pv5kYkJU2mE0FtLyQIgbsnWlfydPiJlU22tNR77YIq0LHS2yYGiXgJhYwwnaMo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh58fHCRA9TVsSAnZWagAA0KAP/3tQ0f0nvJfMcxfIHkOD\nr+1QbyLYfY8z+HS0J3793i6JRl8q+0Bqal2STKX0Gl8RD1o5OG1nwxW7rUsd\nr4RDNiTm50CV/CUbBcBQrViYxYFTQbUUsTcgDx1TatnfNFSzOfvbw49Eqc2S\n7pMqvXSdQeZhc/4JoiHg5UUZZac7BdUcqijJRN4HGLPmoaaA3mVP/Vq+z6u2\n2tcTiwpift9k30RGwmfJB0IfnucNJuJqMk8/bxc+0ArNP8MKnkPE1Izvd1EM\nyRaTRnLxp6MhaJs7LLn8LTP9TMO/4sBmC6yLpfIBTadEyHp/WWCctzW+z6yq\nFH5JEZdUGvn3Qe+1TCGjIEcC93ClcsgiSV8wCuOGaiFHgEo+a1SfgUMaF1Rz\nY6QricGkOwykOCu7CMT/GW8uXIeYyFZ/X4BU9gutNVVrucWEi08o9IhbhvIX\nEfp95lVjrbLSUubR/GDgpfbOrZ1o4wHTKRn+qhFfHcoFeG88GwcW6Ec43RVW\nEl4CJl9LLegwt2PhUqZlQm9tkLE1BMNOis6baxugBWg48DuTuNEdNhXZ33Lu\nDVrHnro/436AErDLEs5EF67Po38MHP+Slmk7Y6f6RnhZ0BtM0EOv196FzLwl\nZz88u4BFrZpGaLhP2DgHdVCT7LqGlRA1GBQCdfPm62I2PoU9ycOdn1UCqWSW\nD5ZN\r\n=VJjG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"pkg/cjs/index.js","types":"./pkg/cjs/index.d.ts","module":"pkg/esm/index.js","gitHead":"72275a70715fff96e79949ac7acdd7ed5e25ee0d","scripts":{"lint":"eslint --ext ts,js,tsx,jsx,json .","test":"jest","build":"rimraf pkg && tsc --outDir pkg/esm && tsc --module commonjs --target es5 --outDir pkg/cjs","format":"npm run lint -- --fix","version":"npm run build","typecheck":"tsc --noEmit","test:debug":"node --inspect-brk --inspect=127.0.0.1:9229 ./node_modules/jest/bin/jest.js --runInBand"},"_npmUser":{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},"repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"_npmVersion":"7.24.2","description":"Cookies package for setting and reading our cookies","directories":{},"sideEffects":false,"_nodeVersion":"16.13.2","_hasShrinkwrap":false,"devDependencies":{"jest":"27.4.7","next":"12.0.8","react":"17.0.2","rimraf":"3.0.2","express":"4.17.2","nookies":"2.5.2","ts-jest":"27.1.3","typescript":"4.5.4","@types/jest":"27.4.0","@types/node":"^16.11.10","@types/react":"17.0.38","jest-fetch-mock":"3.0.3","@types/react-dom":"17.0.11","semantic-release":"18.0.1","@carforyou/eslint-config":"4.0.5"},"_npmOperationalInternal":{"tmp":"tmp/cookies_1.0.1_1642579911633_0.3835408210814042","host":"s3://npm-registry-packages"},"deprecated":"Platform was closed down and no longer maintained"}},"time":{"created":"2021-12-06T11:53:49.205Z","modified":"2024-11-18T13:20:37.876Z","1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.1":"2021-12-06T11:53:49.393Z","1.0.0-feat-create-cookies-pkg-922b5504cd351d9deaa77a92d2a30f7429208a75.2":"2021-12-09T22:44:37.283Z","1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.1":"2021-12-10T00:24:18.470Z","1.0.0-feat-create-cookies-pkg-b39c07c1c21d072e29ae0da2f9c4774b88fbeea2.2":"2021-12-10T10:52:01.057Z","1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.1":"2021-12-10T13:44:02.817Z","1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.2":"2021-12-10T13:53:09.777Z","1.0.0-feat-create-cookies-pkg-dd81eb61aff8df6c6af258bcb5a39c19cb851fbe.3":"2021-12-13T08:30:11.781Z","1.0.0":"2021-12-13T08:34:34.409Z","1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.1":"2022-01-14T08:10:45.459Z","1.0.1-tsc-pkg-d3b1fc6ba2a1889d39ec285c23c5609a5630b80d.2":"2022-01-19T07:59:20.751Z","1.0.1":"2022-01-19T08:11:51.808Z"},"bugs":{"url":"https://github.com/carforyou/carforyou-cookies-pkg/issues"},"author":{"name":"CAR FOR YOU"},"license":"MIT","homepage":"https://github.com/carforyou/carforyou-cookies-pkg#readme","repository":{"url":"git+https://github.com/carforyou/carforyou-cookies-pkg.git","type":"git"},"description":"Cookies package for setting and reading our cookies","maintainers":[{"name":"carforyou-engineering","email":"engineering@carforyou.ch"},{"name":"lkappeler","email":"me@lnk.codes"}],"readme":"# CAR FOR YOU cookies\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Usage\n```\nnpm install @carforyou/cookies\n```\n\nThis package exports multiple functions needed for handling both server-side and client-side cookies\nin Next.js projects.\n\n### Setting server-side cookies\n\nServer-side cookies can be created by passing { req, res } context to the `withCookies` function:\n\n```\n  import { withCookies } from \"@carforyou/cookies\"\n\n  const { setCookie } = withCookies({ req, res }) // pass the ctx object\n  setCookie(name, value, options)\n```\n\nBy passing the context to withCookies, internally, in the `setCookie` function,\nan api call to `api/cookies` is made where our `setServerSideCookie` function\nis defined. `setServerSideCookies` sets the cookie and returns a status code\nof 201 if the cookie pattern matches to the one specified. Otherwise,\nit returns a 400 status code.\n\nConfiguring the api:\n\n```\npages/api/cookies.ts\n\nimport { setServerSideCookie } from \"@carforyou/cookies\"\n\nconst cookieHandler = (req, res) => {\n  try {\n    setServerSideCookie(req, res)\n  } catch (err) {\n    import(\"~/lib/sentry\").then((module) => {\n      const Sentry = module.default\n      Sentry.captureException(\"Failed persisting client-side cookie\", {\n        extra: { err },\n      })\n    })\n  }\n}\n\nexport default cookieHandler\n```\n\n### Setting client-side cookies\n\nClient-side cookies can be set by not passing a { req, res } context\nto the `withCookies` function.\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // no arguments passed\nsetCookie(name, value, options)\n```\n\n### Getting cookies\n\n```\nimport { withCookies } from \"@carforyou/cookies\"\n\nconst { getCookie, setCookie } = withCookies() // pass req, res for serverside cookies\nconst myCookie = getCookie(\"cookieName\")\n```\n\n## Development\n```\nnpm run build\n```\n\nYou can link your local npm package to integrate it with any local project:\n```\ncd carforyou-cookies-pkg\nnpm run build\n\ncd carforyou-listings-web\nnpm link ../carforyou-cookies-pkg\n```\n\n## Release a new version\n\nNew versions are released on the ci using semantic-release as soon as you merge into master. Please\nmake sure your merge commit message adheres to the corresponding conventions.\n","readmeFilename":"README.md"}