UNPKG

@nosto/shopify-hydrogen

Version:

Component library to implement Nosto within Shopify Hydrogen

11 lines (10 loc) 662 B
/** * Creates a custom script loader function which passed to nosto-react component NostoProvider as a prop * and used in useLoadClientScript hook for loading scripts. This will override the default script loader behaviour * since a `nonce` attribute is required by Shopify for third party scripts. Additionally, this lets the useLoadClientScript * to handle building the URL string (scriptSrc in the returned function param). */ import { ScriptLoadOptions } from '@nosto/nosto-react'; type ScriptLoader = (scriptSrc: string, options?: ScriptLoadOptions) => Promise<void>; export default function createScriptLoader(nonce: string): ScriptLoader; export {};