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

Tip: Secrets for Cloudflare Workers

Published 📅: ....
Last modified 📝: ....
Location 📍: 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:

micropostCloudflareworkerswranglerTip

Loading...

Related Posts

micropost

Tip: GitHub Created Date Filtering

Published: ....

Link: Next.js Is Infuriating

Published: ....

Dependabot Hell

Published: ....

Link: What the hell is going on right now?

Published: ....

Recipe: Horchata Protein Latte

Published: ....

Zombie Retros

Published: ....

Link: How I build software quickly

Published: ....

Vacation (and streaks)

Published: ....

Polish is Important

Published: ....

<Blank> Driven Development

Published: ....

All Documentation Should Be Dated

Published: ....

Adding Microposts

Published: ....

Service Monitors and Observability

Published: ....

Leveraging service monitors properly to improve service observability.

Being Unopinionated

Published: ....

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

Published: ....

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

Published: ....

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

Published: ....

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

Published: ....

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

Project Deep Dive: Microfibre

Published: ....

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

Tip

Tip: GitHub Created Date Filtering

Published: ....

Roundup Notes in Obsidian with Dataview

Published: ....

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

Quick Tip - Theme Aware Images

Published: ....

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

Published: ....

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

Published: ....

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

Replacing Dropbox Capture with Raycast

Published: ....

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

Published: ....

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

Bluesky Tips and Tools

Published: ....

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

The Bookkeeping Pattern

Published: ....

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

Don't Break the Implicit Prop Contract

Published: ....

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

A Better useSSR Implementation

Published: ....

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

Tip: Request and Response Headers

Published: ....

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

Exporting Custom Slack Emoji

Published: ....

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

Custom Favicon Recipes

Published: ....

Two neat tricks for enhancing your site's favicon!

Fixing Zed's language server

Published: ....

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