Platforms
Envlet on Netlify
Functions and edge functions read ENVLET_TOKEN from Netlify and load the rest from Envlet.
Set the token
netlify env:set ENVLET_TOKEN envlet_... --context productionLoad in a function
import { load } from "@envlet/sdk";
export default async () => {
const values = await load();
return new Response(values.APP_NAME);
};Set up
- 01
Create a token
Create an identity for Netlify and a token for the environment it deploys.
- 02
Set one secret
netlify env:set with a context per deploy context, each with its own Envlet token.
- 03
Start through Envlet
Call load() or inject() at the top of the function module so one cold start fetches once.
Questions
- Will my app start if Envlet is down?
- No, and that is the point. It retries for a few seconds, then fails so you notice, instead of starting with half an environment.
- Do I still need Netlify's own secret store?
- Only for ENVLET_TOKEN. Everything else lives in Envlet, so you rotate in one place.