Updated Discourse embedding parameters

AI-generated summary

Updated Discourse Embedding Parameters

Discourse is updating its embed feature to improve flexibility and security. As a result, the class name field and discourseUserName parameter are being deprecated and will be removed in version 3.2.

  • The class name field can be replaced by setting it in the JavaScript used to embed Discourse, using the className property in the DiscourseEmbed object.
  • The discourseUserName parameter can be replaced by adding a <meta> tag with the author or discourse-username name and the Discourse username as content.

Users are recommended to check the updated suggested script in their admin page (Customize -> Embedding) to ensure a smooth transition.

We are updating Discourse embed feature to make it more flexible and secure. For this reason, we have to deprecate the class name and Discourse username settings and will completely remove them with version 3.2. We are providing equivalent replacement for both of them.

  • We are deprecating the class name field of embeddable hosts, which you could set when you created a new embeddable host. We recommend setting it from the JavaScript that is used to embed in your site.

    <script type="text/javascript">
      DiscourseEmbed = {
        discourseUrl: '...',
        discourseEmbedUrl: '...',
        className: 'CLASS_NAME',
      };
    
      // ...
    </script>
    
  • We are deprecating the discourseUserName parameter from the old DiscourseEmbed options list. We recommend setting via a <meta> tag such as:

    <meta name='author' content='DISCOURSE_USERNAME'>
    

    or

    <meta name='discourse-username' content='DISCOURSE_USERNAME'>
    

We recommend you to check out the new updated suggested script from your admin page → Customize → Embedding.

11 Likes