'Embed code' for 'link shared' Notebooks

I have some data analytics and viz for a client that I’d like to embed into one of our (html-based) presentations. However I can’t get the ‘embed code’ without publishing the full notebook, which is ofc not an option ^^’.



1 Like

There are two possibilities:

  1. You could just “share” the notebook rather than publish it. In this case, the notebook is still public but only to those who have the link.
  2. You can download the notebook and then embed from your local copy. This is a bit more work but generates code that runs completely independently of the observablehq.com.
  1. is exactly the issue, sharing doesn’t make the cells embeddable like publishing does.
  2. could work, but breaks automatic updating :confused:

If you enable link sharing, you can embed notebooks just as if you published it. E.g.,


Which is the embedded version of

That is false; I do this frequently. Of course, the cell you want to export must still be named.

The more important issue with this is that you should only do it with data you kinda want to hide but for which security isn’t of paramount importance. If you really want to keep your data private, you should use the second technique and send the whole file to your client.


You can also use an API key to embed private notebooks, though note that you should be careful not to reveal your API key as anyone with the key can read your private notebooks.


Ah naming the cells did the trick, the published version had all the visualisations named, the linked one didn’t!

I wish the embed was greyed out with some explanation why it’s not embeddable right now ^^’


That is a pretty slick suggestion, I’d say! @mbostock

1 Like