Embedding OCaml Discourse


Discourse has the ability to be embedded within other websites (https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963). We want to use this for reviewing the updated version of Real World OCaml.

There is still some admin work needed to make this possible though (from the linked article):

Configuring Discourse for Embedding (simple setup)

The following setup will embed a comment feed on a page on a fake blog URL of http://example.com/blog/entry-123.html, from a discourse forum running at http://discourse.example.com.

Visit Admin > Customize > Embedding on your Discourse install.

Create at least one embeddable host. This should be the hostname (domain) where you want to embed your comments. In this case the host is example.com – note the lack of http:// and path.

(optional) - if you supply a category alongside the host you are entering, posts imported from that host will automatically end up in that category. Different hosts can post to different categories.

Fill in the name of a user on your discourse who will create topics in the Embed by Username field. Let’s assume our discourse has a user called eviltrout, so the value is eviltrout.

Besides Real World OCaml this might also be interesting for other websites.


I’ve set this up for the realworldocaml domains – thanks for digging out the instructions. If anyone else wants to access the API for their own sites, please post here and @gasche or I can make the necessary changes.


Having said that, I wonder if we need a staging forum to mess around with, since the API access only grants it to the production realworldocaml.org, so it’s not much use for day-to-day development…