Content Deep Dive

What is an API key? Where to store it and how keys leak

Blog post from Upsun

Post Details
Company
Date Published
Author
Upsun
Word Count
1,794
Company Posts That Month
16
Language
English
Hacker News Points
-
Post removed?
No
Summary

An API key is a secret credential that identifies an app to an online service, enables requests, and ties usage and charges to an account, so a stolen key can lead to unauthorized activity and costs. The article recommends keeping secret keys out of source code, Git history, browser-facing variables such as NEXT_PUBLIC_ and VITE_, and shared messages; use server-side environment variables or a secrets manager instead, and exclude local .env files from Git. Keys can leak through repositories, front-end builds, logs, AI coding tools, screenshots, or routine sharing, and automated scanners may find public keys quickly. If a key is exposed, revoke it immediately, create and deploy a replacement, check usage and billing, and address how the leak occurred; deleting the key from code does not make it safe. It also advises using limited test keys with AI tools, reviewing their changes, enabling secret scanning, and storing Upsun Cloud credentials as sensitive platform variables rather than in committed configuration files.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
AI Coding Assistant 4 249 74 42 -90%
Secrets Management 4 342 78 46 -91%
AI Agents 2 1,592 295 106 -83%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.