Update loader()

Update the loader() function to pre-load the Intelligems configuration. Optionally pass in a cache interval (in minutes).

import {
  getIntelligemsConfig,
} from '@intelligems/headless/hydrogen';

export async function loader({request, context}: LoaderFunctionArgs) {

...

const intelligems = await getIntelligemsConfig(env.INTELLIGEMS_ORG_ID, <Cache Interval in Minutes>);

return {
...
intelligems,
  }
}

Last updated