Class: Api

Api

new Api(url) → {Api}

The kit's main entry point; initialize your API like this: Prismic.api(url, {accessToken: "XXX"})
Parameters:
Name Type Description
url string The mandatory URL of the prismic.io API endpoint (like: https://lesbonneschoses.prismic.io/api)
options.callback function Optional callback function that is called after the API was retrieved, which will be called with two parameters: a potential error object and the API object
options.accessToken string The accessToken, necessary if the API is set as private
options.req string The NodeJS request (only use in a NodeJS context)
options.requestHandler function Environment specific HTTP request handling function
options.apiCache object A cache object with get/set functions for caching API responses
options.apiDataTTL int How long (in seconds) to cache data used by the client to make calls (e.g. refs). Defaults to 5 seconds
Source:
Returns:
- The Api object that can be manipulated
Type
Api