Rest API as HTML

I am using the Rest API to add content to my project. Is there a way of getting the actual HTML in the response from Prismic. Prismic gives a JSON response something like this.


At the moment I am looping through the data, adding the type names as a class name in of a , and creating styles to mimic those types. For example {Text} could produce blah blah blah .

Hi Ken,

Welcome to the community :grinning:

You can easily convert the JSON output using the Prismic DOM. It’s our JS library for doing exactly that.

Here’s an example of how to use it in pure JS:

var PrismicDOM = require('prismic-dom');
var titleHtml = PrismicDOM.RichText.asHtml(, linkResolver)

You can see more examples here, we also have examples in many different frameworks:

Let me know if you have any other questions.


This issue has been closed due to inactivity.