useStorage at an event handler for webpixel api

Hi there,

I am new to shopify and could not find an example for the useStorage hook anywhere.

Is it possible to use this during webpixel api? The documentation states that “The base API object provided to purchase, and customer-account.order-status extension targets.”

If not, how should I access to localStorage or sessionStorage during an eventHandler for webpixel api?

If I can, could you please provide some pointers? The documentation is somewhat poorly written as I do not know where to import this from?

Thanks

something like this works

const storage = useStorage();

useEffect(() => {

storage.write(“test”,“newnew”);