Closed gubikmic closed 2 years ago
Are you sure? I just tested it and it works fine for me. I am using the 'Copy URL only' feature on the Embed page and adding it to the /embed option in Notion...
@gubikmic Any further thoughts? Closing for now, but let us know is this is a problem.
@CobusT Hi there, sorry to follow up on a closed issue but this seemed like a relevant place to ask.
I'm having trouble using an API key to achieve the result you show above with a private notebook-- is that supported? If so, what's the format for the link? I tried appending &api_key=<my key>
to the url copied to the clipboard (https://observablehq.com/embed/<NotebookID>?cell=*
), but I just get a "not found" error back.
@CobusT Hi there, sorry to follow up on a closed issue but this seemed like a relevant place to ask.
I'm having trouble using an API key to achieve the result you show above with a private notebook-- is that supported? If so, what's the format for the link? I tried appending
&api_key=<my key>
to the url copied to the clipboard (https://observablehq.com/embed/<NotebookID>?cell=*
), but I just get a "not found" error back.
API keys cannot be used with the iframe embeds. However, they can be used when you embed using JavaScript (see https://observablehq.com/@observablehq/api-keys).
However, I want to stress that using API keys in your code on public websites is not a good idea. It is really meant for private sites where the API key won't be compromised. As we say in our FAQ here (https://observablehq.com/@observablehq/troubleshooting-embedding?collection=@observablehq/embedding-notebooks#secret):
"you can use an API key to embed, but only if the embedding website is private and secure, because anyone who looks at the source will be able to see your API key. You should treat an API key like a password; it grants unrestricted access, and is only useful in very specific and carefully controlled circumstances."
Some of our customers solved this by adding the API key through a proxy server for the requests to https://api.observablehq.com
.
I really appreciate the fast response, and the warning! I don't see a way to run arbitrary javascript in Notion (not surprising!). Is it impossible to embed a private observable notebook into Notion?
Not that I am aware of. You may want to ask on the Forum (talk.observablehq.com) to see if anyone built something on the notion side to support that.
Thanks a mil
Notion allows embedding most websites and provides an embed for Deepnote. Observable unfortunately can't be embedded.