# Automatically refresh token with \`getTokenSilently()\`

**URL:** <https://community.auth0.com/t/automatically-refresh-token-with-gettokensilently/99184>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [January 27, 2023, 10:20pm UTC](https://community.auth0.com/t/automatically-refresh-token-with-gettokensilently/99184 "2023-01-27T22:20:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominikjasek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dominikjasek/32/44083_2.png) [@dominikjasek](https://community.auth0.com/u/dominikjasek)\
**Post date:** [January 27, 2023, 10:20pm UTC](https://community.auth0.com/t/automatically-refresh-token-with-gettokensilently/99184/1 "2023-01-27T22:20:49Z")

</div>

Hi, I am building SPA with `auth0` client. I want to use refresh tokens to get new tokens.

I followed [this](https://auth0.com/docs/libraries/auth0-single-page-app-sdk#use-rotating-refresh-tokens) and everything is working.

I am just very curious that this package does not handle automatically refreshing tokens. I mean, I can program it very easily by reading `exp` of `idToken` and few seconds before its expiration, I would call `getTokenSilently()`, which works fine, but…:

Is there any standardised way how to refresh tokens automatically?

Thank you

---

<div class="post-metadata">

**Author:** ![dominikjasek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dominikjasek/32/44083_2.png) [@dominikjasek](https://community.auth0.com/u/dominikjasek)\
**Post date:** [January 27, 2023, 11:06pm UTC](https://community.auth0.com/t/automatically-refresh-token-with-gettokensilently/99184/2 "2023-01-27T23:06:14Z")

</div>

Ok I found answer here [When does getAccessTokenSilently refresh the access token?](https://community.auth0.com/t/when-does-getaccesstokensilently-refresh-the-access-token/90342)

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 3, 2025, 6:31pm UTC](https://community.auth0.com/t/automatically-refresh-token-with-gettokensilently/99184/3 "2025-04-03T18:31:12Z")

</div>

Thanks for sharing your answer with the rest of the community!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 17, 2025, 6:31pm UTC](https://community.auth0.com/t/automatically-refresh-token-with-gettokensilently/99184/4 "2025-04-17T18:31:44Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
