Replies: 2 comments 6 replies
-
Hey @CaptainN. Previews currently work with the Template system ATM. The example project here uses the The FAUST_SECRET_KEY that you mentioned before is not used in the client side. It's used on the server side to perform authentication. The key thing to check is to accept a On page previews the Would you be able to provide a small reproducible example of your issue here as well so we can troubleshoot? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information. |
Beta Was this translation helpful? Give feedback.
-
There is an example for using faust.js with nextjs, but the solution offered within that repo doesn't add up (and we can't get it to work).
Basically, it says these two things:
FAUST_SECRET_KEY
These two things don't add up. The faust.js library seems to try to load data directly from the client package, but it would not have access to the value stored in
FAUST_SECRET_KEY
because that would be a server only ENV var.And it doesn't work. Nothing loads through these requests (it does allow them, I guess WP is either not restricting cross site requests, or it properly sets CORS).
Anyone know how this is supposed to work?
Alternatively: If someone can point me at how I might just use the
getWordPressProps
function or similar to load preview data (I tried doing it ingetServerSideProps
, but it only seems to load the published version), I could then implement nextjs's preview mode directly, instead of using this one off route. I'd be happy to submit that implementation back to the faust.js repo through a PR - as far as I can tell, the only thing I need is to be able to load a preview document.Beta Was this translation helpful? Give feedback.
All reactions