How I can get token created after auth0-react login inside a vanilla js using auth0-spa-js?

After auth–react login, I wanted to get token silently into a vanilla script page without any dependency, how can I achieve this. Now when I am trying to get the toke using auth0-spa-js it is saying “Login required”, even though I logged using auth0-react.
Can someone help me here .?

If you are using @auth0/auth0-react then there is no need to use auth0-spa-js to get the access token. Here is a Auth0 React example and it shows how to get the access token React Authentication By Example: Using React Router 6.

But if you have a weird hybrid app with react spa and vanilla JS files then here is a bare bone vanilla JS Auth0 example - GitHub - Verfranc/auth0js: Bare bone vanilla JS Auth0 example

thanks for providing the solution for file