The proper place to store secrets, keys, API tokens is in https://val.town/settings/secrets.
<aside> ⚠️ Any public or unlisted code can be run by others via the Run API. Be careful about publishing any code that references your secrets because it could allow others the ability to use your secrets (but not see what they are).
</aside>
Secrets can be accessed via process.env
or Deno.env
.
process.env
import process from "node:process"
export let sdk = new SomeSDK(process.env.someSdkSecret)
Deno.env
export let sdk = new SomeSDK(Deno.env.get("someSdkSecret"))