import Prismic from 'prismic-javascript';
export const apiEndpoint = 'https://ionicframeworkcom.prismic.io/api/v2';
// Client method to query documents from the Prismic repo
export const Client = (req = null) => Prismic.client(apiEndpoint, createClientOptions(req, null));
const createClientOptions = (req = null, prismicAccessToken = null) => {
  const reqOption = req ? { req } : {};
  const accessTokenOption = prismicAccessToken ? { accessToken: prismicAccessToken } : {};
  return Object.assign(Object.assign({}, reqOption), accessTokenOption);
};
