WARNING: Anyone who has access to your browser can look into the security keys and steal the API keys. We highly recommend avoid doing that, as it can cause severe legal issues and financial risks.
Sometimes for testing, or rapid prototyping, or when you are showcasing your project to someone, you don’t want to show or enter the API keys in front of others, and wish the keys would be read automatically from somewhere else. Now you have a way, to store the keys in the browser localStorage.
When you press F12 on a website, and goes into the Application tab, in the Storage section, you can view all the keys and its values stored under localStorage. Note, when you enter the keys in the Scratch blocks, it won’t be automatically saved to localStorage. But if you manually save the keys in the localStorage, then when you load the extension, it will automatically read those keys and initialize the corresponding objects. IP addresses are automatically saved to localStorage for easy connection, but the API keys are not saving automatically, and you need to manually create or delete them as and when required.
Here are the list of keys and their description, that can you manually create in the browser localStorage.
Key Name | Key Description |
HF_ACCESS_TOKEN | Hugging Face API token |
OPEN_WEATHER_MAP_API_KEY | Open Weather API Key |
Ollama_IPAddress | IP address and port of the Ollama server, like: http://127.0.0.1:11434, if not localhost in a school environment |
TTS_VOICE_NAME | Default TTS voice name to use |
CodeCraftGamePadIP | Code Craft gamepad IP address |
mobileGamePadIPAddress | Android Gamepad App IP address |
MQTT_SERVER_URL | MQTT Server URL to be used |
esp32OctoStudioIP | Octo Studio App mobile IP address |
editorFontSize | Code editor default font size on load, last font size manually changed is saved automatically |