๐—œ ๐—š๐—ฎ๐˜ƒ๐—ฒ ๐—–๐—น๐—ฎ๐˜‚๐—ฑ๐—ฒ ๐—”๐—ป ๐—”๐—ฃ๐—œ ๐—ง๐—ผ ๐—ฃ๐—ผ๐˜€๐˜ ๐—•๐—น๐—ผ๐—ด๐˜€

I built a personal blog. I wanted a way to tell Claude to publish a post. I did not want to copy and paste.

I made an API endpoint. It uses an API key for safety.

My tech stack:

The flow is simple. I talk to Claude in the terminal. I tell it to draft a post. Claude sends a POST request. The post appears on my blog as a draft. I edit the final version in my browser.

I hit a wall with the API key. I used bcrypt to hash it. I put the hash in my env file. The server failed.

Next.js reads the dollar sign in the hash. It thinks the sign is a variable. It replaces the hash with an empty string. This broke the auth.

I found two fixes:

I use the raw key locally. I use the hash in production.

AI handles the rough cut. I handle the polish. It is like a code review for prose.

Future plans:

Build it simple first. Add complexity when it matters. If you build this, watch out for env variables.

Source: https://dev.to/sensational5510/i-gave-claude-an-api-to-post-to-my-dev-blog-and-the-bcrypt-hash-broke-in-2-different-places-18mo