{"_id":"next-env","_rev":"4-46ec8d94de2f12429f4429e83022abb1","name":"next-env","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"next-env","version":"1.0.0","main":"index.js","license":"MIT","homepage":"https://github.com/formatlos/next-env","repository":{"type":"git","url":"git+https://github.com/formatlos/next-env.git"},"keywords":["next.js","next","plugins","environment","env","dotenv","runtime","configuration"],"peerDependencies":{"next":">= 5.1.0"},"devDependencies":{"next":"^6.1.1","webpack":"3.10.0"},"dependencies":{},"gitHead":"f2da5339800cbbfcd94015e595ad21228975ba2c","description":"Automatic static (build-time) or runtime environment variables injection for [Next.js](https://github.com/zeit/next.js).","bugs":{"url":"https://github.com/formatlos/next-env/issues"},"_id":"next-env@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"formatlos","email":"mr@formatlos.de"},"dist":{"integrity":"sha512-/O5CxjWVupR0teyBFHVFrQZtv2EdVYGrePnQfXDubjyy7JOR3+lOTWhm0QOHl0WjWNR9eNnwkkOmiVJU2btqWw==","shasum":"ac4a65a172571d55afb2daa018a17ea1706d87d3","tarball":"https://registry.npmjs.org/next-env/-/next-env-1.0.0.tgz","fileCount":6,"unpackedSize":156397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdRuwCRA9TVsSAnZWagAAa6IP/RBANY0lMLHQtZ8YsOSz\nBc2UVmnIPy6u+66jHbIV4M0BYpIKRZ/iS7OV1hnmjiSnjajXVaYenzzsqtjl\nKTToXk78d/8O+2Aj0yrTXc2jkAK75kDLOhlK1POo6HtpaVdGQ/728MKYJNUz\nuKkDLyrcmbUFi6AFNoG3tXDeKFJ3P7TYg3fTskNpuiyvyoz/YYHhCuWak2LT\n7Sy+3n6g2Qap66fdXp4mP23sgdPDUV6EbHWeF4obW6Vsg13AA9Nb4V0Qa60y\nNQKs6vttpkTdPXPOm5O3fp2y/oY0dtzFPcmO9AJzeGFtL4CD1wvzzXN0uj5S\nZYKSB2ds+jqtak3iHzVAXvSDSf8R2Fssmi9QdGEhaKAMT4k/gpNB5LwX2y3U\n4suacCRtWHVmIfhyufychH8JfHe44k9OioVWbluWR12y93x7+kbTp9FmGH/b\nk+HWbdtb97/3H9Rlqmt8SWc0Ie5q/Usk3HLh47ui3PaL6MU0We9sfB5Kr52d\nYZM5/RUgGIXbrvoskbLIi1qmrRejBslseQfysz/Ms8MQrMO+Kz39N0zgfaXL\nV/61vERTYBLGx8D1R9A3JCbdbjtvhPLcQEoekHA2VRVsQQoRiYbLTG+tPL6E\nfdtPq4OKgcGVEm9DGDYGywtd+4+IzcTz96RBfYVNy9tel/g88ugDLjkfYx1k\nyM37\r\n=Qv4F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7YkEmguvfONq5Aw34anU0thcioREzhUNUMUBQ6CdBwwIhAIVnMbxFeOtJf552tQm0p0rK/M1bZXsVfMwXWoUb58rg"}]},"maintainers":[{"name":"formatlos","email":"mr@formatlos.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-env_1.0.0_1534401456268_0.9735603576665071"},"_hasShrinkwrap":false},"1.0.1":{"name":"next-env","version":"1.0.1","main":"index.js","license":"MIT","homepage":"https://github.com/formatlos/next-env","repository":{"type":"git","url":"git+https://github.com/formatlos/next-env.git"},"keywords":["next.js","next","plugins","environment","env","dotenv","runtime","configuration"],"peerDependencies":{"next":">= 5.1.0"},"devDependencies":{"next":"^6.1.1","webpack":"3.10.0"},"dependencies":{},"gitHead":"d8bdf11f940bd0b75e117fe90ad7790e87856df7","description":"Automatic static (build-time) or runtime environment variables injection for [Next.js](https://github.com/zeit/next.js).","bugs":{"url":"https://github.com/formatlos/next-env/issues"},"_id":"next-env@1.0.1","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"formatlos","email":"mr@formatlos.de"},"dist":{"integrity":"sha512-J+xDaJomJjlzwZ1S1vftvWzbn5csTOBrZPuYb1jHFZ45i8ygzHj25v2lZL6O327RBPylEJ8PjbpbU+GY+u1FkQ==","shasum":"7221e6bdbc343a32ae50e803491ff8178c966f61","tarball":"https://registry.npmjs.org/next-env/-/next-env-1.0.1.tgz","fileCount":6,"unpackedSize":156404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdw9hCRA9TVsSAnZWagAA628P/iqDPFBlS3KUv/wao5SC\nrCp5qGHtiK88KsWvVoVZ+pXjJNvYxfQvB1QG4d7YxhuvtQAYTyka5uv646W1\nOVjBi+OsMKsq9XDUm6NCySJAF/ufs9tgryueNYTapYPwXJm7B80/4DDAaRBj\nj9iQaTNmMcJrYhMlU8+2lvZ1dwQt6bx4ozd/WJvmG8gzDzgRCJiRjaLoYV+T\nMAle9NgHJPFzwr/pmzVKQBhmNAqQiHuMOTnojiHE8NwjvdRfkIUrDPmjTWX2\nD4i3VXNNOLUT25raqD+GHNVh4eC+hCf2W7TRBcT01cDk7k1DKfXD2cmRATeL\nrNlYy55rHm75TyM53DxxnXbTSl9ipDo97woQ+a4EAACHV6qWUKYWTpoFSqbY\nuGH7DMYrRfPlfZNVrnk0SOfSAQGeBS9f/oG6ZZfvv0ZcjjvEdB2Y84klhIKO\nrtQl8AUOhs1vuSK2tPFIXJAo+LT+jsBM1ACMPJ9SNng6f+yJNooDJIy+c53J\nZpniT4XqKFnOW/PTi4o/N2zWe7sUtJuAHejrXkKr8O0CdeflmJBd+d6Tsgcw\n0iJOy0/J+hxE/gbmVDbIazrSHi0TwV3NsxkCqkTpaaMTjTYis8X3QdgmQAFa\nXgzRh5RnnVwIc++QtisVbojWu8a0btjTjpfDYUHTKHNAIEO5csiN+PtMwmfB\nDcH+\r\n=8cEJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBszUmtBbgSJ7rs/m8fQ6CLgQq5yXM3pEGOksfOUYiIxAiBIh9oSmqgiYK0LhEif31MsCPmzfP5VdM/xQuXKC11DKA=="}]},"maintainers":[{"name":"formatlos","email":"mr@formatlos.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-env_1.0.1_1534529377101_0.10680957996650697"},"_hasShrinkwrap":false},"1.1.0":{"name":"next-env","version":"1.1.0","main":"index.js","license":"MIT","homepage":"https://github.com/formatlos/next-env","repository":{"type":"git","url":"git+https://github.com/formatlos/next-env.git"},"keywords":["next.js","next","plugins","environment","env","dotenv","runtime","configuration"],"peerDependencies":{"next":">= 5.1.0"},"devDependencies":{"next":"^6.1.1","webpack":"3.10.0"},"dependencies":{},"gitHead":"df016c76e1bca990dca82b8f8fa8d2b471e31e2d","description":"Automatic static (build-time) or runtime environment variables injection for [Next.js](https://github.com/zeit/next.js).","bugs":{"url":"https://github.com/formatlos/next-env/issues"},"_id":"next-env@1.1.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"formatlos","email":"mr@formatlos.de"},"dist":{"integrity":"sha512-eSmpCrYzFqjN9en98jEvhz5Bzw5Ui4h8lV/Kua2zOFlD1NU+MG91u90M1WA6+mUnQROYy2Xv0FvVKNbZpeN8Ew==","shasum":"15794560d58caad74ac78c8db2f60bbabb0fc452","tarball":"https://registry.npmjs.org/next-env/-/next-env-1.1.0.tgz","fileCount":6,"unpackedSize":156689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcar5vCRA9TVsSAnZWagAAvIYP/3UrMSW0wz3UCvmDUP2L\njsLa5L9QpY5UEjomml4DoTdsqDiQw4UPZCe+kBTrGsMVI+fzA6R8wlkgdJZG\nwljfJmiCvZEY1N33Xi0nQQqKolEdmTztrI3Gy5DeacuVTAgKOONfBTwpv2tG\ns9GFIbomjyYMr53I+lMkJ3t1JoXUcigXLxF/r5mpQGCUHMutBjJsUT/YAyO6\nXbn0XfDVLRQKz1H/DBkTKF/wvSeXZYAYIZJi7bBt51HPwljb9gNOYkyLsufB\nbXb1g6mb62yLcPtmfXEngOMHwH7GJWjJMn9LNXiKjL3sn/81JNbFJgApIqfo\nU9mA0xtM45feJCuDV1aIrhf5HvDmS6vsXkoFgIMwLb5ImA3rHRs1mhDzUnNh\nafEtpLA4nQXPBL1jyPSX5W9w5cksmPB5dUUkI+rP0s97DOGQLM4Al46Mbsa/\nCzeWPArNxFDUPEjDtUMcI8MLNB3TRSqEIc/EicGtgg7PtSKuUa+5pmQ4PxMT\nRCo/KvGeVze0rE/UhdSbNqPc5NoN4gpUF158HlzRGovIGn1CKTRqo+hE/xKb\nLirrRAcK5Gr9fcWZrhR+DOZEC/9A1498+xz/HeO3mz46/nLo1qlKCzCO+GMA\nlH6FLAcFBWJZNym0t4HtEVR0CVLMN3yBzKjGnKaKmVrC9RLQD1wYHjLSSiw2\n4CcL\r\n=RQmv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBPPep/z0+wzqpbbXB/DHwyrlMuBX9NXJezghfqt6NgnAiA0NiredrWrR9XRqQiiOrTY9Uy5H/7NcpW0klksClM5SA=="}]},"maintainers":[{"name":"formatlos","email":"mr@formatlos.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-env_1.1.0_1550499438495_0.2811506574164573"},"_hasShrinkwrap":false},"1.1.1":{"name":"next-env","version":"1.1.1","main":"index.js","license":"MIT","homepage":"https://github.com/formatlos/next-env","repository":{"type":"git","url":"git+https://github.com/formatlos/next-env.git"},"keywords":["next.js","next","plugins","environment","env","dotenv","runtime","configuration"],"peerDependencies":{"next":">= 5.1.0"},"devDependencies":{"next":"^6.1.1","webpack":"3.10.0"},"dependencies":{},"gitHead":"e30d23e1bfb5247f49f949d32aede97a1199816d","description":"Automatic static (build-time) or runtime environment variables injection for [Next.js](https://github.com/zeit/next.js).","bugs":{"url":"https://github.com/formatlos/next-env/issues"},"_id":"next-env@1.1.1","_nodeVersion":"13.7.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-uZo/u0GhmkUaSg4Dcx39QsEGRFw2eianNsdzdm/9Bd4bTAfzDH/D6y0WyB34sESZ5hXPctHg3t3Q3U99QAMc1w==","shasum":"4ec4c1f745f36a24fe95d500d1118a3e934d6d6e","tarball":"https://registry.npmjs.org/next-env/-/next-env-1.1.1.tgz","fileCount":5,"unpackedSize":7050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeO2WCRA9TVsSAnZWagAAjAsP/35H4K8wm851r3MHV56L\njV/dULQHwQgSohBXM/HYhajOIBs/u1kP3MxiiGWJrA9vi5CRns4Fix4WBSde\nW9cedOKasDd7KDUebwOsIhr8+AODjmboVvtp2Cxlqyt5PPF9xrot+QyWMsOu\n1CzpXH/9alsvDfutjwBkaxj4oIqWdKwEPDbXlvFaxId4d5ymqHFVvn95KbdP\nwjbCP7W4E8JQtqwBhXcRdjOrOVffcbpxvZMwnGaNwM05+Rpu1SBhU859rsQI\nprs9YgrDzRzTt5HiANbsyE7lan3tsJuyhFogLKcQ/FIHKoSxHa9xMx2111QN\nUTX2bnrVm07EpIGVMBXOPlThZ8L6dFjH/zS4imVulzVENWbJexAX2ffb4xqs\nQBrdxzTJ/IUPpDtarYcjPXQSWXstnkGAGkI1XOocvHiYsJ1tmSpUDgHy44It\nFlvfvbdUXScN0T0U8IN84b9i8KDb+3TygygZCJEVGaWjtuLXpk9lePafTwZO\nPS9Bj96AwvvucIT0xoNsaRRvCLcXXViqKo2co15xBcxaGMLbuJHH0EmI77Xm\nq7JUXQVKPxdW11h1ykI3Pw61kNdWomzBXM5+Lft4dho/sfo84N34I8+dbv3H\nS2plu0f4YKZKhxNS6C6Sd0ez2AmAWOW6dvCTWhUOP9QWqACVWd31QuQk5K4X\nrUa7\r\n=uCuB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo8mYT7+P/JQZncaABJvU1o76NCiDjuoO9WooeNpJoiQIhAJ4j8OflzvgS1ka1JofkDd2vXfZH1tvqU3PQaOEqvdZ2"}]},"maintainers":[{"name":"formatlos","email":"mr@formatlos.de"}],"_npmUser":{"name":"formatlos","email":"mr@formatlos.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-env_1.1.1_1584983446027_0.2270678606571832"},"_hasShrinkwrap":false}},"time":{"created":"2018-08-16T06:37:36.268Z","1.0.0":"2018-08-16T06:37:36.363Z","modified":"2022-05-10T14:45:07.291Z","1.0.1":"2018-08-17T18:09:37.288Z","1.1.0":"2019-02-18T14:17:18.690Z","1.1.1":"2020-03-23T17:10:46.130Z"},"maintainers":[{"name":"formatlos","email":"mr@formatlos.de"}],"description":"Automatic static (build-time) or runtime environment variables injection for [Next.js](https://github.com/zeit/next.js).","homepage":"https://github.com/formatlos/next-env","keywords":["next.js","next","plugins","environment","env","dotenv","runtime","configuration"],"repository":{"type":"git","url":"git+https://github.com/formatlos/next-env.git"},"bugs":{"url":"https://github.com/formatlos/next-env/issues"},"license":"MIT","readme":"# next-env\n\nAutomatic static (build-time) or runtime environment variables injection for [Next.js](https://github.com/zeit/next.js).\n\nThe plugin doesn't handle loading of dotenv files. Use [dotenv](https://github.com/motdotla/dotenv) or [dotenv-load](https://github.com/formatlos/dotenv-load).\n\n## Installation\n\n```sh\nnpm install --save next-env dotenv-load\n```\n\nor\n\n```sh\nyarn add next-env dotenv-load\n```\n\n## How it works\n\nYour project can consume variables declared in your environment as if they were declared locally in your JS files. \n\nBy default any environment variables starting with `NEXT_STATIC_` will be embedded in the js bundles on build time. \nVariables starting with `NEXT_PUBLIC_` are injected on runtime (using [Next.js](https://github.com/zeit/next.js) publicRuntimeConfig internally).\nOn node-side (SSR) all environment variables are available by default, but it is a good idea to follow the naming convention `NEXT_SERVER_`.\n\n## Usage\n\n### Simple\n\nThis module exposes a function that allows to configure the plugin.\n\nIn your `next.config.js`:\n\n```js\nconst nextEnv = require('next-env');\nconst dotenvLoad = require('dotenv-load');\n\ndotenvLoad();\n\nconst withNextEnv = nextEnv();\n\nmodule.exports = withNextEnv({\n  // Your Next.js config.\n});\n```\n\nIn your `.env`:\n\n```\nNEXT_SERVER_TEST_1=ONLY_ON_SSR\nNEXT_PUBLIC_TEST_1=INJECTED_BY_SSR\nNEXT_STATIC_TEST_1=STATIC_TEXT\n```\n\nIn your `pages/index.js`:\n\n```js\nexport default () => (\n  <ul>\n    <li>{process.env.NEXT_SERVER_TEST_1}</li>\n    <li>{process.env.NEXT_PUBLIC_TEST_1}</li>\n    <li>{process.env.NEXT_STATIC_TEST_1}</li>\n  </ul>\n)\n```\n\nIn the above example the output of `process.env.NEXT_SERVER_TEST_1` should only be visible until client-side rendering kicks in.\n\n\n### Advanced\n\nIn your `next.config.js`:\n\n```js\nconst nextEnv = require('next-env');\nconst dotenvLoad = require('dotenv-load');\n\ndotenvLoad();\n\nconst withNextEnv = nextEnv({\n  staticPrefix: 'CUSTOM_STATIC_',\n  publicPrefix: 'CUSTOM_PUBLIC_',\n});\n\nmodule.exports = withNextEnv({\n  // Your Next.js config.\n});\n```\n\nIn your `.env`:\n\n```\nCUSTOM_SERVER_TEST_1=ONLY_ON_SSR\nCUSTOM_PUBLIC_TEST_1=INJECTED_BY_SSR\nCUSTOM_STATIC_TEST_1=STATIC_TEXT\n```\n\n### with [next-compose-plugins](https://github.com/cyrilwanner/next-compose-plugins)\n\nIn your `next.config.js`:\n\n```js\nconst withPlugins = require('next-compose-plugins');\nconst nextEnv = require('next-env');\nconst dotenvLoad = require('dotenv-load');\n\ndotenvLoad();\n\nconst nextConfig = {\n  // Your Next.js config.\n};\n\nmodule.exports = withPlugins([\n\n  nextEnv({\n    staticPrefix: 'CUSTOM_STATIC_',\n    publicPrefix: 'CUSTOM_PUBLIC_',\n  }),\n\n  // another plugin with a configuration\n  [typescript, {\n    typescriptLoaderOptions: {\n      transpileOnly: false,\n    },\n  }],\n\n], nextConfig);\n```\n","readmeFilename":"README.md"}