Does saving private data act as like a "secret" or "environment variable"?
-
Is this basically like a code secret, or better known as an “environment variable”? Like is it secure enough for like storing a password (for anything) or API key/token (for cloud blocks)? Replit has a whole article about secrets, but here is the most important part which just defines them:“Secrets are encrypted variables you can store within your project to keep sensitive information safe. With APIs, databases, or other external services, secrets allow you to securely pass authentication credentials without exposing them directly in your code.”
-
It should not be used to store real secrets like passwords. The reason is that this block runs on the “client” side (the user’s browser), so when the data is sent over the Internet to the webserver, it is exposed in the network package.
However, for most games/projects you build for learning, it should be good enough.
The “private” mode is meant to store data specific for one user. Say 100 users are running your shared game. Suppose each of them can specify a secret passcode that can be used to save or load game progress. You can use this block and use the “private” mode, so the data is separated by user ID, and 2 users can’t see each other’s data.