Accessing localstorage through my custom streamlit component

I have created a custom Streamlit component (GitHub - piyushK52/streamlit_globalrefresh: Autorefresh your Streamlit apps) when I run it locally, it works fine and can read and write from the localstorage. But when I upload the build to pypi and install it as a Streamlit component, it is not able to write to the localStorage. I can’t find any information regarding this topic as well. Any help will be greatly appreciated !

I have seen some components built using React that seems to work (GitHub1s) but not sure what is the difference between it and mine implementation.

Have you analyzed the JavaScript log of your browser? How does it look when you run your code locally, and how does it look when you run the code with your extension installed?

Did you include the code related to localStorage in what you are delivering?