Including secrets in types generated by wrangler
I am trying to use
npx wrangler types
to allow my wrangler.toml to be the source of truth for my worker types. I previously used a bindings.ts
file that had something like:
where the SECRET_API_KEY
is added with echo 'abcdef12345' | npx wrangler secret put SECRET_API_KEY
. I noted in a comment in my wrangler.toml
that this exists, but otherwise it's not included. When generating types, the secret is not generated in the Env
within worker-configuration.d.ts
presumably because it's not in wrangler.toml
. Is there a way to include secrets that wrangler has created but that are not included in wrangler.toml
when generating types?1 Reply
@admah follow-up feature for Wrangler types command? We can certainly look into it, thanks @skye_31 for the shoutout