Are there any plans for a way to include secrets (e.g. API keys) that are private to the user executing the notebook, even if the notebook itself is public? RunKit allows environment variables (https://discuss.runkit.com/t/using-environment-variables-with-tonic/21) which seems like a fairly elegant solution.
Couldnāt that just be any cell? If someone types an API key into their local copy of a notebook, it doesnāt get published.
Alternately, you could make a little view which saves a variable typed into it to localStorage or whatever.
This feature doesnāt necessarily require any explicit support from Observable.
Yep, what Jacob said - and to make it concrete & reusable, hereās a notebook that you can import from and quickly start storing environment/secrets:
Not sure how much it matters, but note that if you want this to work in Safari or Edge you canāt use spread syntax in object literals.
So ā¦
const input = text({
value,
...options
});
ā¦ throws an error.
Wow, thanks for the thoughtful replies. I love the back and forth between questions <> notebooks. Iām not sure, but I think there might still be good reasons to want secrets in a place well-defined by the notebook runtime/environment. Need to play with this mechanism for a while now
Not to revive an old topic. But would be great if Tomās Secret notebook was moved to one of the main observable collections - maybe Techniques
? Not that hard to find with google search - but didnāt know it existed - and between all my cloud services out there, got a lot of secrets in the closet : - is a great import if one knew it existed. @tom