secret put interactive prompt mangles long opaque strings2026-05-05. Twice in a row, manually pasting a Resend API key into wrangler's interactive prompt resulted in 401 "API key is invalid" from the downstream service. Piping the validated shell env value via printf '%s' "$VAR" | npx wrangler secret put NAME worked first try. Always pipe long secrets, never paste interactively.
The printf '%s' is critical — it emits the value with NO trailing newline. (echo adds one by default, which would itself break the secret.)
Read the doctrine. Apply it on the next ship cycle.
2026-05-05. Twice in a row, manually pasting a Resend API key into wrangler's interactive prompt resulted in 401 "API key is invalid" from the downstream service. Piping the validated shell env value via printf '%s' "$VAR" | npx wrangler secret put NAME worked first try. Always pipe long secrets, never paste interactively.
"I'm almost positive I can help. If I can't, you don't pay."
— PJ · SideGuy Solutions · 858-461-8054 · sms:+18584618054
📲 Text PJ — 858-461-8054