Missing data object in v2 of the api (vs v1)

Hello Prismic support team!

A while ago I posted about an error I was encountering with the prismic API Unexpected error on URL when querying Prismic content in metalsmith? . My site is built using Metalsmith + handlebars helpers + prismic. The solution suggested by the prismic support team was to switch from v1 of the api https://dronedeploy-www.prismic.io/api to v2 https://dronedeploy-www.prismic.io/api/v2 in our .env file. While using the v1 api works for us the build process is incredibly slow (see previous support thread and issue). Switching from v1 to v2 completely breaks our site.

Issue is that in v2 API the data object is empty. We currently have lots of handlebars helpers written to get something like {{ data.title.html }} In v2 I see a rawJSON object but no values that contain HTML. I tried searching your help docs and couldnt find anything similar about this issue. Admitedly I'm probably the only person our there using metalsmith + handlebars with prismic.

Heres the json returned for a single piece of content from the api v1 vs v2:

V1: apiv1-ebook-data.json · GitHub
V2: apiv2-ebook-data.json · GitHub

I'm not quite sure what to do next to troubleshoot this issue and we need to upgrade as using the v1 api results in a slow and painful development process.

Any help is appreciated!

Hello Niki,

None of my @Prismic-Support-Team has knowledge in #Metalsmith, But it seems that you kneed to change your Handlebars templates to adapt to the API V2 structure that doesn't seem to be very complicated.

Have you tried to retrieve the data from the rest API v2 using the Prismic API browser

If you can get all the information your application needs, then all you need is to modify the API calls to the new structure.

To learn more about our rest API, please refer to our docs.

Note: I will keep the thread open in case of anybody from the community can help more.

This issue has been closed due to inactivity. Flag to reopen.