How to hide sensitive data before deploying yo Streamlit Sharing


I have been using environment variables to store my API keys and TOKENs. But after I have deployed my app, I cannot access them online and my app gives KeyErrors.

Is there any way to use my keys without publicly saving them in the github repo?
I have read many posts regarding the topic but some of the methods sound like more work than it needs to be…

Thanks, Bex

Hi @BexTuychiev -

Secrets management for Streamlit sharing is tentatively scheduled for a December January release.



That would be great. Thanks!

I too am excited about a secrets management system in the meantime I am using this work around: Secrets management

Hello @randyzwitch, I was just planning on using Streamlit Sharing but have secrets and I just saw this post regarding January release. Is this still in the planning for January?

it seems to be feb, is it still on track for release?

Yes, technically today is “February”…secrets management almost certainly will come out this month, as we’ve been testing this internally for a while. If I had to guess, I’d say in another two weeks, but it’s not firmly scheduled for a specific date yet.

Ok, thanks

@randyzwitch Could you please tell me if this feature is likely to be released next week?

@randyzwitch Hi, did you get my message?

Yes, I did. However, I don’t have a firm date to tell you.

@randyzwitch Thanks for replying. I reckon it is not going to be implemented anytime soon, correct?

I wouldn’t say “anytime soon”. I just don’t have a firm date to give, because if I guess, the exact day I say people will start sending me messages saying it’s that date, where is it? :slight_smile:

Thanks again. I did not mean to inconvenience you. Sorry if you felt rushed.

1 Like

Hi everyone -

Secrets management is now available in Streamlit sharing! You need to upgrade to version 0.80 of Streamlit, the temporary documentation location is linked below.