⚠️ This lesson is retired and might contain outdated information.

Create Environment Variables with Cloudflare Wrangler

Obinna Ekwuno
InstructorObinna Ekwuno
Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated 2 years ago

Learn how to use the [vars] key from Cloudflare Wrangler to create a table of environment variables for your worker scripts.

Instructor: [0:00] If we head over to our wrangler.toml file, we can now add the credentials we need to get on POST data from our Airtable, by using the vars key.

[0:11] The first credential we're going to add, the Airtable base ID. If we copy this, we would want to follow the environment variables format and name this Airtable Base ID. Let's paste that in there.

[0:27] The next one we want to add is our Airtable table name, which is Feedback Table. The next credential we want add is the API key. Your API key would be used for authorization. To add keys that have to be secrets, you can add them and get an API key by clicking Show API Key.

[0:54] To add keys that have to be secrets, you can add them by using Wrangler secrets, and then put your API credential. This would encrypt your credential on your worker and wouldn't be visible to other users.

egghead
egghead
~ 22 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today