Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@cuww/runtime-env
Advanced tools
Runtime Environment Variables for frontend applications build with NextJs. It simplifies the process of storing and managing environment variables. Forget about the hassle of storing and configuring CI/CD pipelines specifically for frontend apps, simply u
Runtime Environment Variables for frontend applications build with NextJs. It simplifies the process of storing and managing environment variables. Forget about the hassle of storing and configuring CI/CD pipelines specifically for frontend apps, simply use kubernetes, etc.
NEXT_PUBLIC_*
as you get used to.You can install the @cuww/runtime-env
package using npm:
npm install @cuww/runtime-env
or yarn:
yarn add @cuww/runtime-env
Follow these steps:
const { withRuntimeEnv } = require('@cuww/runtime-env/dist/next');
const config = {
...
}
module.exports = withRuntimeEnv(config)
Add <PublicRuntimeEnvProvider/>
as in the example
import { PublicRuntimeEnvProvider } from '@cuww/runtime-env'
import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html lang="en">
<Head />
<PublicRuntimeEnvProvider />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
Use env
function to get variables value.
Use NEXT_PUBLIC_
prefix if you want to use this variable in runtime and get access from the client (not server variable).
import { env } from '@cuww/runtime-env'
// Public variable available at a runtime and for everyone (not secure)
env('NEXT_PUBLIC_VARIABLE_NAME', 'DefaultValue')
// Public variable available at a runtime only for server
env('VARIABLE_NAME', 'DefaultValue')
This project is licensed under the MIT License.
FAQs
Runtime Environment Variables for frontend applications build with NextJs. It simplifies the process of storing and managing environment variables. Forget about the hassle of storing and configuring CI/CD pipelines specifically for frontend apps, simply u
The npm package @cuww/runtime-env receives a total of 40 weekly downloads. As such, @cuww/runtime-env popularity was classified as not popular.
We found that @cuww/runtime-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.