How long should I hold on to a Box SDK Client?
I'm accessing the Box APIs via the Node.js Box SDK.
Once I've created a client object for a user (using sdk.getAppAuthClient('user', uid)) how long should I keep hold of it? If I keep using it for too long, will it stop working? (Or will it request new tokens as needed?)
Also, how long should I keep the sdk object for? Is it s problem if I create a new one each time I want to create a client object?
-
I believe the SDK takes care of refreshing the tokens.
I looked at app-auth-session.js...
* These access tokens will be refreshed in the background if a request is made within the* "stale buffer" (defaults to 10 minutes before the token is set to expire).* If the token is also expired, all incoming requests will be held until a fresh token* is retrieved.
サインインしてコメントを残してください。
コメント
1件のコメント