#vibe coder need help w api keys

13 messages · Page 1 of 1 (latest)

sullen shardBOT
#

Hi romeo! I'd be happy to help, but I need more details to give you useful feedback. Here's what would help:

Please share:

  • The specific problem - What's not working or what are you unsure about?
  • Your code - Show the relevant API key implementation (formatted in code blocks)
  • Error messages - Any errors you're seeing?
  • What you've tried - What troubleshooting steps have you already attempted?
  • Context - Which API are you using? What framework/version?

Once you provide these details, you'll get much faster and more accurate help. Thanks!

#

-# TypeScript @tender gulch @karmic rampart @odd hearth

candid cloak
#

a google cloud console api key , set the secret in supabase, added it to my .env file (which is in gitignore obviously) but its warning me that the key is unrestricted, however it needs to be for this current set up, but i just want to make sure thats correct

#

btw this is what claude said when i asked:

Yes, None is correct for this specific architecture. Don't pick iOS apps — it'll break Books search. Here's why:

Where the request to Google Books actually comes from:

iOS app → Supabase Edge Function (google-books-search) → Google Books API
The HTTP request to Google's servers originates from Supabase's Deno runtime, not from your iOS device. The "iOS apps" restriction tells Google "only accept requests where the bundle ID + iOS app signature matches" — but our request doesn't come from an iOS app at all. It would 403 on every call.

Why None is fine here:

The key lives in Supabase function secrets — it never ships in your iOS bundle. There's nothing to extract from a decompiled IPA.
The Edge Function gates on a valid Supabase session (an attacker would need a real signed-in account to even invoke it).
Per-user rate limit (60/min) caps abuse blast radius even if someone scripted it.
The "Books API only" restriction you already set means a leaked key can't bill against more expensive APIs.
The GCC warning is generic — Google can't tell whether your key sits in a server-side secret store or in a client bundle. It defaults to "warn." For a key behind an authenticated server-side proxy with API + rate restrictions, the warning is overcautious.

The only restriction option that would meaningfully apply is "IP addresses" — restrict to Supabase's egress IPs. But Supabase Edge Functions run on Deno Deploy/Cloudflare with rotating IPs that aren't published as stable CIDR ranges, so it's not practical.

So: leave Application restrictions as None, keep API restrictions as Books API only, hit Save. You're done.

odd hearth
#

looks ok but I'd probably try to learn programming asap

#

things will explode sooner or later

muted gorge
#

It look ok

#

Maybe as a precaution you could add a maximum spend?

#

If thats possible

fallow blaze
#

or tenant based rate limiting

candid cloak
#

just wasnt here for a couple days

#

so wanted to ask around