Currently we are running a javascript script which uses a dangerousGetAll to pull all content from Prismic.
I want to do this, but pull only published content -- is there a way to do this? I was thinking a getAllByType and pass a param as status == published, but I cannot find anywhere where it is storing the status of the content. Any help would be welcome, thanks in advance!
Prismic documents do not explicitly store a status field like "published" or "draft" in their API responses. We automatically excludes drafts from API queries—only published documents are retrievable using the standard API methods.
Instead of using dangerousGetAll, you can use getAllByType, which only returns published documents by default. There is no need to filter by status.
@jennifer.martelle, it only pulls in published. Prismic’s API does not expose drafts unless you are previewing content with a preview ref specifically