AgilityFetch

AgilityFetch

Agility Fetch API JS SDK for retrieving content from the Agility CMS

Source:

Namespaces

Client
Types

Methods

(static) getApi(config) → {AgilityFetch.Client}

How to create an instance of an an API client for the Agility Content Fetch REST API.

Source:
Parameters:
Name Type Description
config Object

API intialization params.

Name Type Attributes Description
guid string

The guid that represents your instance.

apiKey string

The secret token that represents your application.

isPreview boolean <optional>

If your access token is for preview, then set this to true.

caching Object <optional>

Optional Caching options. Caching is disabled by default.

Name Type Attributes Description
maxAge number <optional>

In miliseconds. Default value is 0 (disabled). Recommeded value is 180000 (3 mins). Requests are cached in memory only (node or browser).

baseUrl string <optional>

Optionally override the default API Base Url.

Returns:
Type:
AgilityFetch.Client
Example
import agility from '@agility/content-fetch'

const api = agility.getApi({
  guid: '191309ca-e675-4be2-bb29-351879528707',
  apiKey: 'aGd13M.fa30c36e553a36f871860407e902da9a7375322457acd6bcda038e60af699411',
  isPreview: false
});