https://supertokens.com/ logo
verification latency
v

vigneshkumar

04/19/2023, 5:26 AM
Hi @rp, So I'm planning to introduce supertokens in my design based application, so If i'm introducing backend sdk with it, there will be a latency since the flow goes like this, 1. user does an operation in the front end 2. front end does an api call to backend sdk of supertokens, which verifies session 3. backend call my backend application in turn for operations. will this latency affect the user experience? since I want to give a seamless experience to the user. What's your thoughts on this?
r

rp

04/19/2023, 5:33 AM
hey @vigneshkumar instead of the frontend calling the backend that has integrated our backend SDK, have it call your application backend with the JWT from our session. Your application backend then verifies the JWT using a standard jwt verification lib.
v

vigneshkumar

04/19/2023, 5:41 AM
So if we do this, we eliminate the need of backend sdk but still, we need the supertokens-core and frontend sdk right? even if we do this, how do we cache the public key in my backend application such that I can verify the jwt?
r

rp

04/19/2023, 5:49 AM
you don't eliminate the need for the backend SDK cause the auth related apis are exposed to the frontend via the backend SDK. The public key should be cached on your backend application by the jwt verification lib you use.