# ReactJS - How can I get refresh token using "@auth0/auth0-spa-js"

**URL:** <https://community.auth0.com/t/reactjs-how-can-i-get-refresh-token-using-auth0-auth0-spa-js/51621>\
**Category:** Get Help\
**Tags:** reactjs, jwt, react, auth0js, login\
**Created:** [October 15, 2020, 6:11am UTC](https://community.auth0.com/t/reactjs-how-can-i-get-refresh-token-using-auth0-auth0-spa-js/51621 "2020-10-15T06:11:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktktkt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ktktkt/32/12789_2.png) [@ktktkt](https://community.auth0.com/u/ktktkt)\
**Post date:** [October 15, 2020, 6:11am UTC](https://community.auth0.com/t/reactjs-how-can-i-get-refresh-token-using-auth0-auth0-spa-js/51621/1 "2020-10-15T06:11:12Z")

</div>

Is there a way to use the auth0-spa-js library to get refresh token? I can get access token or Id-token with built-in functions.

I looked through the source code and seems like auth0-spa-js stores the refresh token cache.ts, I’m not familiar with ts and cant figure out how to add a new function to export the refresh token.

Has anyone done something similar?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 15, 2020, 11:05am UTC](https://community.auth0.com/t/reactjs-how-can-i-get-refresh-token-using-auth0-auth0-spa-js/51621/2 "2020-10-15T11:05:29Z")

</div>

Hey there!

Unfortunately I don’t have that much experience with that repo however I will suggest two approaches in handling this:

- As you have seen that in the typescript file in the repo I would go about it by raising a GitHub issue in the repo and asking the tool maintainers about it directly (the best approach I guess)

- Try utilising our doc on refresh tokens:

> **[Refresh Tokens](https://auth0.com/docs/secure/tokens/refresh-tokens)**
>
> Describes how refresh tokens work to allow the application to ask Auth0 to issue a new access token or ID token without having to re-authenticate the user.
