asg017/observable-prerender

Support for private notebooks through API keys in Authorization

Closed this issue · 3 comments

This is a very cool way to automate ETL jobs!
It would be great to support private notebooks through API keys (https://observablehq.com/@observablehq/api-keys) as an HTTP header Authorization: ApiKey xxxx.

Hey thanks for the request!

I agree, I'd love to support that! Right now, since Observable notebooks are dynamically imported from the browser, we can add support for supplying the URL query parameter api_key during that import (inside notebook.load). Doing it with the ApiKey HTTP header might be more complicated, however. I think once we have the ability to load pre-compiled notebooks (ie, loading with a define notebook function described in #2), then this would be more feasible.

I can probably get the URL query param feature added in the next few days, but an HTTP authorization header may take more time

@CobusT As of v0.0.2, you can now use private notebooks with the OBSERVABLEHQ_API_KEY option! Check out the README for details, under the .load() function. Keep in mind, this uses the api_key URL query parameter and NOT the HTTP Authorization header (which I still intend to implement in the future). I'll leave this issue open until that's supported

Let me know if it works/if you have any questions!

That is awesome. Thanks for adding that.