Skip to main content

Fetcher

A fetcher is responsible for providing experience data to the integration. We currently have one fetcher called @atamaco/fetcher-atama that's fetching experience data from the Delivery API.

There's a simple interface (@atamaco/fetcher) that each fetcher must implement. The interface has 2 methods:

getAllPaths(config): Promise<string[]>

Return a list of all published paths.

ParameterTypeDefaultRequired?Description
config.excludedPathsstring[]-NoA list of paths to exclude.
config.includedDirectoriesstring[]-NoA list of directories to include. Any experience not in this path is not included.
config.excludedDirectoriesstring[]-NoA list of directories to exclude. Any experience not in these paths is included.

For examples see @atamaco/fetcher-atama.

getData(path): Promise<CXExperience>

Return the experience data for a specific path.

ParameterTypeDefaultRequired?Description
pathstring-YesThe path of the experience to fetch

For examples see @atamaco/fetcher-atama. You can also learn more about the CXExperience format.

action<T, R>(actionConfig): Promise<R>

Runs an action.

ParameterTypeDefaultRequired?Description
actionIdstring-YesThe id of the action
slugstring-YesThe slug of the page where the action is running
inputT-YesThe input data for the action