Ask coding questions

← Back to all posts
Hiding a json file
[deleted]

i have a json file that i dont want anyone to see, how would i do that
EDIT 1: its the firebase admin sdk json file for python

Voters
MushyAvocado
Comments
hotnewtop
Andy_4sberg

If you're using a programming language that supports it on replit (example: Python), you can use replit db to store the raw json string as a dictionary. No one can see it unless you print it out to the console, or something like that.

robowolf

Try encryption. You can encrypt the JSON file then store in the new repl feature SECRET KEYS. Then when you're ready get it out of the key and decrypt it.

19ecal

You can minify the JSON down to a single line, put that into a .env file, then in your code, get it from there, parse the JSON and voilá you can use it in your code
Working python repl:
https://replit.com/@19ecal/PopularShadowyPhase#main.py

m4rus3ru

You might want to take a look at this:
https://docs.replit.com/repls/secret-keys

m4rus3ru

You will not like this, but I guess your only way to do it would be upgrading your account to 'Hacker'.
Unless you do that your repls are public.

LukeWright

I think the only way to hide a file in repl is either to upgrade to hacker, or rename the file ".env"

LukeWright

Click the check mark next to my comment if this helped! @snekattack

EuanTH

If you're using windows, you can hide a file by going into the properties (which is found by right clicking the file) of the file and clicking on the tick-box "Hidden".

[deleted]

@EuanTH im talking abount in replit