The new secrets configuration property lets you declare the secret names your Worker requires in your Wrangler configuration file. Required secrets are validated during local development and deploy, and used as the source of truth for type generation.
wrangler.jsonc
{"secrets": {"required": ["API_KEY", "DB_PASSWORD"],},}wrangler.toml
[secrets]required = [ "API_KEY", "DB_PASSWORD" ]
Local development
When secrets is defined, wrangler dev and vite dev load only the keys listed in secrets.required from .dev.vars or .env/process.env. Additional keys in those files are excluded. If any required secrets are missing, a warning is logged listing the missing names.
Type generation
wrangler types generates typed bindings from secrets.required instead of inferring names from .dev.vars or .env. This lets you run type generation in CI or other environments where those files are not present. Per-environment secrets are supported — the aggregated Env type marks secrets that only appear in some environments as optional.
Deploy
wrangler deploy and wrangler versions upload validate that all secrets in secrets.required are configured on the Worker before the operation succeeds. If any required secrets are missing, the command fails with an error listing which secrets need to be set.
For more information, refer to the secrets configuration property reference.
Source: Cloudflare
Latest Posts
- Dynamics 365 Supply Chain Management – Enable precise serial and batch capture in cluster picking [MC1301473]
![Dynamics 365 Supply Chain Management - Enable precise serial and batch capture in cluster picking [MC1301473] 2 pexels steve 26628057](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Dynamics 365 Commerce – Enable associates to use the nearest store payment terminal [MC1301477]
![Dynamics 365 Commerce - Enable associates to use the nearest store payment terminal [MC1301477] 3 pexels apasaric 325185](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Dynamics 365 Commerce – Display distance in kilometers on the Store Commerce app [MC1301490]
![Dynamics 365 Commerce - Display distance in kilometers on the Store Commerce app [MC1301490] 4 pexels cantuariabruno 774448](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Dynamics 365 Supply Chain Management – Enhance picking speed using spatial location intelligence [MC1301497]
![Dynamics 365 Supply Chain Management - Enhance picking speed using spatial location intelligence [MC1301497] 5 pexels reneterp 333984](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)

![Dynamics 365 Supply Chain Management - Enable precise serial and batch capture in cluster picking [MC1301473] 2 pexels steve 26628057](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-steve-26628057-150x150.webp)
![Dynamics 365 Commerce - Enable associates to use the nearest store payment terminal [MC1301477] 3 pexels apasaric 325185](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-apasaric-325185-150x150.webp)
![Dynamics 365 Commerce - Display distance in kilometers on the Store Commerce app [MC1301490] 4 pexels cantuariabruno 774448](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-cantuariabruno-774448-150x150.webp)
![Dynamics 365 Supply Chain Management - Enhance picking speed using spatial location intelligence [MC1301497] 5 pexels reneterp 333984](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-reneterp-333984-150x150.webp)
![Power Platform - Information regarding the end of support for Global Discovery Service (GDS) API [MC1253577] 7 Power Platform – Information regarding the end of support for Global Discovery Service (GDS) API [MC1253577]](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-pixabay-534174-150x150.webp)