PricingBlog

Storing API Keys

  • _.__._.__.__._-1418218541336887419

    Ethan

    5 months ago

    Hi all,

    I imagine this is a very noobish question, but I am having trouble finding information on what the best practice is for storing API keys in my app. My app integrates Twilio messaging. All API calls require an Authorization header with a key made from <AccountSid>:<ApiKey> encoded to base64. I am not sure where or how to store this, so that it cannot be leaked or accessed by end users.

    It would be very bad if this was leaked, how should I go about storing it? While testing I'm just building the string in the api call and sending it, but I imagine that is not the correct approach.

    Any tips/suggestions/resources would be appreciated! I am using Supabase as my database
    1
  • whitep4nth3r-1418220625868099666

    salma

    5 months ago

  • The TL:DR is use a backend
  • _.__._.__.__._-1418224394076950631

    Ethan

    5 months ago

    Thanks, from this what I am guessing I should do is instead of calling the APi from my app, call a supabase edge function that then calls the API, and store the key only in the backend
  • whitep4nth3r-1418224593541267612

    salma

    5 months ago

    yes exactly!
  • _.__._.__.__._-1418224752849588285

    Ethan

    5 months ago

    Thanks for the help!
  • whitep4nth3r-1418224778258419775

    salma

    5 months ago

    you're welcome!