
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
@serverless-stack/static-site-env
Advanced tools
A simple CLI that allows your static site to load the environment variables from your SST app.
A simple CLI (@serverless-stack/static-site-env that allows your static site or Next.js app to load the environment variables from your SST app. This means that you won't have to hard code the config from your backend. Supports React.js, Next.js, and Svelte.
Run the following in the root of your static site or Next.js app.
# With npm
npm install @serverless-stack/static-site-env --save-dev
# Or with Yarn
yarn add @serverless-stack/static-site-env --dev
Once installed, tweak the start command in your package.json scripts.
Note that, you need to have sst start running for this to work.
"scripts": {
"start": "sst-env -- react-scripts start",
},
Start your local dev environment as usual.
npm run start
"scripts": {
"dev": "sst-env -- next dev",
},
And run.
npm run dev
"scripts": {
"dev": "sst-env -- vite",
},
And run.
npm run dev
--pathA relative path to the directory containing the sst.json file.
Note that, the sst-env CLI will traverse up the directories to look for the root of your SST app. If the static site or Next.js app is located outside the SST app folder, for example:
/
backend/
sst.json
frontend/
package.json
Pass in --path to specify the relative path of the SST app.
"scripts": {
"start": "sst-env --path ../backend -- react-scripts start",
},
Here's what's going on behind the scenes.
sst start command generates a file with the values specified by StaticSite, ReactStaticSite, ViteStaticSite, or NextjsSite construct's environment prop.sst-env CLI will traverse up the directories to look for the root of your SST app. If the static site or Next.js app is located outside the SST app folder, pass in --path to specify the relative path of the SST app.FAQs
A simple CLI that allows your static site to load the environment variables from your SST app.
We found that @serverless-stack/static-site-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.