Hello, I tried to query from the server-side using the suggested helper function below but I got XMLHttpRequest is not defined
// Initialize the Prismic api
// accessToken removed because of public API
function initApi(req){
return Prismic.client('https://your-repo-name.cdn.prismic.io/api/v2', {
req: req
});
}
I'm using it on Astro components.
But when I use it on the client-side it's working.