# Refresh accessToken for Severless/ Simple Function add-on

**URL:** <https://community.servicem8.com/t/refresh-accesstoken-for-severless-simple-function-add-on/533>\
**Category:** API & SDK\
**Created:** [April 16, 2023, 2:33am UTC](https://community.servicem8.com/t/refresh-accesstoken-for-severless-simple-function-add-on/533 "2023-04-16T02:33:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@developer](https://community.servicem8.com/u/developer)\
**Post date:** [April 16, 2023, 2:33am UTC](https://community.servicem8.com/t/refresh-accesstoken-for-severless-simple-function-add-on/533/1 "2023-04-16T02:33:45Z")

</div>

**Originally posted by Franco Paul**

Hey ServiceM8 Developer support - I am developing Serverless/ Simple Function add-ons. One of the add-ons is a utility that a user may want to keep open either as a modal or launched from the add-on menu in a dedicated full window. The add-on works, but after 15 minutes (900 seconds) the short-lived accessToken provided by the ServiceM8 Secure Token Service expires.

How is a new access token / refresh token supposed to be issued for this type of app to ensure the user can continue using it without relaunching the app (to acquire a new access token) to keep keep using it?

I see with external web-hosted add-ons, I would simply include code to request a new refresh token when the existing access token gets to the near the end of its expiry. In the case of Serverless/ Simple Function add-ons I’m not sure how to do this via the ServiceM8 Secure Token Service.
