├── .audit-ci.json ├── .eslintignore ├── .eslintrc.js ├── .github ├── actions │ ├── back-merge │ │ └── action.yml │ └── setup-pnpm │ │ └── action.yml └── workflows │ ├── ci.yml │ └── release.yml ├── .gitignore ├── .npmignore ├── .releaserc.yaml ├── .vscode └── settings.json ├── LICENSE.md ├── README.md ├── docs ├── EXPOSING_CUSTOM_ENV.md ├── GETTING_STARTED.md └── MAKING_ENV_PUBLIC.md ├── examples ├── with-app-router-context │ ├── .eslintrc.json │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── next.config.js │ ├── package.json │ ├── pnpm-lock.yaml │ ├── public │ │ ├── next.svg │ │ └── vercel.svg │ ├── src │ │ ├── app │ │ │ ├── api │ │ │ │ └── bar-baz │ │ │ │ │ └── route.ts │ │ │ ├── client-side │ │ │ │ ├── page.module.css │ │ │ │ └── page.tsx │ │ │ ├── favicon.ico │ │ │ ├── globals.css │ │ │ ├── layout.tsx │ │ │ ├── page.module.css │ │ │ ├── page.tsx │ │ │ └── server-side │ │ │ │ ├── page.module.css │ │ │ │ └── page.tsx │ │ └── instrumentation.ts │ └── tsconfig.json ├── with-app-router-script │ ├── .eslintrc.json │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── next.config.js │ ├── package.json │ ├── pnpm-lock.yaml │ ├── public │ │ ├── next.svg │ │ └── vercel.svg │ ├── src │ │ ├── app │ │ │ ├── api │ │ │ │ └── bar-baz │ │ │ │ │ └── route.ts │ │ │ ├── client-side │ │ │ │ ├── page.module.css │ │ │ │ └── page.tsx │ │ │ ├── favicon.ico │ │ │ ├── globals.css │ │ │ ├── layout.tsx │ │ │ ├── page.module.css │ │ │ ├── page.tsx │ │ │ └── server-side │ │ │ │ ├── page.module.css │ │ │ │ └── page.tsx │ │ ├── instrumentation.ts │ │ └── middleware.ts │ └── tsconfig.json └── with-pages-router │ └── README.md ├── jest.config.js ├── package.json ├── pnpm-lock.yaml ├── prettier.config.js ├── scripts └── upgrade_deps.sh ├── src ├── helpers │ ├── get-public-env.spec.ts │ ├── get-public-env.ts │ ├── is-browser.ts │ ├── log.spec.ts │ └── log.ts ├── index.ts ├── lib │ └── picocolors.ts ├── provider │ ├── env-context.ts │ ├── env-provider.spec.tsx │ ├── env-provider.tsx │ ├── index.ts │ ├── public-env-provider.spec.tsx │ ├── public-env-provider.tsx │ ├── use-env-context.spec.tsx │ └── use-env-context.ts ├── script │ ├── constants.ts │ ├── env-script.spec.tsx │ ├── env-script.tsx │ ├── env.spec.ts │ ├── env.ts │ ├── index.ts │ ├── public-env-script.spec.tsx │ └── public-env-script.tsx ├── typings │ ├── dict.ts │ ├── nonce.ts │ └── process-env.ts └── utils │ ├── make-env-public.spec.ts │ └── make-env-public.ts └── tsconfig.json /.audit-ci.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.audit-ci.json -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /build 2 | /node_modules 3 | /coverage 4 | /examples 5 | !.eslintrc.js 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.eslintrc.js -------------------------------------------------------------------------------- /.github/actions/back-merge/action.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.github/actions/back-merge/action.yml -------------------------------------------------------------------------------- /.github/actions/setup-pnpm/action.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.github/actions/setup-pnpm/action.yml -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.github/workflows/release.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.gitignore -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.npmignore -------------------------------------------------------------------------------- /.releaserc.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.releaserc.yaml -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/.vscode/settings.json -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/README.md -------------------------------------------------------------------------------- /docs/EXPOSING_CUSTOM_ENV.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/docs/EXPOSING_CUSTOM_ENV.md -------------------------------------------------------------------------------- /docs/GETTING_STARTED.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/docs/GETTING_STARTED.md -------------------------------------------------------------------------------- /docs/MAKING_ENV_PUBLIC.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/docs/MAKING_ENV_PUBLIC.md -------------------------------------------------------------------------------- /examples/with-app-router-context/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /examples/with-app-router-context/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/.gitignore -------------------------------------------------------------------------------- /examples/with-app-router-context/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /examples/with-app-router-context/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/README.md -------------------------------------------------------------------------------- /examples/with-app-router-context/next.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/next.config.js -------------------------------------------------------------------------------- /examples/with-app-router-context/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/package.json -------------------------------------------------------------------------------- /examples/with-app-router-context/pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/pnpm-lock.yaml -------------------------------------------------------------------------------- /examples/with-app-router-context/public/next.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/public/next.svg -------------------------------------------------------------------------------- /examples/with-app-router-context/public/vercel.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/public/vercel.svg -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/api/bar-baz/route.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/api/bar-baz/route.ts -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/client-side/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/client-side/page.module.css -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/client-side/page.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/client-side/page.tsx -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/favicon.ico -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/globals.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/globals.css -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/layout.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/layout.tsx -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/page.module.css -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/page.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/page.tsx -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/server-side/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/server-side/page.module.css -------------------------------------------------------------------------------- /examples/with-app-router-context/src/app/server-side/page.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/app/server-side/page.tsx -------------------------------------------------------------------------------- /examples/with-app-router-context/src/instrumentation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/src/instrumentation.ts -------------------------------------------------------------------------------- /examples/with-app-router-context/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-context/tsconfig.json -------------------------------------------------------------------------------- /examples/with-app-router-script/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /examples/with-app-router-script/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/.gitignore -------------------------------------------------------------------------------- /examples/with-app-router-script/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /examples/with-app-router-script/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/README.md -------------------------------------------------------------------------------- /examples/with-app-router-script/next.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/next.config.js -------------------------------------------------------------------------------- /examples/with-app-router-script/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/package.json -------------------------------------------------------------------------------- /examples/with-app-router-script/pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/pnpm-lock.yaml -------------------------------------------------------------------------------- /examples/with-app-router-script/public/next.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/public/next.svg -------------------------------------------------------------------------------- /examples/with-app-router-script/public/vercel.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/public/vercel.svg -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/api/bar-baz/route.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/api/bar-baz/route.ts -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/client-side/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/client-side/page.module.css -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/client-side/page.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/client-side/page.tsx -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/favicon.ico -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/globals.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/globals.css -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/layout.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/layout.tsx -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/page.module.css -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/page.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/page.tsx -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/server-side/page.module.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/server-side/page.module.css -------------------------------------------------------------------------------- /examples/with-app-router-script/src/app/server-side/page.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/app/server-side/page.tsx -------------------------------------------------------------------------------- /examples/with-app-router-script/src/instrumentation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/instrumentation.ts -------------------------------------------------------------------------------- /examples/with-app-router-script/src/middleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/src/middleware.ts -------------------------------------------------------------------------------- /examples/with-app-router-script/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-app-router-script/tsconfig.json -------------------------------------------------------------------------------- /examples/with-pages-router/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/examples/with-pages-router/README.md -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/jest.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/package.json -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/pnpm-lock.yaml -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | }; 4 | -------------------------------------------------------------------------------- /scripts/upgrade_deps.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/scripts/upgrade_deps.sh -------------------------------------------------------------------------------- /src/helpers/get-public-env.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/helpers/get-public-env.spec.ts -------------------------------------------------------------------------------- /src/helpers/get-public-env.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/helpers/get-public-env.ts -------------------------------------------------------------------------------- /src/helpers/is-browser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/helpers/is-browser.ts -------------------------------------------------------------------------------- /src/helpers/log.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/helpers/log.spec.ts -------------------------------------------------------------------------------- /src/helpers/log.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/helpers/log.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/lib/picocolors.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/lib/picocolors.ts -------------------------------------------------------------------------------- /src/provider/env-context.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/env-context.ts -------------------------------------------------------------------------------- /src/provider/env-provider.spec.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/env-provider.spec.tsx -------------------------------------------------------------------------------- /src/provider/env-provider.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/env-provider.tsx -------------------------------------------------------------------------------- /src/provider/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/index.ts -------------------------------------------------------------------------------- /src/provider/public-env-provider.spec.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/public-env-provider.spec.tsx -------------------------------------------------------------------------------- /src/provider/public-env-provider.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/public-env-provider.tsx -------------------------------------------------------------------------------- /src/provider/use-env-context.spec.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/use-env-context.spec.tsx -------------------------------------------------------------------------------- /src/provider/use-env-context.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/provider/use-env-context.ts -------------------------------------------------------------------------------- /src/script/constants.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/constants.ts -------------------------------------------------------------------------------- /src/script/env-script.spec.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/env-script.spec.tsx -------------------------------------------------------------------------------- /src/script/env-script.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/env-script.tsx -------------------------------------------------------------------------------- /src/script/env.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/env.spec.ts -------------------------------------------------------------------------------- /src/script/env.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/env.ts -------------------------------------------------------------------------------- /src/script/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/index.ts -------------------------------------------------------------------------------- /src/script/public-env-script.spec.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/public-env-script.spec.tsx -------------------------------------------------------------------------------- /src/script/public-env-script.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/script/public-env-script.tsx -------------------------------------------------------------------------------- /src/typings/dict.ts: -------------------------------------------------------------------------------- 1 | export type Dict = { 2 | [key: string]: T | undefined; 3 | }; 4 | -------------------------------------------------------------------------------- /src/typings/nonce.ts: -------------------------------------------------------------------------------- 1 | export type NonceConfig = { 2 | headerKey: string; 3 | }; 4 | -------------------------------------------------------------------------------- /src/typings/process-env.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/typings/process-env.ts -------------------------------------------------------------------------------- /src/utils/make-env-public.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/utils/make-env-public.spec.ts -------------------------------------------------------------------------------- /src/utils/make-env-public.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/src/utils/make-env-public.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expatfile/next-runtime-env/HEAD/tsconfig.json --------------------------------------------------------------------------------