Skip to content

Instantly share code, notes, and snippets.

@prismicdeveloper
Last active August 29, 2015 14:18
Show Gist options
  • Save prismicdeveloper/c737c4588742c328026f to your computer and use it in GitHub Desktop.
Save prismicdeveloper/c737c4588742c328026f to your computer and use it in GitHub Desktop.
var previewToken = 'MC5VbDdXQmtuTTB6Z0hNWHF3.c--_vVbvv73vv73vv73vv71EA--_vS_vv73vv70T77-9Ke-_ve-_vWfvv70ebO-_ve-_ve-_vQN377-9ce-_vRfvv70';
Prismic.Api('https://lesbonneschoses.prismic.io/api', function (err, Api) {
var stPatrickRef = Api.ref("St-Patrick specials");
// Now we'll use this reference for all our calls
Api.form('everything')
.ref(stPatrickRef)
.query(Prismic.Predicates.at("document.type", "product")).submit(function (err, response) {
if (err) {
console.log(err);
done();
// The documents object contains a Response object with all documents of type "product"
// including the new "Saint-Patrick's Cupcake"
});
}, previewToken);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment