@bareblends/vsf-prismic
Version:
Prismic CMS integration with Vue Storefront
26 lines (20 loc) • 524 B
text/typescript
import { apiClientFactory } from '@vue-storefront/core'
import Prismic from '@prismicio/client'
import { ApiContext, ContentSearchParams } from './types'
import { getContent } from './api'
const setup = ({ apiOptions, endpoint }: ContentSearchParams): ApiContext => {
return {
client: Prismic.client(endpoint, apiOptions),
config: {
apiOptions,
endpoint
}
}
}
const { createApiClient } = apiClientFactory({
onCreate: setup,
api: {
getContent
}
} as any)
export { createApiClient }