Skip to main content

Hydrogen

info

We have a guide explaining how to integrate Composer Core with Hydrogen: Hydrogen CX Framework Guide

useAtama(fetcher, slug, basePath)

Wraps hydrogens useQuery to fetch data using the passed fetcher.

ParameterTypeDefaultRequired?Description
fetcherFetcher-YesAn instance of a fetcher
slugstring-YesThe path to fetch data for
basePathstring''NoThis is useful if your page is running in a sub-directory.

useAtamaFromRequest(fetcher, request, basePath)

Similar to useAtama except instead of accepting a specific path it uses the request object to look for the current url (based on the normalizedUrl).

ParameterTypeDefaultRequired?Description
fetcherFetcher-YesAn instance of a fetcher
requestHydrogenRequest-YesThe hydrogen request object
basePathstring''NoThis is useful if your page is running in a sub-directory.