• Home
  • Blog
  • Projects
  • Bookshelf
  • About
← Back to all status updates

Tip: Secrets for Cloudflare Workers

Published ....
Last modified ....
From Boston, MA

Share this status update on BlueskySee discussion on Bluesky


To add a secret to a worker (where there's a wrangler.jsonc/.toml file in the current directory):

bunx wrangler secret put SECRET_NAME

It'll prompt for the value of the secret, and you'll be all set!

Generated Types

To add that new secret to the generated types from bun wrangler types, you'll need to do the following:

  • create a .env.local file
  • Add a stub of the secret there
  • Run bun wrangler types to re-generate types

See this feature request to make this workflow a bit easier!


Docs: https://developers.cloudflare.com/workers/configuration/secrets/


Tags:

micropost
Cloudflare
workers
wrangler
Tip

Loading...

Related Posts

micropost

Quick-Tip: Codex Chief of Staff Thread

....

Tip: GitHub Created Date Filtering

....

Link: Next.js Is Infuriating

....

Dependabot Hell

....

Link: What the hell is going on right now?

....

Recipe: Horchata Protein Latte

....

Zombie Retros

....

Link: How I build software quickly

....

Vacation (and streaks)

....

Polish is Important

....

<Blank> Driven Development

....

All Documentation Should Be Dated

....

Adding Microposts

....

Service Monitors and Observability

....

Leveraging service monitors properly to improve service observability.

Being Unopinionated

....

It's fine for a library to express some opinions about how it should be adopted and how the overall workflow/application in which it is adopted should function. However, it's false advertising to say that it is unopinionated.

Stop Snacking

....

No I don't mean those Milano cookies you keep taking from the office snack wall either (although you should probably stop snacking on those as often as well).

No Process is Invisible Process

....

Low/no process workflow wasn't actually no process, it was only an "invisible" process. An implicit contract with everyone on the team to do that async workflow on their own time.

Cloudflare

Configuring Cloudflare Domains with Vercel

....

I've started to use Cloudflare to manage my domains for several side projects, have had to jump through the same hooks multiple times that I figured I should document them here!

Project Deep Dive: Tails

....

A(nother) deep dive into one of my recent side projects; tails - a plain and simple cocktail recipe app.

Project Deep Dive: Microfibre

....

Tip

Quick-Tip: Codex Chief of Staff Thread

....

Tip: GitHub Created Date Filtering

....

Roundup Notes in Obsidian with Dataview

....

A quick tip for creating roundup or summary notes based on other notes in Obsidian using the Dataview plugin!

A deep dive into one of my recent side projects; microfibre - a minimal text posting application

Quick Tip - Theme Aware Images

....

Have you ever found the need to change the image you render on a web page based on the current preferred color scheme of your theme?

Async Class Creation In JavaScript

....

Have you ever wanted to create a class in JavaScript or TypeScript but also have the initialization be async? Here's a quick tip on a pattern that I've used in the past!

Server Side Rendering Compatible CSS Theming

....

A quick tip to implementing CSS theming that's compatible with Server Side Rendered applications!

Replacing Dropbox Capture with Raycast

....

Recently Dropbox announced that it was shutting down the Capture app/service, so I sought out an alternative that provided a similar user experience!

Quick Tip - Specific Local Module Declarations

....

A quick tip outlining how to provide specific TypeScript type definitions for a local module!

Bluesky Tips and Tools

....

A (running) collection of Bluesky tips, tools, packages, and other misc things!

The Bookkeeping Pattern

....

A quick look at a small but powerful pattern I've been leveraging as of late!

Don't Break the Implicit Prop Contract

....

React components have a fundamental contract that is often unstated in their implementation, and you should know about it!

A Better useSSR Implementation

....

Replace that old useState and useEffect combo for a new and better option!

Tip: Request and Response Headers

....

There's a common gotcha when creating Web Request and Response instances with Headers!

Exporting Custom Slack Emoji

....

How to easily mass-export your custom slack emoji without API access!

Custom Favicon Recipes

....

Two neat tricks for enhancing your site's favicon!

Fixing Zed's language server

....

Zed language server quick tip; fixing Zed's language server