Suggested serverless work flow?

Hey all, currently developing a Web app for Wow using the API. Was wondering what the suggested workflow for a serverless app might be in terms of using a token to access the API.

I don’t want to save the token within my browser state for each user to pass through to my serverless functions to call the API. But I also don’t want to have to ping my database every time I make a call to the bnet API with a serverless function requesting my token for the day. Seems messy to have to do two calls to access one endpoint.

How are you guys handling your app? Do you retrieve your bnet token for the day when the user connects to your site or do you do two calls per bnet API request the first one being a retrieval of your token from your database and the second the actual request to the bnet API your user wanted?

Or is there more options I’m too dumb to even think of?

Thanks

What if you encrypt the token and store it in a JWT ?

I don’t really work with serverless apps but I had to use a similar approach for one of my customers and it proved to be simple and safe. This is just an idea from a back-end developer :smiley:, I recommend waiting if anyone with actual experience with serverless apps reply later.